-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat: Add validation support for transfers.txt transfer_type 4 and 5. #1266
feat: Add validation support for transfers.txt transfer_type 4 and 5. #1266
Conversation
Maybe I'm getting something wrong, but after having a check on a test dataset, it seems like
The spec says in transfers.from_stop_id & to_stop_id (reference).
This notice should be triggered for every row of
I am also seeing that this addition in the spec has 2 typos and doesn't really follow the style for other Conditionally Required fields, maybe I can try to rephrase a bit. |
Hmm... when I read the spec change there, I'll admit I did initially read it as applying to any type of stop. While I can see why a station reference wouldn't make sense here, it's not clear to me why ANY stop reference is needed here. Specifically, for an in-seat transfer between two trips, the stop would always need to be the last stop of the incoming trip and the first stop of the outgoing trip, as anything else wouldn't make sense. And in that context, I thought the spec was just indicating that the stop should be left blank because it can just be inferred from the trip itself. But if the stop is required, then I would additionally check that it is indeed the last or first stop of the trip, as anything else would be malformed. But mostly, I'm not sure what the intention of the spec addition was here? |
…s-v2/gtfs-validator into issue/1264/transfer_type
Ok, based off the discussion in the slack channel, I've implemented the following validation logic:
As part of this, I've also introduced a TransferDirection helper class that simplified some of the logic of dealing with continual @KClough and @isabelle-dr this is ready for another look |
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.
Thank you so much for this contribution @bdferris-v2!
I have ran this PR against a test dataset and it works perfectly ✨.
Closes #1264.
This adds validation support for the newly added
transfers.txt transfer_type
values of 4 and 5 for in-seat transfers. It additionally adds conditional validation checks forfrom_stop_id
,to_stop_id
,from_route_id
, andto_route_id
, which must not be specified if these new transfer types are used.Please make sure these boxes are checked before submitting your pull request - thanks!
gradle test
to make sure you didn't break anything