-
Notifications
You must be signed in to change notification settings - Fork 214
[GTFS-Fares v2] Add networks.txt & route_networks.txt #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tzujenchanmbd
merged 5 commits into
google:master
from
MobilityData:networks+route_networks
Nov 28, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ba95dca
Add networks.txt & route_networks.txt
tzujenchanmbd 6016f23
Modify presence of routes.network_id
tzujenchanmbd 5bbcd8b
Modify fare_leg_rules.network_id
tzujenchanmbd 8664074
Modify primary key of route_networks.txt
tzujenchanmbd f191923
Revise link
tzujenchanmbd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would networks.txt be forbidden when the relation between networks an routes is specified in routes.txt? The conditionally forbidden relation this pull request intends is only between routes.network_id and route_networks.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ferranmanya I agree and was recently confused by this as well. As currently written here and validated by MobilityData's validator (https://github.com/MobilityData/gtfs-validator/pull/1671/files), networks can't both be named (requires use of networks.txt) and be linked to routes (requires use of routes.network_id or route_networks.txt).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ferranmanya @sberkley
Agree this could be a bit confusing... Here’s some background information:
routes.network_id,networks.txt, androute_networks.txtwere not all introduced into GTFS at the same time.routes.network_idwas added to GTFS in May 2022 through PR#286. At that time, there was no dedicatednetworks.txttable for networks (“non-normalized”), and most producers simply defined networks usingroutes.network_id.In 2023, the community raised the need to handle fares data separately—which is what this PR addresses—and that led to the addition of both
route_networks.txtandnetworks.txt. Withnetworks.txt, networks became normalized and have anetwork_idprimary key.After introducing
networks.txt, what if it also became the primary table referenced byroutes.network_id? This would mean the validator must check the references between the two tables, which would be a breaking change for producers who had previously only providedroutes.network_id. And GTFS currently maintains strict backward compatibility for producers. We also want to avoid the confusion that could result from mixing old and new approaches. In a mixed scenario, it can become unclear which definition of a network should be treated as authoritative...This is why the current validator rule exists. Its meaning is essentially: either use the previous
routes.network_idalone, or use the new [route_networks.txt+networks.txt] combination to define networks.