Skip to content
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

Editor: importing feed normalizes stop_times#stop_sequence values causing mismatch with GTFS-rt #283

Open
landonreed opened this issue Apr 22, 2020 · 0 comments
Labels

Comments

@landonreed
Copy link
Contributor

Observed behavior

Importing a GTFS feed into the RDBMS-backed editor will normalize stop_sequence values so that these are predictable and SQL queries can expect stop_times to start at zero and increment by one.

* Normalize stop sequences for stop times table so that sequences are all zero-based and increment
by one. This ensures that sequence values for stop_times and pattern_stops are not initially out
of sync for feeds imported into the editor.
NOTE: This happens here instead of as part of post-processing because it's much faster overall to perform

This was originally determined to be a good design decision with no side effects, but since then we have uncovered that modifying the stop_sequences can cause the GTFS static feed to be out of alignment with GTFS-realtime Trip Updates feeds with selectors that target stop_times by stop_id and sequence. This mismatch was first encountered when importing the Pace Bus GTFS file into the editor to update feed_info#feed_id for use with the GTFS-rt feed in an OpenTripPlanner deployment.

Expected behavior

Ideally, this normalize stop sequence operation would not happen at all and we would redesign the system to accommodate stop times with non-zero based, non-incrementing stop_sequence values. Outside of that, there may be a way to only modify the stop_sequences on update and leave the stop_times alone unless they were updated by a pattern.

Steps to reproduce the problem

  1. Import Pace Bus feed
  2. Load into editor
  3. Snapshot and publish feed.
  4. Download GTFS and observer stop_times#stop_sequence changes.

Notes on configuration and files required to reproduce the issue

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant