This is an optional, non-standard file called
timetable_stop_order.txt which can be included in an agency's GTFS. It is used to specify stop order for a particular timetable. It is useful when generating combined timetables for multiple overlapping routes, or exerting fine-grained control on stop order.
This file is often not needed. If all trips for a route serve the same set of stops, or all trips stop order is topologically sortable, there is no need to use
timetable_stop_order.txt for that route.
timetable_stop_order.txt is only needed for routes where some trips serve completely different stops than other trips and where the order can not be determined using a directed graph.
GTFS-to-HTML uses toposort to sort stops for each trip topologically iin a directed graph to determine a valid stop order for use in a timetable. If stop order across trips is cyclic or disjointed (i.e. not all trips have a common stop) then the stop order from trip with most number of stops is used as a fallback.
|The ID of the timetable from |
|The ID of the stop from |
|An assigned integer identifying the order of stops to be presented in the timetable. The values for |
Route 1, trip 1 stops:
Route 2, trip 2 stops:
timetable_stop_order.txt for this route would be:
Or, if you'd like to show stops
G before stops
E on the timetable:
An example of this file is located in examples/timetable_stop_order.txt.
Stops with different arrival and departure times
Stoptimes with different arrival and departure times will be shown twice in a row and labeled as "(arrival)" and "(departure)". There is no need to put the same stop in timetable_stop_order twice in a row.