[GraphHopper] Get direction of an edge using CH

Peter K peathal at yahoo.de
Mon Oct 28 11:50:32 UTC 2013


If you need it in WeightCalculation you can additionally pass e.g. the
baseNode for the 'direction' of the iterator state:

getWeight( EdgeIteratorState edge ) {
   return getHeight(edge.getEdgeId, edge.getBaseNode)
}

Keep in mind that the direction of the edge iterator does not
necessarily reflect the direction of a street. It it just the direction
of the exploration of the graph:

base<-----adjacent1
   \---> adj2
    \_ adj3

Regards,
Peter.

> Since we route height-data weights we need to know in which direction
> we're entering/visiting the edge. It matters because we need to know
> if we're going up or down. The path object is not yet created (during
> routing process).
>
> Thanks in advance,
>
> Robert
>
> Am 28.10.2013 11:11, schrieb Peter K:
>> What is your usecase? In the latest version the edgeId list will be
>> hidden in the Path object.
>>
>> Peter.
>>
>>
>>> Hi Peter,
>>>
>>> I need to find out in which direction i am passing the edges while
>>> routing using contraction hierarchies. Is there an easy way to get the
>>> direction?
>>> The Graphhopper version i'm using is from 18th of September.
>>> Sorry, i am sure that this question has been answered many times ;)
>>>
>>> Thanks in advance,
>>>
>>> Robert




More information about the GraphHopper mailing list