[GraphHopper] traversing

Jan Torben Heuer jan at komoot.de
Thu May 7 10:07:17 UTC 2015


When I call QueryGraph#getBaseGraph() would I still have the virtual edges (created from QueryGraph#lookup()) in the returned base graph?

Jan

Am 07.05.2015 um 00:30 schrieb Peter <graphhopper at gmx.de>:

> Hi Jan,
> 
> you can use the new method graph.getBaseGraph which gives you the
> none-CH graph in the CH-case and avoids this exception.
> 
> Kind Regards,
> Peter
> 
> On 06.05.2015 15:03, dos65 wrote:
>> Hi, you should ignore shortcuts, you can cast your
>> EdgeExplorer/EdgeIterator to EdgeSkipExplorer/Iterator and use
>> "isShortcut()" method to detect these edges.
>> 
>> 06.05.2015 15:55, Jan Torben Heuer пишет:
>>> Hi, I try to port some older code from 0.3 to 0.4. I have one problem
>>> when I try to inspect the edges around a calculated Path (with CH
>>> enabled):
>>> 
>>> QueryGraph g = ..
>>> edgeExplorer = g.createEdgeExplorer();
>>> Path p = routingAlgorithm.calcPath(from.getClosestNode(),
>>> to.getClosestNode());
>>> 
>>> for(EdgeIteratorState cur: p.calcEdges()) {
>>>    EdgeIterator edgeIterator =
>>> edgeExplorer.setBaseNode(cur.getAdjNode());
>>>    while(edgeIterator.next()) {
>>>        geometry = edgeIterator.fetchWayGeometry(3);
>>>    }
>>> }
>>> 
>>> java.lang.IllegalStateException: Cannot call fetchWayGeometry on
>>> shortcut 274821
>>>    at
>>> com.graphhopper.storage.LevelGraphStorage$EdgeSkipIteratorImpl.fetchWayGeometry(LevelGraphStorage.java:246)
>>> 
>>> What would be the correct way to access the the edges around
>>> cur.getAdjNode()?
>>> 
>>> Thanks,
>>> 
>>> Jan
>>> _______________________________________________
>>> GraphHopper mailing list
>>> GraphHopper at openstreetmap.org
>>> https://lists.openstreetmap.org/listinfo/graphhopper
>> 
>> 
>> _______________________________________________
>> GraphHopper mailing list
>> GraphHopper at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/graphhopper
> 
> 
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper




More information about the GraphHopper mailing list