Time and distance per leg

I need to get the time and distance for each leg of the trip, not just the total time and distance. Is that possible?

We currently return only this information per total route and per instruction. Is this sufficient in your case or what do you define as ‘leg’?

Another option would be to use type=gpx and use the created time stamps for every point.

Per leg = per part of the route (start - via point - via point - finish). I don’t need the instructions, but I do need the separate times/distances.

This would be currently only possible via the information available in the instructions. E.g. add the time and distance of every instruction until you observe the sign==5 (VIA_REACHED) then you have the information of the first leg, then do it again and for the last leg do it again until sign==4 (FINISH) is observed.

We need this feature as well.
Calculating the distance and time over the instructions is not very efficient. It needs more traffic if you usually not need the instructions and it needs more calculation on the client side.

Is this feature planed for the future?

Yes, see Add speed, time and more informations to instructions · Issue #439 · graphhopper/graphhopper · GitHub

Update: see also this blog post that describes how to fetch this information per leg: Leg-based information - GraphHopper Directions API

1 Like