You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File shapes.txt should be Conditionally Required #643
The field trips. shape_id (a foreign ID referencing shapes.shape_id) is Conditionally Required, with the following condition:
Required if the trip has a continuous pickup or drop-off behavior defined either in routes.txt or in stop_times.txt
When that condition is true, shapes.txt becomes required as well, because trips.shape_id cannot be valid without a corresponding shapes.shape_id value.
Use cases
It is relevant for consumers when planning the database schemas, and for evaluating correctness of the feed.
Proposed solution
I see two possible paths:
Preferred: make shapes.txt conditionally required
Mark shapes.txt as Conditionally Required in the Presence column of the Dataset Files table (GTFS Schedule), with this condition:
Required if the trip has a continuous pickup or drop-off behavior defined either in routes.txt or in stop_times.txt.
This matches the existing condition on trips.shape_id and makes the transitive requirement explicit.
Alternative: remove the reference from trips.shape_id
If shapes.txt is not intended to become conditionally required under that condition, then trips.shape_id should not be a Foreign ID in trips.txt. In that case, its Type should be changed to Text (similar to direction_id), because there would be no guaranteed referenced table.
Additional information
This issue is related to #459, but it has a different purpose, as that one aims to include shapes.txt in the recommended tables.
As mentioned in the discussion of that issue, 85% of the feeds in the Mobility Database (as of May 2024) already have shapes.txt. Therefore, it shouldn’t be a significant change for producers to mark it as Conditionally Required.
I noticed that there is the option "Recommended" in the "Presence" column for some fields, for example for feed_info. feed_start_date. As a third proposed solution, shapes.txt could be marked as "Recommended" in the Dataset Files table, as long as that's a valid option for the presence of files. Still, my preferred option is "Conditionally Required", due to the transitive requirement discussed above.
Hello @fabianabarca and thanks for opening this issue! Feel free to reach out if you need any guidance on contributing to GTFS.
Once you feel ready, and ideally after this issue has had some discussion (though that's not required), feel free to open a proposal for this change.
Since this looks like a fix for a gap in the spec, you could make the case for it being a documentation change or a non-functional change. In that case, it would need either no vote or just one vote.
That said, a suggestion for your change is the following:
Thanks @etienne0101 for the reply! I understand, and it makes sense to present it as a documentation or non-functional change. I will wait a bit for any other comment but otherwise I will open a PR with the proposal, following your suggestion.
Activity
fabianabarca commentedon Jun 20, 2026
I noticed that there is the option "Recommended" in the "Presence" column for some fields, for example for
feed_info. feed_start_date. As a third proposed solution,shapes.txtcould be marked as "Recommended" in the Dataset Files table, as long as that's a valid option for the presence of files. Still, my preferred option is "Conditionally Required", due to the transitive requirement discussed above.etienne0101 commentedon Jul 2, 2026
Hello @fabianabarca and thanks for opening this issue! Feel free to reach out if you need any guidance on contributing to GTFS.
Once you feel ready, and ideally after this issue has had some discussion (though that's not required), feel free to open a proposal for this change.
Since this looks like a fix for a gap in the spec, you could make the case for it being a documentation change or a non-functional change. In that case, it would need either no vote or just one vote.
That said, a suggestion for your change is the following:
Conditionally Required:
fabianabarca commentedon Jul 2, 2026
Thanks @etienne0101 for the reply! I understand, and it makes sense to present it as a documentation or non-functional change. I will wait a bit for any other comment but otherwise I will open a PR with the proposal, following your suggestion.