Timestamp or accumulated duration in direction service

When using the directions API call (/directions), openrouteservice clearly calculates the duration of the route: the route’s summary has a duration field. In the instructions, timestamps for the instructions are outputted too. However, there does not seem to be a way to get the timestamp at which a certain intermedial waypoint is reached.

Is there a way to get the timestamps using the current API? Extracting it from the instructions does not seem feasible, since an instruction may be valid during multiple successive waypoints. Repeating your travel time calculation client-side seems suboptimal and failure-prone. Likely the only way to fix this is from your side: adding the option to include the timestamps with the geometry.

That might not be trivial, though.

E.g., the tool at https://www.gpsies.com/createTrack.do can create GPX files which include a timestamp for each waypoint. Concretely, they seem to pick an arbitrary start date-time (2010-01-01 00:00:00) for the first waypoint. Later waypoints then include the time at which that point would have been reached assuming a start at Jan 1st 2010.

Sadly, the xsd you use to validate the GPS is different from the one they use. Yours does not seem to allow timestamps for waypoints.

hi @m0n0chr0m3, currently there is no way to access such fine scaled time stamps for the waypoints of a route, and you are correct that implementing this would not be trivial as it would involve modifying a large portion of the core routing library code. I will pass it onto the guys who work with that part of the code as something to look into in the future though.

For now though, the only way of determining the time of each waypoint is as you said to use the travel time calculations for each one.

1 Like