cal-itp / operational-data-standard

The Transit Operational Data Standard is an open standard for representing the transit schedules used by drivers, dispatchers, and planners to carry out transit operations.
https://ods.calitp.org
Apache License 2.0
26 stars 6 forks source link

modify run_events and deadheads, service/run/piece/block_id #52

Closed skyqrose closed 6 months ago

skyqrose commented 9 months ago

This propsal makes the service_id, run_id, piece_id, and block_id fields more consistent.

It's based on the runs.txt proposal, but could be done independently of it.

It's a backwards in-compatible change to add required fields and make a required field optional. It's not totally necessary because you could work around these fields by querying through runs.txt or maybe runs_pieces.txt, but it will be more convenient and consistent, and allow representing some new edge cases.

Currently:

run_events.txt has a required piece_id field. It does not have service_id or run_id.

deadheads.txt has a required service_id field and a required block_id field. It does not have run_id or piece_id.

Proposed:

run_events.txt

Field name Type Required Description Change
service_id ID referencing calendar.service_id Required Identifies a set of dates when the event is scheduled to take place. New
run_id ID referencing runs.run_id Required Identifies the run during which the event takes place. New
piece_id ID referencing runs.piece_id Optional Identifies the piece during which the event takes place. May be left null for events that take place outside of a piece, such as a break. Optional

deadheads.txt

Field name Type Required Description
service_id ID referencing calendar.service_id Required Identifies a set of dates when the deadhead is scheduled to take place. Unchanged
run_id ID referencing runs.run_id Optional Identifies the run during which the deadhead takes place. New
piece_id ID referencing runs.piece_id Optional Identifies the piece during which the deadhead takes place. New
block_id ID Optional Identifies the block to which the deadhead belongs. Optional

Benefits:

skyqrose commented 6 months ago

Obsolete after #55 and #60