Skip to content
Documentation

Trips and schedules

Last updated

Trips represent scheduled transit service along a route. Each trip defines the specific sequence of stops served at particular times. Trip data is imported from GTFS source feeds as part of each feed version.

Trips are trips.txt entities imported from GTFS. A trip represents a single journey along a route at a specific time. Multiple trips typically operate on the same route throughout a service day, with each trip serving the same or similar stop sequences.

Key trip attributes include:

  • Trip headsign: The destination or direction displayed to riders (for example, "Downtown" or "Airport")
  • Direction: Binary indicator (0 or 1) for travel direction, typically outbound vs. inbound
  • Block: Groups sequential trips operated by the same vehicle, where a rider may be able to stay aboard from one trip to the next
  • Shape: Geographic path the vehicle travels. For trips without a shape, Transitland generates one from the stop-to-stop path (see route geometries)

Stop times define when a trip serves each stop along its route. This data comes from stop_times.txt in GTFS feeds.

Each stop time includes:

  • Arrival and departure times: When the vehicle arrives at and departs from each stop. If times are not provided for a stop, Transitland interpolates them from the nearest stops before and after that have times, in proportion to distance along the trip's shape.
  • Stop sequence: The order in which stops are visited
  • Pickup and drop-off types: Whether passengers can board, alight, or both at each stop
  • Timepoint: Indicates if the time is exact or approximate

Service dates

Trip schedules operate on specific dates defined by service calendars:

  • Regular service: Defined in calendar.txt with weekly patterns and date ranges
  • Exceptions: Defined in calendar_dates.txt for holidays, special events, or service changes

Service dates vs. calendar dates: GTFS uses a "service date" concept where a service day can extend past midnight. For example, a late-night trip departing at 1:00 AM on Saturday morning is often considered part of Friday's service date. This allows transit agencies to represent their operational day, which may not align with calendar days.

Frequency-based service

Some routes operate on headway-based schedules rather than fixed times. This is defined in frequencies.txt, indicating that vehicles depart at regular intervals (for example, every 10 minutes) rather than specific scheduled times.

Transitland enriches static trip schedules with real-time data from GTFS Realtime feeds. The departures endpoint applies trip updates to scheduled departures, and transit routing applies them to itineraries within its real-time coverage. See the Alerts concept page for how service alerts are made available through the API.

For detailed information about querying schedule data through the Transitland APIs, see: