Best Practice: Shape_dist_travelled must be included if route passes over same stop or segment (loop, lollipop, inlining) (WARNING)
Shape_dist_travelled must be included if route passes over same stop or segment (loop, lollipop, inlining)
I am not sure that this must be recommended.
shape_dist_travelled is a nice field to have on its own. If it is missing, then GTFS consumer can figure out how the vehicle moves based on the coordinates of the shape and the stops.
Please could you provide some rationale, context and samples?
If it is missing, then GTFS consumer can figure out how the vehicle moves based on the coordinates of the shape and the stops
I agree, this field is not per-say needed to realize computation on a GTFS dataset. However, as defined in
best practices for stop_times.txt and best practices for shapes.txt it seems that implementing this rule is reasonable and indicated if we want to stick to the specification.
stop_times.txt
Field Name Recommendation shape_dist_traveled shape_dist_traveledmust be provided for routes that have looping or inlining (the vehicle crosses or travels over the same portion of alignment in one trip). See theshapes.shape_dist_traveledrecommendation.
shapes.txt
Field Name Recommendation shape_dist_traveled Must be provided in both shapes.txtandstop_times.txtif an alignment includes looping or inlining (the vehicle crosses or travels over the same portion of alignment in one trip).
If a vehicle retraces or crosses the route alignment at points in the course of a trip,shape_dist_traveledis important to clarify how portions of the points inshapes.txtline up correspond with records instop_times.txt.
Please could you provide some rationale, context and samples?
Yes @e-lo that would facilitate discussions and development.
I wasn't part of the original best-practice discussion as to why this is important. Perhaps @LeoFrachet or @antrim can provide background (or link to it?)
Google Transit Partners help says "For complex shape and stop sequences, the GTFS specification provides a mechanism for explicitly defining how stops are matched to the trip shape. The shapes.txt file defines a shape_dist_traveled field, which can be used to specify the distance along the shape for each point of the shape."
Google Maps used to fail to draw the alignment correctly if it crossed over itself and shape_dist_traveled was not provided. I don't know if that's still the case or if other applications have that issue. https://groups.google.com/g/transit-developers/c/KH8Ug66A7fk/m/t7uelxsnFL4J