I'm retrieving durations/distances for millions of short routes using OSRM. In order to do so efficiently, I batch the rides in the form 'http://localhost:5000/route/v1/driving/longitude_departure1,latitude_departure1;longitude_arrival1,latitude_arrival1;longitude_departure2,latitude_departure2;longitude_arrival2,latitude_arrival2; etc. etc.?overview=false'
I batch the requests to speed things up and then I seperate the Json results, every odd response leg is a result I need. We found out that this will go wrong if more than 500 points are queried (so for me 250 rides) so I cap the query to 250 rides. This was supposed to be okay, untill I discovered that calling an individual ride does not result in the same duration/distance as the batch request.
The examples I used (using localhost:5000):
The results in my local OSRM engine:
- Single ride
Distance: 1583.5
Duration: 228.7
- Batched ride
Distance: 1651.6
Duration: 268.3
The weird thing is, online the result is the same, but different from my offline results. the latter is probably because of settings (which I did not alter at all) but I do not understand why the batch and single call are different.
- Online results
Distance: 1137.1
Duration:350.7
Is there a valid explanation for this behaviour or is this a bug? I can imagine OSRM does not evaluate all options in the batched call to optimize the speed of the request.
I'm not sure which versions I'm running, but I've installed my routing enginge on the 14th of May this year. and I've downloaded Dutch map material from geofrabrik