This file is optional in a GTFS feed.
In some cases a route may repeat a particular stopping pattern every few
minutes (picture a subway line that runs every 5 minutes). Rather than
including entries in
stop_times.txt for every
single occurrence, you can include the trip once then define rules for
it to repeat for a period of time.
Having a trip repeat only works in the case where the timing between
stops remains consistent for all stops. Using
use the relative times between stops alongside a calculated starting
time for the trip in order to determine the specific stop times.
|Required||The ID of the trip as it appears in |
|Required||The time at which a given trip starts repeating, in |
|Required||The time at which a given trip stops repeating, in |
|Required||The time in seconds between departures from a given stop during the time range.|
|Optional||Whether or not repeating trips should be exactly scheduled. See below for discussion.|
The following sample data is taken from Société de transport de Montréal (STM) in Montreal (https://openmobilitydata.org/p/societe-de-transport-de-montreal).
Each of the trips listed here have corresponding entries in
stop_times.txt (more on that shortly). This data
can be interpreted as follows.
- The first trip runs every 10m 30s from 5:30am until 7:25am.
- The second trip runs every 9m 20s from 7:25am until 8:40am, and so on.
The following table shows some of the stop times for the first trip
departure_time is omitted here for brevity, since it is identical
As this trip runs to the specified frequency, the specific times do not matter. Instead, the differences are used. For the above stop times, there is a 59 second gap between the first and second time, a 61 second gap between the second and third, and a 120 second gap between the third and fourth.
The stop times for the first frequency record (10.5 minutes apart) can be calculated as follows.
In the file definition at the beginning of this chapter there is an
optional field called
exact_times. It may not be immediately clear
what this field means, so to explain it better, consider the frequency
definitions in the following table.
These two frequencies are the same, with only the
different. The first (
T1) should be presented in a manner such as:
"Between 9 AM and 10 AM this trip departs every 5 minutes."
The second trip (
T2) should be presented as follows:
"This trip departs at 9 AM, 9:05 AM, 9:10 AM, ..."
While ultimately the meaning is the same, this difference is used in order to allow agencies to represent their schedules more accurately. Often, schedules that convey to passengers that they will not have to wait more than five minutes do so without having to explicitly list every departure time.