LineMergeGraph inherits the add(Node) method from PlanarGraph.

But I would look at using PlanarGraph, not LineMergeGraph. LMG is specifically intended for line merging, which is probably not what you're trying to do.

If all you have is Coordinates and LineStrings, then you should be able to use PlanarGraph directly. If you have other data structures which model nodes and edges, you have two choices - implement a subclass of PlanarGraph to map the external structures into the inputs that PlanarGraph requires, or use the set/getUserData methods on LineString to "carry" your original objects.

As for algorithms, have a look at ConnectedSubgraphFinder for an example of how to build an algorithm class.

Johnathan Kool wrote:
Hi all -
I'm in the middle of trying to implement a shortest path routine using JTS
1.9.  I looked into using some of JUMP's graph extension functions, but in
the end I think it may be easier to use what's available in JTS.

I've managed to work out a visibility algorithm based on Coordinates,
Geometry obstacles and LineString paths, but now need to construct a graph
so I can run a Dijkstra search (or A*).  Essentially, I have a collection of
Coordinates/Nodes, and LineStrings representing 'allowable' edges.  What's
the best way of creating a searchable graph from these objects?

I looked at the PlanarGraph Class, and the LineMergeGraph subclass.  I
thought that LineMergeGraph was what I was after, but it seems to be missing
the .add(Node) method that PlanarGraph has (even though it is supposed to
extend PlanarGraph?).  I need addNode, because it's possible to have a node
with no connecting edges.

Thanks in advance for your help with this,

J

_______________________________________________
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