Michael,

The triangulation code uses a Quad-Edge Subdivision as its underlying structure. This is a topological structure which directly supports the kind of navigation that you require. It's a wee bit tricky to understand, however.

Alternatively, you could load the generated edges into a PlanarGraph and traverse them that way. That might have an easier API to use. If you end up doing this, consider contributing the code back into JTS - it might be generally useful.

Martin

Michael Bedward wrote:
2009/4/30 Martin Davis <[email protected]>:
INPUT:
- Geometry (from which the site/vertex coordinates are extracted)
- Collection of Coordinates

OUTPUT:
- MultiLineString containing triangulation edges
- GeometryCollection of Polygons containing triangles


One of my common needs is to navigate between neighbouring points,
akin to a (highly) constrained random walk. To do this with the above
outputs I guess I would build data structure(s) that related input
coords to output triangles, allowing forward and reverse lookup.  If
such a thing is generally useful it would be nice to have it as an
output, possibly optional.  Unless, of course, there is already an
easier and more elegant way of accomplishing this.

Michael
_______________________________________________
jts-devel mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jts-devel


--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jts-devel

Reply via email to