Hello

> 2) Split the linestrings in a seperate method and still build the graph with
> the LineStringGraphGenerator (code taken from here:
> http://n2.nabble.com/Splitting-LineStrings-at-their-intersection-td1941502.html
> http://n2.nabble.com/Splitting-LineStrings-at-their-intersection-td1941502.html

I'm not sure if this is relevant to your problem (I haven't used the
graph code in geotools) but to split your LineStrings at intersections
you could try the following JTS trick (courtesy of Martin Davis's
presentation at 2007 FOSS4G conference

Collection lines = ...  // your line strings
Geometry mls = geomFactory.buildGeometry(lines);  // create a MultiLineString
Point mlsPt = geomFactory.createPoint(mls.getCoordinate());  // get an
arbitrary point on a line
Geometry nodedLines = mls.union(pt);  // union the MultiLineString
with the point

This has the (almost magical) effect of noding all of the line intersections.

Hope this helps

Michael

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to