OSRM: How to avoid restricted zones on map (and split road segments)

147 Views Asked by At

I am using OSRM. I need the route to avoid a specific zone on the map. As I found out, this can be done using osrm-customize:

osrm-customize <my-osrm-file> --segment-speed-file exceptions.csv

In the file exceptions.csv, I write the numbers of the nodes received by the "nearest" request:

curl "http://127.0.0.1:5000/nearest/v1/car/<my-coordinates>?number=1"

I get a json-document, which contains the nodes that bound the road segment (key "nodes"):

{"code":"Ok","waypoints":[{"nodes":[<some-nodes>],"location":[<some-location>],"name":"","distance":0,"hint":<some-hint>}]}

It turned out that the segment of the road, limited by nodes, can go beyond the restricted zone. How can I find the id of the point that is between the nodes to split the road segment into restricted and allowed parts?

I tried to find the point id in the .osm file, but the .osm file ids are slightly different from what we get in the "nearest" query. Sorry, I don't have the files right now.

0

There are 0 best solutions below