Hi Rob, Oliver,
> I have managed, using the below code to convert a MultiLineString to a
> LineString, but am having problems converting that to WKT.. any thoughts?
Here's your code slightly edited...
WKTWriter writer = new WKTWriter();
MultiLineString multiLineString =
(MultiLineString)pSimpleFeature.getDefaultGeometry();
int N = multiLineString.getNumGeometries();
LineString line;
for ( int i = 0; i < N; i++ ) {
// convert to wkt string and write to console
System.out.println( writer.write( multiLineString.getGeometryN( i ) ) );
}
If the lines have many coords and you need to make the output more
readable you can use the writeFormatted method instead of write.
Michael
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users