Reputation:
I'm planning to create a trajectory generator for an autonomous vehicle, and I want to extract the trajectory from OSRM. I've already exported the OSM map I want to work on (about ~300h and has well defined roads) and I've also prepared the OSRM back-end in my Linux.
Is there a way that I can have an interface (offline) and extract the trajectory (lines and angles) that the routing machine outputs?
Any assistance on this question will do. Thank you very much.
Upvotes: 1
Views: 1528
Reputation: 2135
You can build OSRM backend in your own machine, see instructions here.
When you calculate a route between two points (viaroute service), the server response by default sets to true the parameter geometry, where you have the trajectory of the route. If you want to know how to parse the JSON answer and the geometry, have a look as an example to the implementation of the frontend of OSRM. Take also into account that the geometry of the route is returned by default compressed (geometry is a list of [lat, lng] pairs).
Cheers!
Upvotes: 1