Steffen Hesselink wrote:
> Hi all,
>
> I have a program that reads Multilinestrings from a Shapefile.
> Is there a simple way to get the XY-Coordinates for each node of a
> Multilinestring?
>
> With my solution I only get the coordinates for the Startnodes:
>
> FeatureIterator it = coll.features();
>       while (it.hasNext()) {
>         Feature f = it.next();
>         System.out.println( f.getDefaultGeometry().getCoordinate() ) ;
>       }
>
> Any ideas?
>   
The getCoordinate() method just grabs a sample point ... try this:
-http://www.vividsolutions.com/Jts/javadoc/com/vividsolutions/jts/geom/GeometryCollection.html#getCoordinates()

However that is not really smart (since you cannot tell when one 
linestring stops and another starts).  Try going through each 
getGeometryN( index) and using getCoordinaes() on each.
Jody

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to