From: Harshad S <har...@tc...> - 2011-10-03 05:05:32
|
<FONT face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=2>Hi,<br><br> I am using the 'FeatureGraphGenerator' to store all my features(which in my case are all linesegments). Post this, I use the 'getGraph()' function to get the graph. Then, I provide this graph, the source node and dest node(both are objects of BasicXYNode class) to the AStar function. Am i doing it correctly? <br> My primary doubt is if the nodes in the derived graph will be simple X,Y points or something else. Please clarify.<br><div><br></div><div>Thank You.<br>Harshad Shrikhande<br>Researcher R&D<br>TCS Innovations Infra Lab, Chennai<br>Tata Consultancy Services<br>Cell:- 7200605821<br>Mailto: <a href="mailto:har...@tc...">har...@tc...</a><br>Website: <a href="http://www.tcs.com">http://www.tcs.com</a><br>____________________________________________<br>Experience certainty. IT Services<br> Business Solutions<br> Outsourcing<br>____________________________________________<br><div><br></div><font color="#990099">-----Jody Garnett <jod...@gm...> wrote: -----<br><br></font><blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: 2px solid #000000; margin-right: 0px;">To: Harshad S <har...@tc...><br>From: Jody Garnett <jod...@gm...><br>Date: 09/30/2011 06:39PM<br>cc: geo...@li...<br>Subject: Re: [Geotools-gt2-users] Reg AStarShortestPathFinder in Geotools<br><br> <div> I think you (when you supply the generator) get to choose what to store where.</div><div><br></div><div>* 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. </div><div>* 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. </div><div><br></div><div>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).</div><div><br></div><div>There are two implementations of LineGraphGenerator which one are you using?</div><div><br></div><div>The BasicLineGraphGenerator has the following:</div><div><br></div><div><div><br></div><div> public Graphable add(Object obj) {</div><div> LineSegment line = (LineSegment)obj;</div><div> Coordinate c; </div><div> Node n1, n2;</div><div> </div><div> //check first coordinate</div><div> c = line.p0;</div><div> if ((n1 = (Node)m_coord2node.get(c)) == null) {</div><div> //first time coordinate seen, create node for it</div><div> n1 = getGraphBuilder().buildNode();</div><div> </div><div> //set underlying object to coordinate </div><div> //n1.setObject(c);</div><div> setObject(n1, c);</div><div> </div><div> getGraphBuilder().addNode(n1);</div><div> m_coord2node.put(c,n1);</div><div> }</div><div> </div><div> //check second coordinate</div><div> c = line.p1;</div><div> if ((n2 = (Node)m_coord2node.get(c)) == null) {</div><div> //first time coordinate seen, create node for it</div><div> n2 = getGraphBuilder().buildNode();</div><div> </div><div> //set underlying object to coordiante </div><div> //n2.setObject(c);</div><div> setObject(n2,c);</div><div> </div><div> getGraphBuilder().addNode(n2);</div><div> m_coord2node.put(c,n2); </div><div> }</div><div> </div><div> //build the edge setting underlying object to line</div><div> Edge e = getGraphBuilder().buildEdge(n1,n2);</div><div> //e.setObject(line);</div><div> setObject(e, line);</div><div> </div><div> getGraphBuilder().addEdge(e);</div><div> </div><div> //return the created edge</div><div> return(e); </div><div> }</div></div><div><br></div><div>You can see that setObject( n1, c) is called ... does the source code offer enough clarification for you?</div><div>-- <br>Jody Garnett<br><br></div> <p style=""><font color="#a0a0a8">On Friday, 30 September 2011 at 9:37 PM, Harshad S wrote:</font></p> <blockquote type="cite" style="border-left-style: solid; border-width: 1px; margin-left: 0px; padding-left: 10px;"> <span><div><div><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"> Hi,<br><br> 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.<br><br>Thank You.<br>Harshad Shrikhande<br>Researcher R&D<br>TCS Innovations Infra Lab, Chennai<br>Tata Consultancy Services<br>Cell:- 7200605821<br>Mailto: <a href="mailto:har...@tc...">har...@tc...</a><br>Website: <a href="http://www.tcs.com">http://www.tcs.com</a><br>____________________________________________<br>Experience certainty.<span> </span> IT Services<br><span> </span> <span> </span> <span> </span> Business Solutions<br><span> </span> <span> </span> <span> </span> Outsourcing<br>____________________________________________<br><br><font color="#990099">-----Harshad S/TVM/TCS wrote: -----</font><div><blockquote type="cite"><div>To: Harshad S/TVM/TCS<br>From: Harshad S/TVM/TCS<br>Date: 09/30/2011 03:49PM<br>cc: <a href="mailto:geo...@li...">geo...@li...</a><br>Subject: Re: [Geotools-gt2-users] Reg AStarShortestPathFinder in Geotools<br><br><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"> Hi,<br><br> 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.<br><br><br>Thank You.<br>Harshad Shrikhande<br>Researcher R&D<br>TCS Innovations Infra Lab, Chennai<br>Tata Consultancy Services<br>Cell:- 7200605821<br>Mailto: <a href="mailto:har...@tc...">har...@tc...</a><br>Website: <a href="http://www.tcs.com">http://www.tcs.com</a><br>____________________________________________<br>Experience certainty.<span> </span> IT Services<br><span> </span> <span> </span> <span> </span> Business Solutions<br><span> </span> <span> </span> <span> </span> Outsourcing<br>____________________________________________<br><br><font color="#990099">-----Harshad S <!--Notes ACF <har...@tc...>--> wrote: -----<!--Notes ACF </har...@tc...>--></font><div><blockquote type="cite"><div>To: <a href="mailto:geo...@li...">geo...@li...</a><br>From: Harshad S <<a href="mailto:har...@tc...">har...@tc...</a>><br>Date: 09/30/2011 02:22PM<br>Subject: [Geotools-gt2-users] Reg AStarShortestPathFinder in Geotools<br><br><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"> Hey folks ,<br><br> 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 .<br><br> 1) AStarShortestPathFinder astar = new AStarShortestPathFinder(graph, source, dest, afuncs)<br> <br> 2) astar.calculate() ( I am assuming the path gets stored in astar)<br> <br> 3) Path p = astar.getPath();<br><br> 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'. <br><br> Please suggest a fix for this .<br><br>Thank You.<br>Harshad Shrikhande<br>Researcher R&D<br>TCS Innovations Infra Lab, Chennai<br>Tata Consultancy Services<br>Cell:- 7200605821<br>Mailto: <a href="mailto:har...@tc...">har...@tc...</a><br>Website: <a href="http://www.tcs.com">http://www.tcs.com</a><br>____________________________________________<br>Experience certainty.<span> </span> IT Services<br><span> </span> <span> </span> <span> </span> Business Solutions<br><span> </span> <span> </span> <span> </span> Outsourcing<br>____________________________________________<br></font><font face="Courier New,Courier,monospace" size="3">=====-----=====-----=====<br>Notice: The information contained in this e-mail<br>message and/or attachments to it may contain <br>confidential or privileged information. If you are <br>not the intended recipient, any dissemination, use, <br>review, distribution, printing or copying of the <br>information contained in this e-mail message <br>and/or attachments to it are strictly prohibited. If <br>you have received this communication in error, <br>please notify us by reply e-mail or telephone and <br>immediately and permanently delete the message <br>and any attachments. Thank you<br><br><br></font> <font face="Courier New,Courier,monospace" size="3">------------------------------------------------------------------------------<br>All of the data generated in your IT infrastructure is seriously valuable.<br>Why? It contains a definitive record of application performance, security<br>threats, fraudulent activity, and more. Splunk takes this data and makes<br>sense of it. IT sense. And common sense.<br><a href="http://p.sf.net/sfu/splunk-d2dcopy2">http://p.sf.net/sfu/splunk-d2dcopy2</a></font><font face="Courier New,Courier,monospace" size="3">_______________________________________________<br>Geotools-gt2-users mailing list<br><a href="mailto:Geo...@li...">Geo...@li...</a><br><a href="https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users">https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users</a><br></font></div></blockquote></div></font></div></blockquote></div></font> </div><div>------------------------------------------------------------------------------<br>All of the data generated in your IT infrastructure is seriously valuable.<br>Why? It contains a definitive record of application performance, security<br>threats, fraudulent activity, and more. Splunk takes this data and makes<br>sense of it. IT sense. And common sense.<br><a href="http://p.sf.net/sfu/splunk-d2dcopy2">http://p.sf.net/sfu/splunk-d2dcopy2</a><br></div><div>_______________________________________________<br>Geotools-gt2-users mailing list<br><a href="mailto:Geo...@li...">Geo...@li...</a><br><a href="https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users">https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users</a><br></div></div></span> </blockquote> <div> <br> </div> </blockquote><br></div></FONT> |