[GraphHopper] EdgeIterator, Node-Information

Peter K peathal at yahoo.de
Thu Sep 26 14:28:16 UTC 2013


I see. But in your case you can just create your WeightCalculator class
with the graph as argument (which avoids also too frequent getGraph
calls). At the moment I don't see a big advantage of introducing such a
back reference.

Peter.

> Let's say i implement a new routing weight calculator
> and i want to access the node via the given EdgeIteratorState in
> getWeight(EdgeIteratorState iter).
> It is not possible to access the node via the graph, because there is
> no graph given.
> That's why it would be more convenient if the iterator holds a pointer
> to it's graph to have access to any information at any time!
>
> Thanks for the fast answer!
>
>
> 2013/9/26 Peter K <peathal at yahoo.de <mailto:peathal at yahoo.de>>
>
>     Hi Andreas,
>
>     > Hi Peter,
>     >
>     > Is it possible to access the latitude/longitude of the base node or
>     > adjacent node via a given edge?
>     you can do
>     graph.getLatitude(iter.getBaseNode())
>
>     > Wouldn't it be convenient when the EdgeIterator knows it's graph?
>
>     Why would you need that?
>
>     Regards,
>     Peter.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130926/6c319195/attachment.html>


More information about the GraphHopper mailing list