ibi-group / datatools-ui

Core application for IBI's transit data tools suite.
https://data-tools-docs.ibi-transit.com/en/latest/
MIT License
120 stars 80 forks source link

Stop code uniqueness should not be mandatory #987

Closed brodyFlannigan closed 1 year ago

brodyFlannigan commented 1 year ago

Observed behavior (please include a screenshot if possible)

When creating a stop, if another stop has the same stop_code as the stop being created, the stops editor shows a validation error, claiming that stop codes need to be unique, and does not allow saving the stop.

Expected behavior

Stop codes should be allowed to be non-unique. The GTFS specification does not require uniqueness of stop codes and there are real-life cases where this is true, for instance, in Ottawa, Canada, OC Transpo assigns one stop code to each Transitway station, which contains multiple bus platforms, each represented as a distinct stop (location_type = 0) in GTFS. I.e. Stops A, B, C and D at Tunney's Pasture station all bear code 3011.

Steps to reproduce the problem

  1. In GTFS editor, create a stop and assign it a stop code, then save it.
  2. Create a second stop and assign it the same stop code as the stop created in step 1.

Version of datatools-ui and datatools-server if applicable (exact commit hash or branch name)

Commit 6fc72d2148e8dda005aae9c2b26ba911e4197506

philip-cline commented 1 year ago

@brodyFlannigan sorry for the delay in picking this up! You're absolutely right the stop_code doesn't need to be unique. Thanks for flagging the Ottawa use case, I will look into fixing this