I think you (when you supply the generator) get to choose what to store where.
* The graph is just a data structure; if you look at the example of the docs
you can see the edgeWeighter accessing the edge to get the associated Feature.
* If you were making a graph out of polygons (with the relationship touches) it
would make more sense to store the feature on the Nodes.
Note: It is very difficult to get a quality dataset that can be used for
navigation; so disconnected graphs are pretty common (and a good way to perform
QA on your dataset).
There are two implementations of LineGraphGenerator which one are you using?
The BasicLineGraphGenerator has the following:
public Graphable add(Object obj) {
LineSegment line = (LineSegment)obj;
Coordinate c;
Node n1, n2;
//check first coordinate
c = line.p0;
if ((n1 = (Node)m_coord2node.get(c)) == null) {
//first time coordinate seen, create node for it
n1 = getGraphBuilder().buildNode();
//set underlying object to coordinate
//n1.setObject(c);
setObject(n1, c);
getGraphBuilder().addNode(n1);
m_coord2node.put(c,n1);
}
//check second coordinate
c = line.p1;
if ((n2 = (Node)m_coord2node.get(c)) == null) {
//first time coordinate seen, create node for it
n2 = getGraphBuilder().buildNode();
//set underlying object to coordiante
//n2.setObject(c);
setObject(n2,c);
getGraphBuilder().addNode(n2);
m_coord2node.put(c,n2);
}
//build the edge setting underlying object to line
Edge e = getGraphBuilder().buildEdge(n1,n2);
//e.setObject(line);
setObject(e, line);
getGraphBuilder().addEdge(e);
//return the created edge
return(e);
}
You can see that setObject( n1, c) is called ... does the source code offer
enough clarification for you?
--
Jody Garnett
On Friday, 30 September 2011 at 9:37 PM, Harshad S wrote:
> Hi,
>
> Once the graph is formed as a line network from the shapefile, what is
> stored exactly in a Node which we obtain from the 'getNodes()' function. I am
> guessing the 'Node' will store the X,Y coordinates of a point. Can anyone
> provide some clarification on this because irrespective of which 2 points I
> select, they always seem to be disconnected on the graph. Please suggest.
>
> Thank You.
> Harshad Shrikhande
> Researcher R&D
> TCS Innovations Infra Lab, Chennai
> Tata Consultancy Services
> Cell:- 7200605821
> Mailto: harsha...@tcs.com (mailto:harsha...@tcs.com)
> Website: http://www.tcs.com
> ____________________________________________
> Experience certainty. IT Services
> Business Solutions
> Outsourcing
> ____________________________________________
>
> -----Harshad S/TVM/TCS wrote: -----
> > To: Harshad S/TVM/TCS
> > From: Harshad S/TVM/TCS
> > Date: 09/30/2011 03:49PM
> > cc: geotools-gt2-users@lists.sourceforge.net
> > (mailto:geotools-gt2-users@lists.sourceforge.net)
> > Subject: Re: [Geotools-gt2-users] Reg AStarShortestPathFinder in Geotools
> >
> > Hi,
> >
> > I guess if this is because the last node in the path is not the same as
> > the first node. Is this a bug with the graph or I am missing something.
> >
> >
> > Thank You.
> > Harshad Shrikhande
> > Researcher R&D
> > TCS Innovations Infra Lab, Chennai
> > Tata Consultancy Services
> > Cell:- 7200605821
> > Mailto: harsha...@tcs.com (mailto:harsha...@tcs.com)
> > Website: http://www.tcs.com
> > ____________________________________________
> > Experience certainty. IT Services
> > Business Solutions
> > Outsourcing
> > ____________________________________________
> >
> > -----Harshad S wrote: -----
> > > To: geotools-gt2-users@lists.sourceforge.net
> > > (mailto:geotools-gt2-users@lists.sourceforge.net)
> > > From: Harshad S <harsha...@tcs.com (mailto:harsha...@tcs.com)>
> > > Date: 09/30/2011 02:22PM
> > > Subject: [Geotools-gt2-users] Reg AStarShortestPathFinder in Geotools
> > >
> > > Hey folks ,
> > >
> > > I just needed to confirm one thing about 'AStarShortestPathFinder' class
> > > and its functions . I have a graph and I run the following code on it .
> > >
> > > 1) AStarShortestPathFinder astar = new AStarShortestPathFinder(graph,
> > > source, dest, afuncs)
> > >
> > > 2) astar.calculate() ( I am assuming the path gets stored in astar)
> > >
> > > 3) Path p = astar.getPath();
> > >
> > > For one of the shapefiles that I am using, the graph is constructed with
> > > all the nodes. But, there is an error that comes up in the 3rd line
> > > saying that 'The path doesn't begin correctly'.
> > >
> > > Please suggest a fix for this .
> > >
> > > Thank You.
> > > Harshad Shrikhande
> > > Researcher R&D
> > > TCS Innovations Infra Lab, Chennai
> > > Tata Consultancy Services
> > > Cell:- 7200605821
> > > Mailto: harsha...@tcs.com (mailto:harsha...@tcs.com)
> > > Website: http://www.tcs.com
> > > ____________________________________________
> > > Experience certainty. IT Services
> > > Business Solutions
> > > Outsourcing
> > > ____________________________________________
> > > =====-----=====-----=====
> > > Notice: The information contained in this e-mail
> > > message and/or attachments to it may contain
> > > confidential or privileged information. If you are
> > > not the intended recipient, any dissemination, use,
> > > review, distribution, printing or copying of the
> > > information contained in this e-mail message
> > > and/or attachments to it are strictly prohibited. If
> > > you have received this communication in error,
> > > please notify us by reply e-mail or telephone and
> > > immediately and permanently delete the message
> > > and any attachments. Thank you
> > >
> > >
> > > ------------------------------------------------------------------------------
> > > All of the data generated in your IT infrastructure is seriously valuable.
> > > Why? It contains a definitive record of application performance, security
> > > threats, fraudulent activity, and more. Splunk takes this data and makes
> > > sense of it. IT sense. And common sense.
> > > http://p.sf.net/sfu/splunk-d2dcopy2
> > > _______________________________________________
> > > Geotools-gt2-users mailing list
> > > Geotools-gt2-users@lists.sourceforge.net
> > > (mailto:Geotools-gt2-users@lists.sourceforge.net)
> > > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2dcopy2
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-users@lists.sourceforge.net
> (mailto:Geotools-gt2-users@lists.sourceforge.net)
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users