0
votes

Here is what I am trying to do. I have a pair of lat, lngs and I am trying to find the route between the pair of lat, lngs using OSRM. I extracted polylines from each step object using the OSRM route service output but couldn't figure out how to extract the direction for each step. How do I get the direction for each step?

2

2 Answers

0
votes

See the API documentation for parameters to modify the response.

Passing steps=true will return RouteStep objects. A RouteStep contains the information you are looking for, i.e. StepManeuver objects, Lane objects and Intersection objects as well as distance and duration.

0
votes

https://github.com/Project-OSRM/osrm-text-instructions should help. It's a nodejs application. I've wrapped it into an api; Now after fetching the directions from OSRM, I call the directions api and get the text directions.