Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.29k stars 3.32k forks source link

Group http request #4769

Closed SwannL closed 4 weeks ago

SwannL commented 6 years ago

Hello,

in the api we can use something like : curl 'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219' in order to send only one request to get the distance from several points to many other points. The issu is that it won't check on wich side of the road the user is. If the user has to go backward, osrm will suppose the user is on the opposite side of the road.

So then, i used curl 'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false' The system now know the user is going from first point to second point so it knows on which side of the road the user is, and i can find the real time to go to the third point.

The problem is now that if i want to fill a distance matrix 500500, with the first method i'll have just wrong values and with the second, i'll need 500500=250 000 http request. It would be great to solve the first problem in the table request or to create a web service that allows us to send only one request to get all the values formatted as the second method.

Thank you for reading,

Have a nice day ! :)

Swann

TheMarex commented 6 years ago

@SwannL You can use approaches=curb;curb;curb with the table plugin to constrain the side of the road.

I don't think we will ever implement batching HTTP requests, handling requests of this type is what the table plugin is for.

SwannL commented 6 years ago

@TheMarex Thank you for your answer. Is there any documentation about this "approaches"? I don't really understand what it does. For instance, I have tried this :

http://router.project-osrm.org/table/v1/driving/-1.564557,47.206851;-1.564868,47.207197

I got : [[0,8.1],[9,0]]

http://router.project-osrm.org/table/v1/driving/-1.564557,47.206851;-1.564868,47.207197?approaches=curb;curb

I got : [[0,8.1],[81,0]]

http://router.project-osrm.org/table/v1/driving/-1.564557,47.206851;-1.564868,47.207197?approaches=curb;unrestricted

I got : [[0,8.1],[140.9,0]]

So something actualy changed, but i cannot figure what that curb approaches really mean.

Then i don't really understand how i can use it to determine which side of the road the user is coming from.

github-actions[bot] commented 2 months ago

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.