Search code examples
gisopenstreetmaposrm

How to access OpenStreetMaps tag (maxspeed) in OSRM query?


I want to access the original maxspeed tag of the OSM edges when using a OSRM query (e.g., routing service with annotations=true). It seems that OSRM does not provide by default a way to access the original tags of OSM when querying. After some google-fu it seems that this may be possible with a custom lua profile, but I'm not sure.

Having said that, is there any way to get the maxspeed tag information in a OSRM query?


Solution

  • No we don't preserve the original maxspeed information. A common way to expose this information is to use some external data source to annotate the route after the fact.

    OSRM exposes the OSM IDs of all nodes travel if you pass annotations=nodes option. The nodes will be in the .routes[].legs[].annotations.nodes property. You could combine this with a tool like the route-annotator, seems like they are currently working on exposing this information easily.