timetables.txt
This is an optional, non-standard file called timetables.txt
. This file specifies to GTFS-to-HTML which HTML timetables should be built. Often, this is the only additional file you need to create to use GTFS-to-HTML.
Field Definitions
timetables.txt
Primary key (timetable_id, route_id
)
Field Name | Type | Presence | Description |
---|---|---|---|
timetable_id | Unique ID | Required | A unique ID for the timetable |
route_id | Foreign ID referencing routes.route_id | Required | Identifies a route to be used in this timetable from routes.txt . For timetables that should include more than one route, see Multi-route timetables. |
direction_id | Enum | Optional | Indicates the direction of travel to be used in the timetable. |
start_date | Date | Optional | The start date for this timetable in YYYYMMDD format. |
end_date | Date | Optional | The end date for this timetable in YYYYMMDD format. |
monday | Enum | Required | Indicates ndicates whether this timetable should include trips from Mondays. Valid options are:1 - include trips from Mondays in this timetable.0 - do not include trips from Mondays in this timetable. |
tuesday | Enum | Required | Indicates ndicates whether this timetable should include trips from Tuesdays. Valid options are:1 - include trips from Tuesdays in this timetable.0 - do not include trips from Tuesdays in this timetable. |
wednesday | Enum | Required | Indicates ndicates whether this timetable should include trips from Wednesdays. Valid options are:1 - include trips from Wednesdays in this timetable.0 - do not include trips from Wednesdays in this timetable. |
thursday | Enum | Required | Indicates ndicates whether this timetable should include trips from Thursdays. Valid options are:1 - include trips from Thursdays in this timetable.0 - do not include trips from Thursdays in this timetable. |
friday | Enum | Required | Indicates ndicates whether this timetable should include trips from Fridays. Valid options are:1 - include trips from Fridays in this timetable.0 - do not include trips from Fridays in this timetable. |
saturday | Enum | Required | Indicates ndicates whether this timetable should include trips from Saturdays. Valid options are:1 - include trips from Saturdays in this timetable.0 - do not include trips from Saturdays in this timetable. |
sunday | Enum | Required | Indicates ndicates whether this timetable should include trips from Sundays. Valid options are:1 - include trips from Sundays in this timetable.0 - do not include trips from Sundays in this timetable. |
start_time | Time | Optional | A time in HH:MM:SS format used exclude all trips that start before this time. Optional, default is to use all trips throughout the day. |
end_time | Time | Optional | A time in HH:MM:SS format used exclude all trips that start on or after this time. Optional, default is to use all trips throughout the day. |
include_exceptions | Enum | Optional | A binary value that indicates whether or not to include exceptions of type 1 from calendar_dates.txt , such as holiday service on a weekday. Valid options are:1 - include calendar exceptions in this timetable.0 - do not include calendar exceptrions in this timetable.Optional, defaults to 0 (exceptions are not included by default). |
timetable_label | Text | Optional | A short text label describing the timetable, for instance "Route 4 Northbound Mon-Fri". Optional, defaults to route name and first and last stops. |
service_notes | Text | Optional | Text shown on the timetable about the service represented. |
orientation | Enum | Optional | Timetable Oridentation. Valid options are:vertical - shows stops across the top row with each row being a list of stop times for each trip.horizontal - shows trips across the top row with each row being stop times for a specific stop.hourly - use for routes that run the same time each hour and will print a simplified schedule showing minutes after the hour for each stop.horizontal orientation is best for routes with lots of stops and fewer trips while vertical orientation is best for routes with lots of trips and a smaller number of stops. Optional, default is vertical . |
timetable_page_id | Foreign ID referencing timetable_pages.timetable_page_id | Optional | The timetable page that this timetable should be included on. |
timetable_sequence | Non-negative integer | Optional | The order that this timetable should appear on the timetable page. |
direction_name | Text | Optional | The human readable name of the direction of the timetable, such as "Southbound". |
show_trip_continuation | Enum | Optional | Whether this timetable should show an additional column(s) or row(s) indicating which trips continue from a different route or continue on as a different route. This is calculated by trips that share the same block_id in trips.txt . Valid options are1 - Show trips continuing from or continuing on as a different route0 - Don't show trips continuing from or continuing on as a different route.Optional, defaults to 0 . |
Example
timetable_id,route_id,direction_id,start_date,end_date,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_time,end_time,include_exceptions,timetable_label,service_notes,orientation,timetable_page_id,timetable_sequence,direction_name,show_trip_continuation
0,2034,0,20150101,20151122,1,1,1,1,1,1,0,00:00:00,13:00:00,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0
1,2034,0,20150101,20151122,1,1,1,1,1,1,0,13:00:00,24:00:00,0,101 Northbound,Mon-Sat PM,horizontal,1,1,Northbound,0
2,2035,1,20150819,20151122,1,1,0,1,1,0,0,,,0,101T Northbound,"Mon,Tue,Thur,Fri",horizontal,1,0,Northbound,0
3,2035,0,20150819,20151122,0,0,1,0,0,0,0,,,0,101T Southbound,Wednesday,horizontal,1,0,Southbound,0
4,2036,1,20150101,20151122,0,0,0,0,0,0,1,,,0,102 Eastbound,Sunday,horizontal,1,0,Eastbound,0
5,2036,0,20150101,20151122,1,1,1,1,1,0,0,,,0,102 Westbound,Mon-Fri,horizontal,1,0,Westbound,0
6,2036,1,20150101,20151122,0,0,0,0,0,1,0,,,0,102 Eastbound,Saturday,horizontal,1,0,Eastbound,0
7,2037,0,20150101,20151122,1,1,1,1,1,0,0,,,0,103 Westbound,Mon-Fri,horizontal,1,0,Westbound,0
An example of this file is located in examples/timetables.txt.
Multi-route Timetables
To allow creating a single timetable for multiple routes that overlap, you can have multiple entries in timetables.txt
for the same timetable_id
. All fields should be the same for each row in timetables.txt
for a combined route timetable except route_id
.
Multi-route example
In this example, only one timetable will be generated that will include trips from route_ids 2034
, 2035
and 2036
.
timetable_id,route_id,direction_id,start_date,end_date,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_time,end_time,include_exceptions,timetable_label,service_notes,orientation,timetable_page_id,timetable_sequence,direction_name,show_trip_continuation
0,2034,0,20150101,20151122,1,1,1,1,1,1,0,,,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0
0,2035,0,20150101,20151122,1,1,1,1,1,1,0,,,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0
0,2036,0,20150101,20151122,1,1,1,1,1,1,0,,,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0