cal-itp/operational-data-standard

Create Examples section under Spec

Closed this issue · 0 comments

Overview

We would like to create a new section for Examples of different use cases for ODS

Requirements

Add text:

Examples

The following section provides examples of how ODS can represent specific use cases. The inclusion of these examples should not be as an indication that this is the only way to represent these use cases with ODS. If you have questions about a use case not represented here, please feel free to create an issue in GitHub.

Representing Runs

Single Run with Single Piece

Description:
In this example, bus driver X is assigned to run 10000 and completes trips 101, 102, 103, and 104 daily. The trips serve route 12 and are part of block BLOCK-A. Driver X begins their day at a bus yard prior to trip 101 and returns to the same bus yard following trip 104.

Diagram:
single-run-single-piece
Characteristics:

  • Run 10000 is not subdivided into multiple pieces.
  • Run 10000 and block BLOCK-A consist of the same deadheads and trips.
  • The trip composition of run 10000 is the same each day of the week.

Data Representation:
trips.txt

route_id,service_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,wheelchair_accessible,bikes_allowed
12,daily,101,,,0,BLOCK-A,,,,
12,daily,102,,,1,BLOCK-A,,,,
12,daily,103,,,0,BLOCK-A,,,,
12,daily,104,,,1,BLOCK-A,,,,

calendar.txt

service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
daily,1,1,1,1,1,1,1,01012022,12312022

deadheads.txt

deadhead_id,service_id,block_id,shape_id,to_trip_id,from_trip_id,to_deadhead_id,from_deadhead_id 
daily-deadhead-1,daily,BLOCK-A,,101,,,
daily-deadhead-2,daily,BLOCK-A,,,104,,

runs_pieces.txt

run_id,piece_id,start_type,start_trip_id,start_trip_position,end_type,end_trip_id,end_trip_position
10000,10000-1,0,daily-deadhead-1,,0,daily-deadhead-2,

Single Run with Multiple Pieces

Description:
In this example, bus driver X is assigned to run 10000 and completes trips 101, 102, 103, and 104 daily. Trips 101 and 102 are part of piece 10000-1 and trips 103 and 104 are part of piece 10000-2. The driver has a long break between the two pieces. The trips serve route 12 and are part of block BLOCK-A. Driver X begins their day at a bus yard prior to trip 101 and returns to the same bus yard following trip 104.

Diagram:
single-run-multiple-pieces

Characteristics:

  • Run 10000 is subdivided into two pieces.
  • Run 10000 and block BLOCK-A consist of the same deadheads and trips.
  • The trip composition of run 10000, and of pieces 10000-1 and 10000-2, is the same each day of the week.

Data Representation:
trips.txt

route_id,service_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,wheelchair_accessible,bikes_allowed
12,daily,101,,,0,BLOCK-A,,,,
12,daily,102,,,1,BLOCK-A,,,,
12,daily,103,,,0,BLOCK-A,,,,
12,daily,104,,,1,BLOCK-A,,,,

calendar.txt

service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
daily,1,1,1,1,1,1,1,01012022,12312022

deadheads.txt

deadhead_id,service_id,block_id,shape_id,to_trip_id,from_trip_id,to_deadhead_id,from_deadhead_id
daily-deadhead-1,daily,BLOCK-A,,0,,101
daily-deadhead-2,daily,BLOCK-A,,2,104,

runs_pieces.txt

run_id,piece_id,start_type,start_trip_id,start_trip_position,end_type,end_trip_id,end_trip_position
10000,10000-1,,0,daily-deadhead-1,,0,daily-deadhead-2,

Multiple Runs on a Single Block With No Mid-Trip Relief

Description:
In this example, bus driver X is assigned to run 10000 and completes trips 101 and 102. Bus driver Y is assigned to run 20000 and completes trips 103 and 104 immediately following trip 102. The trips serve route 12 and are part of block BLOCK-A. Driver X begins their day at a bus yard prior to trip 101 and driver Y returns to the same bus yard following trip 104.

Diagram:
multiple-runs-one-block

Characteristics:

  • Run 10000 and run 20000 are not subdivided into multiple pieces.
  • Run 10000 ends at the last scheduled stop of a trip.
  • Run 20000 begins at the first scheduled stop of a trip.

Data Representation:
trips.txt

route_id,service_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,wheelchair_accessible,bikes_allowed
12,daily,101,,,0,BLOCK-A,,,,
12,daily,102,,,1,BLOCK-A,,,,
12,daily,103,,,0,BLOCK-A,,,,
12,daily,104,,,1,BLOCK-A,,,,

calendar.txt

service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
daily,1,1,1,1,1,1,1,01012022,12312022

deadheads.txt

deadhead_id,service_id,block_id,shape_id,to_trip_id,from_trip_id,to_deadhead_id,from_deadhead_id
daily-deadhead-1,daily,BLOCK-A,,101,,,
daily-deadhead-2,daily,BLOCK-A,,,104,,

runs_pieces.txt

run_id,piece_id,start_type,start_trip_id,start_trip_position,end_type,end_trip_id,end_trip_position
10000,10000-1,,0,daily-deadhead-1,,1,102,
20000,20000-2,,1,103,,0,daily-deadhead-2,

Multiple Runs on a Single Block with Mid-Trip Relief

Description:
In this example, bus driver X is assigned to run 10000 and completes trip 101 and part of trip 102. Bus driver Y is assigned to run 20000 and completes the remainder of trip 102, before proceeding to trips 103 and 104. The trips serve route 12 and are part of block BLOCK-A. Driver X begins their day at a bus yard prior to trip 101 and driver Y returns to the same bus yard following trip 104.

Diagram:
multiple-runs-one-block-midtrip-relief

Characteristics:

  • Run 10000 and run 20000 are not subdivided into multiple pieces.
  • Run 10000 ends before the last scheduled stop of a trip (a driver is relieved mid-trip).
  • Run 20000 begins after the first scheduled stop of a trip (the driver is relieving someone mid-trip).

Data Representation:
trips.txt

route_id,service_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,wheelchair_accessible,bikes_allowed
12,daily,101,,,0,BLOCK-A,,,,
12,daily,102,,,1,BLOCK-A,,,,
12,daily,103,,,0,BLOCK-A,,,,
12,daily,104,,,1,BLOCK-A,,,,

calendar.txt

service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
daily,1,1,1,1,1,1,1,01012022,12312022

deadheads.txt

deadhead_id,service_id,block_id,shape_id,to_trip_id,from_trip_id,to_deadhead_id,from_deadhead_id
daily-deadhead-1,daily,BLOCK-A,,101,,,
daily-deadhead-2,daily,BLOCK-A,,,104,,

runs_pieces.txt

run_id,piece_id,start_type,start_trip_id,start_trip_position,end_type,end_trip_id,end_trip_position
10000,10000-1,0,daily-deadhead-1,,1,102,mid_relief_stop
20000,20000-1,1,103,mid_relief_stop,0,daily-deadhead-2,

Using run_events.txt

Pretripping and Pull-Out

Description:
In this example, bus driver X is assigned to run 10000 and piece 10000-1. The driver reports to the yard at 5:50 a.m. and begins pre-trip inspection at 6:07 a.m. before pulling out of the yard for trip 101 at 6:20 a.m. The driver is scheduled to arrive at the first stop of trip 101 at 6:28 a.m. and depart at 6:30 a.m.

Data Representation:
trips.txt

route_id,service_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,wheelchair_accessible,bikes_allowed
12,daily,101,,,0,BLOCK-A,,,,

calendar.txt
service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
daily,1,1,1,1,1,1,1,01012022,12312022

stop_times.txt

trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,continuous_pickup,continuous_drop_off,shape_dist_traveled,timepoint
101,06:28:00,06:30:00,5490,0,,,,,,
101,06:40:00,06:40:00,5491,1,,,,,,
101,06:50:00,06:50:00,5492,2,,,,,,
101,07:00:00,07:00:00,5493,3,,,,,,

runs_pieces.txt

run_id,piece_id,start_type,start_trip_id,start_trip_position,end_type,end_trip_id,end_trip_position
10000,10000-1,0,daily-deadhead-1,,1,101,

run_events.txt

run_event_id,piece_id,event_type,event_name,event_time,event_duration,event_to_location_type,event_to_location_id,event_from_location_type,event_from_location_id 
af0d9802,10000-1,0,,05:50:00,0,0,yard,0,yard
ebc02834,10000-1,1,“pre-trip inspection”,06:07:00,600,0,yard,0,yard
1f4da873,10000-1,7,“pull-out from yard”,06:20:00,0,0,pull-out-point,0,pull-out-point

Using deadhead_times.txt

Deadheading from yard to start of trip

Diagram:
deadheading-from-yard

Data Representation:
stops.txt

stop_id,stop_code,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,location_type,parent_station,stop_timezone,wheelchair_boarding,level_id,platform_code
8500,8500,“First Stop”,,33.000,-153.000,,,,,,,,,
8501,8501,“Second Stop”,,33.000,-153.000,,,,,,,,,
8502,8502,“Third Stop”,,33.000,-153.000,,,,,,,,,
8503,8503,“Fourth Stop”,,33.000,-153.000,,,,,,,,,
8504,8504,“Fifth Stop”,,33.000,-153.000,,,,,,,,,
8505,8505,“Sixth Stop”,,33.000,-153.000,,,,,,,,,
8506,8506,“Seventh Stop”,,33.000,-153.000,,,,,,,,,
8507,8507,“Eighth Stop”,,33.000,-153.000,,,,,,,,,

stop_times.txt

trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,continuous_pickup,continuous_drop_off,shape_dist_traveled,timepoint
101,10:00:00,10:01:00,8500,1,,,,,,
101,10:10:00,10:11:00,8501,2,,,,,,
101,10:20:00,10:21:00,5492,3,,,,,,
101,10:30:00,10:31:00,5493,4,,,,,,
101,10:40:00,10:41:00,5494,5,,,,,,
101,10:50:00,10:51:00,5495,6,,,,,,
101,11:00:00,11:01:00,5496,7,,,,,,
101,11:10:00,11:11:00,5497,8,,,,,,

deadheads.txt

deadhead_id,service_id,block_id,shape_id,to_trip_id,from_trip_id,to_deadhead_id,from_deadhead_id
test-deadhead,daily,BLOCK-A,,101,,,

deadhead_times.txt

deadhead_id,arrival_time,departure_time,ops_location_id,stop_id,location_sequence,shape_dist_traveled
test-deadhead,09:45:00,09:45:00,yard,,0,
test-deadhead,09:46:00,09:46:00,yard-pull-out,,1,
test-deadhead,09:50:00,09:50:00,,8506,2,
test-deadhead,09:55:00,09:55:00,,8507,3,
test-deadhead,10:00:00,10:00:00,,8500,4,

ops_locations.txt

ops_location_id,ops_location_code,ops_location_name,ops_location_desc,ops_location_lat,ops_location_lon
yard,,“Main Yard”,,34.000,-115.00
yard-pull-out,,“Yard Pull Out”,,34.000,-115.00