GTFS Distances

Hello,

I’m trying to use the shape_dist_traveled from stop_times to work out approximate trip distances and it seems like this doesn’t represent real life travel distances, as per Reference  |  Static Transit  |  Google Developers.

For example - this is showing maximum trip distances for Mondays. There are a significant amount showing trip distances about 400km. When looking at some of the trips >800km, their real life distance is closer to < 200km. (I’m assuming shape_dist_traveled is measured in meters, so have already divided by 1000) .

Even when you take out regional trips, and only consider the Sydney Bus Network they’re still too high. Cross referencing those outliers (>400km), the real distance shown on the map should be closer to ~25km.

And then when you take those outliers above 200km out, there seems to be a divide between 10km and 100km values. When you consider Penrith -> Sydney CBD ~55km this has got to be wrong.

I don’t think this is just an issue of increasing error with increasing stop sequence as some 2nd stops jump from 0km to >20km in under 5 minutes (over 200km/hr!).

Hoping this is just my misunderstanding of what shape_dist_traveled can be used for, but would appreciate some clarification.

Thanks,
Katie

Hey Katie,

Seems like you’re an observant one indeed :wink:

shape_dist_traveled is indeed meant to be the real distance travelled along the route in metres, as listed in the Buses GTFS technical documentation:

The shape_dist_traveled field positions a shape point as a
distance travelled along a shape from the first shape point.

The shape_dist_traveled field represents a real distance travelled
along the route in meters.

The values used for shape_dist_traveled will increase along with
stop_sequence: they cannot be used to show reverse travel along
a trip.

I think if you try looking at those with large discrepancies, you’ll find that they’re off by a factor of 10. :frowning_face:

One of many examples of this is trip 180.TA.31-307-sj2-1.3.R, which has a shape_dist_traveled of 100014.2 at bus stop 201944. Route 307 to Port Botany is certainly not 100 km long!

Hope someone can fix this soon!

- Karl

1 Like