Public transit & GTFS

Timetables as data: GTFS feeds, service calendars, frequency, transit travel times and the realtime feeds that correct them.

Two riders a minute apart at a stop with a bus every 15 minutes: one waits one minute, the other fourteen. a minute late at the stop costs the whole headway08:0008:1508:3008:45arrives 08:14 · waits 1 minarrives 08:16 · waits 14 minTransit travel time is a property of the minute you leave, not just of the two places

A transit feed is a timetable stored as a database. Routes are labels, trips are journeys, and the times live in one enormous table that only makes sense once a calendar has said which dates each trip runs on. Every question here — how often, how far, how many people — is a join across four or five files, and the calendar is the one most often skipped.

What makes the subject hard is time. A GTFS time can read 25:10:00, a holiday can remove one timetable and add another, and the travel time between two places depends on the minute you leave, because missing a bus by a minute costs its whole headway. Almost every error in this topic is a number that looks reasonable: a frequency counted across both directions, a catchment drawn as a circle, a travel time taken from the best departure of the hour.

The concepts below cover the feed, its calendar, headways and accessibility; the how-to guides read, clip, map and route across a real feed; and the fixes are filed under the symptom — times past midnight, empty dates, straight-line routes and travel times that flatter the network.

Learning paths run through this topic too — see the end of this page.

🧭 Start with the concepts

The ideas the how-to guides below assume you already have.

⚙️ Then do the task

Step-by-step walkthroughs with code you can copy and adapt.

Show every how-to guide in this topic

🔧 When it breaks

The errors this topic produces, with the cause explained rather than just the command.

Related topics

Subjects that keep coming up alongside this one, most overlap first.

Keep browsing

Public transit & GTFS sits in Analysis. Every topic on the site is listed on the topics index.