osrm-backend
                                
                                 osrm-backend copied to clipboard
                                
                                    osrm-backend copied to clipboard
                            
                            
                            
                        Include Route Metadata (highway, maxspeed, lanes) in OSRM Response JSON
Add support for returning key OpenStreetMap metadata for each route segment (or step) in the OSRM response, such as:
highway type (e.g., motorway, residential, primary)
maxspeed (actual OSM maxspeed tag, not estimated)
lanes (number of lanes)
Motivation:
While OSRM provides accurate routing and estimated travel times, it does not expose critical metadata available in the underlying OSM data. This limits developers' ability to:
Compare alternate routes based on road quality or driving comfort
Visualize or graph route characteristics like speed profiles, lane widths, or highway classifications
Enable custom routing interfaces with route insights (e.g., "Take route A with wider roads and higher speed limits")
Use Case Examples:
Show a comparative chart of maxspeed vs duration for alternate routes.
Highlight safest routes with more lanes or better road types.
Choose between fastest vs most comfortable or most scenic routes.
{ "steps": [ { "distance": 345.3, "duration": 34.2, "name": "Ring Road", "geometry": "...", "highway": "motorway", "maxspeed": "80", "lanes": "4", ... } ] }
/route/v1/driving/...?...&steps=true&metadata=highway,maxspeed,lanes