[OSRM-talk] Accessing graph data in osrm

Chris Elion celion at lyft.com
Wed Nov 30 21:53:01 UTC 2016


Hi folks,
I'm trying to write some code that accesses the road graph, so that I can
try out some alternative mapmatching algorithms (and also allow our data
scientists to experiment with some other things). We're already using osrm
in production, so leveraging the infrastructure we already have should in
theory make my life easier.

The GetAdjacentEdgeRange/GetTarget interface for the static graph (as
described in
https://github.com/Project-OSRM/osrm-backend/wiki/Quick-start-to-Code)
seems straightforward. However, I'm stuck trying to find a node or edge
close to a Coordinate as the starting point for my iterations. My two
attempts so far have been

1) Use BaseDataFacade::NearestPhantomNodesInRange() - it's not obvious to
me how to get the "real" node from the phantom node.
2) Use BaseDataFacade::GetEdgesInBox() gives reasonable-looking results -
the NodeIDs EdgeBasedNode::u and ::v appear correct when I pass them to
BaseDataFacade::GetCoordinateOfNode(). But the IDs are out of range when I
pass them to BaseDataFacade::GetAdjacentEdgeRange()

Any suggestions on how to salvage either of these approaches? Or is there a
better way to go about this?

Thanks in advance!

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osrm-talk/attachments/20161130/b0705707/attachment.html>


More information about the OSRM-talk mailing list