Route Track Point Timestamps

How does /route? calculate timestamps for track points? I’m new to GraphHopper and can’t figure out which route web parameters can put timestamps for all track points.

My &type=gpx outputs always come out as:

<trk><name>GraphHopper Track</name><trkseg>
<trkpt lat="14.621532" lon="121.05014"><time>2024-01-14T06:53:49Z</time></trkpt>
<trkpt lat="14.621585" lon="121.050259"><time>2024-01-14T06:53:50Z</time></trkpt>
<trkpt lat="14.621689" lon="121.050206"></trkpt>
<trkpt lat="14.621843" lon="121.050132"></trkpt>
...
<trkpt lat="14.657437" lon="121.00163"><time>2024-01-14T07:02:12Z</time></trkpt>
<trkpt lat="14.657523" lon="121.001403"></trkpt>
<trkpt lat="14.657638" lon="121.001266"></trkpt>
...
<trkpt lat="18.458708" lon="120.939041"><time>2024-01-14T16:20:57Z</time></trkpt>

I’m using a locally hosted pbf to explore around. I tried using GPX Studio to interpolate the blank timestamps but most of them go way beyond the end time created by GraphHopper.

I’m assuming the consecutive blank track points are one road leg. And upon reaching a certain location, a new timestamp is added to initiate a new road leg.

In this case GraphHopper uses the current time for the start location and calculates the times for all turn instruction points, via-locations and the destination. The trackpoints without a time correspond to other points along the route and no time is calculated for them.

1 Like

Thanks for the response! Would there be no way for GraphHopper to calculate the time and include them for each of the track points in the output?

Yes, it would be possible do linear interpolation for the time at the track points inbetween the instruction points. You would probably have to change this code accordingly.

I dont know how to code really. I only know a little about Python.

So my workaround was, I installed Java 1.8 and used GraphHopper 0.9.0.

Finding this out took a while, but the old gpxexport.js script managed to provide timestamps for each track point in a faster way.

Big thanks for letting me know!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.