Jody, thanks. One more question please,should I use a BasicDirectedGraphBuilder 
and relating addEdge() method to build a graph with 2-way road?






At 2015-02-14 00:02:18, "Jody Garnett" <jody.garn...@gmail.com> wrote:

There is a slight difference between line segments (which may be very detailed 
as they are intended to show a visual shape) and edges (which are used to 
determine what routes can be navigated).  A single "edge" in your graph may be 
represented visually with a line string made up of thousands of line segments.


The edge/node graph should capture your data problem. If you would like to 
represent a two way street in a directed graph you will need to do so using two 
edges (one in each direction).


--
Jody Garnett


On 13 February 2015 at 10:32, wbh <wangbaohua2...@163.com> wrote:

Hi all,
I am trying to use gt-graph and I have some junior questions about this module
1 I find below code in document
//we have some line segments LineSegment[] lines = ... //create the graph 
generator BasicLineGraphGenerator graphGen = new BasicLineGraphGenerator(); 
//add the lines to the graph for ( int i = 0; i < lines.length; i++ ) { 
graphGen.add( lines[i] ); } Graph graph = graphGen.getGraph()
If a lineString is composed by multi coordinates, it should be converted to 
several linesegment or only 1 linesegement?
I think only 1 linesegment is also OK for just computing shortestpath, right?


2 If part of edges are undirected, the other are directed, for undirected edge, 
should I create 2 linesegements? (e.g., A and B are 2 endpoints of a edge, so I 
should create one linesegment from A to B and the other linesegment from B to 
A, right?)
Thanks.



------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users



------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to