Reputation: 33
I'm trying to understand why there is a difference between the total duration computed by OSRM and the sum of the following - routes->legs->annotation->duration.
The request that I'm using is the following:
If I sum-up the routes->legs->annotation->duration I got 449 seconds. But the total time computed by the OSRM - routes->duration is equals to 508.9, which is equal to sum legs->steps->duration.
Upvotes: 0
Views: 1280
Reputation: 36
I think you are summing up wrong attribute. You should sum up route -> legs -> steps. If you sum them up, then it is correct. Furthermore, you also get the shape of each leg using route -> legs -> steps -> geometry. You can test it again on a simpler request as following: http://router.project-osrm.org/route/v1/car/11.533996006963445,48.16530925;11.532000,48.162711?overview=full&geometries=polyline&steps=true&annotations=true
I am not sure of the actual usage of annotations. But definitely for your purpose steps should suffice.
Upvotes: 1