Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Geometry.toText()


            } else if( attribute instanceof String){
                String txt = encodeString((String) attribute);
                build.append( txt );
            } else if (attribute instanceof Geometry) {
                Geometry geometry = (Geometry) attribute;
                String txt = geometry.toText();
               
                txt = encodeString( txt );
                build.append( txt );
            } else {
                String txt = Converters.convert( attribute, String.class );
View Full Code Here


                    LOGGER.fine("Split segment exceeds the 180 degree longitude limit to conform to SOLR WKT manager specification");
                }
                Densifier densifier = new Densifier(geometry);
                densifier.setDistanceTolerance(SOLR_DISTANCE_TOLERANCE);
                if(LOGGER.isLoggable(Level.FINE)){
                    LOGGER.fine("Original geometry: " + geometry.toText());
                }
                geometry = densifier.getResultGeometry();
                if(LOGGER.isLoggable(Level.FINE)){
                    LOGGER.fine("Densified geometry: " + geometry.toText());
                }              
View Full Code Here

                if(LOGGER.isLoggable(Level.FINE)){
                    LOGGER.fine("Original geometry: " + geometry.toText());
                }
                geometry = densifier.getResultGeometry();
                if(LOGGER.isLoggable(Level.FINE)){
                    LOGGER.fine("Densified geometry: " + geometry.toText());
                }              
            }
            WKTWriter writer = new WKTWriter();
            String wkt = writer.write(geometry);
            temp.append(wkt);
View Full Code Here

            //ingres does not handle linear rings, convert to just a line string
            geom = geom.getFactory().createLineString(((LinearRing) geom).getCoordinateSequence());
        }
       
        out.write("ST_GeomFromText('");
        out.write(geom.toText());
        if(currentSRID == null && currentGeometry  != null) {
            // if we don't know at all, use the srid of the geometry we're comparing against
            // (much slower since that has to be extracted record by record as opposed to
            // being a constant)
            out.write("', ST_SRID(\"" + currentGeometry.getLocalName() + "\"))");
View Full Code Here

        Object compositeCurve = p.parse(getClass().getResourceAsStream("v3_2/gml_compositecurve_1.xml"));
        assertFalse(compositeCurve instanceof String);
        System.out.println(compositeCurve);
        assertTrue("wrong element type", compositeCurve instanceof Geometry);
        Geometry geom = (Geometry) compositeCurve;
        assertEquals("LINESTRING (353148.991 5530600.811, 353151.478 5530602.263)", geom.toText());
        //assertNotNull(l);
    }
}
View Full Code Here

            txt = txt.replace("\n", "\\n");
            txt = txt.replace("\r", "\\r");
            writer.write( txt );           
        } else if (attribute instanceof Geometry) {
            Geometry geometry = (Geometry) attribute;
            writer.write( geometry.toText() );
        } else {
            String txt = Converters.convert( attribute, String.class );
            if( txt == null ){ // could not convert?
                txt = attribute.toString();
            }
View Full Code Here

        Geometry g = (Geometry) evaluateLiteral(expression, Geometry.class);
        if (g instanceof LinearRing) {
            //WKT does not support linear rings
            g = g.getFactory().createLineString(((LinearRing) g).getCoordinateSequence());
        }
        out.write( "GeomFromText('"+g.toText()+"', "+currentSRID+")");
    }

    @Override
    protected Object visitBinarySpatialOperator(BinarySpatialOperator filter,
            PropertyName property, Literal geometry, boolean swapped, Object extraData) {
View Full Code Here

        } else if( attribute instanceof String){
            String txt = encodeString((String) attribute);
            writer.write( txt );
        } else if (attribute instanceof Geometry) {
            Geometry geometry = (Geometry) attribute;
            String txt = geometry.toText();
           
            txt = encodeString( txt );
            writer.write( txt );
        } else {
            String txt = Converters.convert( attribute, String.class );
View Full Code Here

        }
       
        Object typename = currentGeometry.getUserData().get(JDBCDataStore.JDBC_NATIVE_TYPENAME);
        if("geography".equals(typename)) {
            out.write("ST_GeogFromText('");
            out.write(geom.toText());
            out.write("')");
        } else {
            out.write("ST_GeomFromText('");
            out.write(geom.toText());
            if(currentSRID == null && currentGeometry  != null) {
View Full Code Here

            out.write("ST_GeogFromText('");
            out.write(geom.toText());
            out.write("')");
        } else {
            out.write("ST_GeomFromText('");
            out.write(geom.toText());
            if(currentSRID == null && currentGeometry  != null) {
                // if we don't know at all, use the srid of the geometry we're comparing against
                // (much slower since that has to be extracted record by record as opposed to
                // being a constant)
                out.write("', ST_SRID(\"" + currentGeometry.getLocalName() + "\"))");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.