[GraphHopper] Detecting the orientation of an edge against the orientation of the way in OSM

Peter K peathal at yahoo.de
Wed Jun 11 14:27:12 UTC 2014


Hey Bruno,

looks like my mail in yahoo.de does not like message from your yahoo.com
;) hope they'll resolve this somehow. (for now keep me in CC)

What do you want to achieve with reverseNavigation?

The reverse variable is necessary if the backward search is going on -
e.g. you need to call edge.getReverseSpeed. So I guess you just need
reverseNavigation=reverse but not sure ...

Regards,
Peter.

> Hi,
> I have some code to override the edge's weight depending on the orientation of the way in OSM. Please could you tell me if the snippet below is correctly detecting the orientation of the edge against the orientation of the way in OSM? My doubt is mainly for the first statement reverseEdge=...
>
> public double calcWeight( EdgeIteratorState edge, boolean reverse )  {
>     ...
>     // is the edge in the same direction as way in OSM
>
>     boolean reverseEdge=edgeIteratorState.getBaseNode() <edgeIteratorState.getAdjNode();
>     ... 
>
>     // compare reverseEdge and reverse to figure out if we are navigating the edge forward 
>
>     // or backward according to way in OSM
>     boolean reverseNavigation=reverseEdge!=reverse;
>     ...
>
> Thanks!
> Bruno     
>


-- 
GraphHopper.com - Fast & Flexible Road Routing




More information about the GraphHopper mailing list