### agency.txt Example 1 Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Shows a basic agency entry with all standard fields. ```csv agency_id,agency_name,agency_url,agency_timezone,agency_phone,agency_lang FunBus,The Fun Bus,https://www.thefunbus.org,America/Los_Angeles,(310) 555-0222,en ``` -------------------------------- ### Producer Example: Duplicating Trip with Matching ADDED and DUPLICATED trip_ids Source: https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/examples/migration-duplicated.md This example demonstrates the first option for producers to link ADDED and DUPLICATED trip entities. The trip_id of both entities must be the same. ```protobuf entity { id: "ei0" trip_update { trip: { trip_id: "1" // <-- trip_id from static GTFS to copy schedule_relationship: ADDED start_date: "20200821" // <-- New trip date start_time: "11:30:00" // <-- New trip time } stop_time_update { ... } } } entity { id: "ei10" trip_update { trip: { trip_id: "1" // <-- trip_id from static GTFS to copy schedule_relationship: DUPLICATED } trip_properties { trip_id: "NewTripId987" // <-- New trip_id unique to this trip start_date: "20200821" // <-- New trip date start_time: "11:30:00" // <-- New trip time } stop_time_update { ... } } } ``` -------------------------------- ### Example trip_headsign and direction_id Usage Source: https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md This example demonstrates how trip_headsign and direction_id fields can be used together to assign a name to travel in each direction for a set of trips. This is useful for time tables. ```text trip_id,...,trip_headsign,direction_id 1234,...,Airport,0 1505,...,Downtown,1 ``` -------------------------------- ### Producer Example: Duplicating Trip with Matching ADDED trip_id and DUPLICATED trip_properties.trip_id Source: https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/examples/migration-duplicated.md This example demonstrates the second option for producers to link ADDED and DUPLICATED trip entities. The trip_id of the ADDED trip must match the trip_properties.trip_id of the DUPLICATED trip. ```protobuf entity { id: "ei0" trip_update { trip: { trip_id: "NewTripId987" // <-- New trip_id unique to this trip schedule_relationship: ADDED start_date: "20200821" // <-- New trip date start_time: "11:30:00" // <-- New trip time } stop_time_update { ... } } } entity { id: "ei10" trip_update { trip: { trip_id: "1" // <-- trip_id from static GTFS to copy schedule_relationship: DUPLICATED } trip_properties { trip_id: "NewTripId987" // <-- Matches the ADDED trip.trip_id start_date: "20200821" // <-- New trip date start_time: "11:30:00" // <-- New trip time } stop_time_update { ... } } } ``` -------------------------------- ### calendar_dates.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Specifies exceptions to regular service schedules, such as holidays or special event days. This example shows holiday service adjustments. ```csv service_id,date,exception_type WD,20060703,2 WE,20060703,1 WD,20060704,2 WE,20060704,1 ``` -------------------------------- ### stop_times.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Details the timing and sequence of stops for specific trips, including pickup and drop-off types. ```csv trip_id,arrival_time,departure_time,stop_id,stop_sequence,pickup_type,drop_off_type AWE1,0:06:10,0:06:10,S1,1,0,0 AWE1,,,S2,2,1,3 AWE1,0:06:20,0:06:30,S3,3,0,0 AWE1,,,S5,4,0,0 AWE1,0:06:45,0:06:45,S6,5,0,0 AWD1,0:06:10,0:06:10,S1,1,0,0 AWD1,,,S2,2,0,0 AWD1,0:06:20,0:06:20,S3,3,0,0 AWD1,,,S4,4,0,0 AWD1,,,S5,5,0,0 AWD1,0:06:45,0:06:45,S6,6,0,0 ``` -------------------------------- ### Modeling Loop Route Stops in stop_times.txt Source: https://github.com/google/transit/blob/master/gtfs/best-practices/best-practices.md When modeling a loop route in `stop_times.txt`, include the first/last stop twice to represent the complete circuit. This example shows a trip that returns to its starting stop. ```text trip_id | stop_id | stop_sequence 9000 | 101 | 1 9000 | 102 | 2 9000 | 103 | 3 9000 | 101 | 4 ``` -------------------------------- ### agency.txt Example 2 Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Illustrates an agency entry with a missing optional field (agency_phone). ```csv agency_id,agency_name,agency_url,agency_timezone,agency_lang agency001,Transit Agency,https://www.transitcommuterbus.com/,PST,en [...] ``` -------------------------------- ### pathways.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Describes pathways between stops, such as stairs, elevators, or escalators, including mode and directionality. ```csv pathway_id,from_stop_id,to_stop_id,pathway_mode,is_bidirectional E1N1,E1,N1,2,1 E2N1,E2,N1,2,1 E3N1,E3,N1,2,1 N1-N2,N1,N2,6,1 N2-N1,N2,N1,7,1 N2N3,N2,N3,2,1 N2-B1,N2,B1,4,0 B1-N2,B1,N2,4,0 B1B2,B1,B2,2,1 B1B3,B1,B3,1,1 B2B4,B2,B4,1,1 E4N3,E4,N3,2,1 E5N3,E5,N3,2,1 N3-N4,N3,N4,6,1 N4-N3,N4,N3,7,1 N4B3,N4,B3,2,1 N4-B3,N4,B3,4,0 B3-N4,B3,N4,4,0 B3B4,B3,B4,2,1 ``` -------------------------------- ### transfers.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Defines rules for transfers between stops, including transfer type and minimum transfer time. ```csv from_stop_id,to_stop_id,transfer_type,min_transfer_time S6,S7,2,300 S7,S6,3, S23,S7,1, ``` -------------------------------- ### attributions.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Specifies attributions for data producers or operators, linking them to specific agencies. ```csv attribution_id,is_producer,is_operator,organization_name,agency_id attribution001,1,0,Transit Feed Solutions USA,agency001 attribution002,0,1,Transit Bus Operations USA ,agency001 [...] ``` -------------------------------- ### routes.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Defines a transit route, including its short and long names, a description, and the route type. ```csv route_id,route_short_name,route_long_name,route_desc,route_type A,17,Mission,"The ""A"" route travels from lower Mission to Downtown.",3 ``` -------------------------------- ### levels.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Defines different levels within a station, such as street level, mezzanine, or specific platforms, with their index and elevation. ```csv level_id,level_index,level_name,elevation L0,0,Street,0 L1,-1,Mezzanine,-6 L2,-2,Southbound,-18 L3,-3,Northbound,-24 ``` -------------------------------- ### calendar.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Defines regular weekly service schedules, specifying which days of the week a service is active and the date range for its validity. ```csv service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date WE,0,0,0,0,0,1,1,20060701,20060731 WD,1,1,1,1,1,0,0,20060701,20060731 ``` -------------------------------- ### fare_rules.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Associates fares with specific routes, origin/destination stops, or containing stops. ```csv fare_id,route_id,origin_id,destination_id,contains_id a,TSW,1,1, a,TSE,1,1, a,GRT,1,1, a,GRJ,1,1, a,SVJ,1,1, a,JSV,1,1, a,GRT,2,4, a,GRJ,4,2, b,GRT,3,3, c,GRT,,,6 ``` -------------------------------- ### frequencies.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Specifies headways (time intervals) between trips on a route during specific time periods. ```csv trip_id,start_time,end_time,headway_secs AWE1,05:30:00,06:30:00,300 AWE1,06:30:00,20:30:00,180 AWE1,20:30:00,28:00:00,420 ``` -------------------------------- ### trips.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Shows trip information, linking routes to specific service schedules and assigning unique trip IDs and block IDs. ```csv route_id,service_id,trip_id,trip_headsign,block_id A,WE,AWE1,Downtown,1 A,WE,AWE2,Downtown,2 ``` -------------------------------- ### shapes.txt Example Source: https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md Defines the geographic path for a route, specifying points along the shape with sequence and distance. ```csv shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled A_shp,37.61956,-122.48161,1,0 A_shp,37.64430,-122.41070,2,6.8310 A_shp,37.65863,-122.30839,3,15.8765 ```