osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

A way to get turn time from annotation data

Open nikita488 opened this issue 1 year ago • 2 comments

I want to recalculate remaining travel time of route, so I'm using trip service with annotations=distance,duration,speed and increase traveled time each time i reach next coord of the path (using duration array from received annotation). The problem is that annotation durations calculated without turn time in them, so sum(annotation.durations) != route.duration, so i can't easily recalculate remaining time each time I move

nikita488 avatar Jan 12 '24 11:01 nikita488

With some careful math, you can figure out the per step turn durations by doing step.duration - sum[annotations for this step] - it's not full resolution, but it should get you closer.

danpat avatar Jan 12 '24 14:01 danpat

Thank you, that will probably be enough for my use case

nikita488 avatar Jan 13 '24 13:01 nikita488