/** * Writes the POINT * * @param geometry * @param writer * @throws IOException */ public void writePoint( Point geometry, Writer writer ) throws IOException { writer.append( "POINT " ); if ( flags.contains( WKTFlag.USE_DKT ) ) { appendObjectProps( writer, geometry ); } writer.append( '(' ); writePointWithoutPrefix( geometry, writer ); writer.append( ')' ); }
/** * * @param curve * @param writer * @throws IOException */ private void writeArc( Arc curve, Writer writer ) throws IOException { writer.append( "ARC " ); // if(flags.contains( WKTFlag.USE_DKT )){ // appendObjectProps( writer, (Geometry) createArc ); // } writer.append( '(' ); writePointWithoutPrefix( curve.getPoint1(), writer ); writer.append( ',' ); writePointWithoutPrefix( curve.getPoint2(), writer ); writer.append( ',' ); writePointWithoutPrefix( curve.getPoint3(), writer ); writer.append( ')' ); }
/** * * @param curve * @param writer * @throws IOException */ private void writeCircle( Circle curve, Writer writer ) throws IOException { writer.append( "CIRCLE " ); // if(flags.contains( WKTFlag.USE_DKT )){ // appendObjectProps( writer, (Geometry) createArc ); // } writer.append( '(' ); writePointWithoutPrefix( curve.getPoint1(), writer ); writer.append( ',' ); writePointWithoutPrefix( curve.getPoint2(), writer ); writer.append( ',' ); writePointWithoutPrefix( curve.getPoint3(), writer ); writer.append( ')' ); }
/** * Writes the LINESTRING without the 'LINESTRING()'-specific envelope. <br/> * It writes just the LINESTRING-coordinates. * * @param geometry * @param writer * @throws IOException */ private void writeLineStringWithoutPrefix( LineString geometry, Writer writer ) throws IOException { Points points = geometry.getControlPoints(); int counter = 0; for ( Point p : points ) { counter++; if ( counter < points.size() ) { writePointWithoutPrefix( p, writer ); writer.append( ',' ); } else { writePointWithoutPrefix( p, writer ); } } }
counter++; if ( counter < points.size() ) { writePointWithoutPrefix( point, writer ); writer.append( ',' ); } else { writePointWithoutPrefix( point, writer ); counter++; if ( counter < r.size() ) { writePointWithoutPrefix( point, writer ); writer.append( ',' ); } else { writePointWithoutPrefix( point, writer );
/** * * @param curve * @param writer * @throws IOException */ private void writeArcString( ArcString curve, Writer writer ) throws IOException { writer.append( "ARCSTRING " ); // if(flags.contains( WKTFlag.USE_DKT )){ // appendObjectProps( writer, (Geometry) arcString ); // } writer.append( '(' ); int counter = 0; for ( Point p : curve.getControlPoints() ) { counter++; writePointWithoutPrefix( p, writer ); if ( counter != curve.getControlPoints().size() ) { writer.append( ',' ); } } writer.append( ')' ); }
/** * * @param curve * @param writer * @throws IOException */ private void writeLineStringSegment( LineStringSegment curve, Writer writer ) throws IOException { writer.append( "LINESTRINGSEGMENT " ); // if(flags.contains( WKTFlag.USE_DKT )){ // appendObjectProps( writer, (Geometry) createLineStringSegment ); // } writer.append( '(' ); int counter = 0; for ( Point p : curve.getControlPoints() ) { counter++; writePointWithoutPrefix( p, writer ); if ( counter != curve.getControlPoints().size() ) { writer.append( ',' ); } } writer.append( ')' ); }
/** * Writes the multiPoint. * * @param geometry * @param writer * @throws IOException */ public void writeMultiPoint( MultiPoint geometry, Writer writer ) throws IOException { writer.append( "MULTIPOINT " ); if ( flags.contains( WKTFlag.USE_DKT ) ) { appendObjectProps( writer, geometry ); } writer.append( '(' ); for ( int i = 0; i < geometry.size(); i++ ) { writePointWithoutPrefix( geometry.get( i ), writer ); if ( i < geometry.size() - 1 ) { writer.append( ',' ); } } writer.append( ')' ); }