Public Transit & GTFS

A timetable is a graph that changes every minute.

The public transit path, from the tables of a GTFS feed to travel times and population served. a timetable is a graph that changes every minute1the feedtables and keys2the calendartrips on a date3frequency & mapsper route, per direction4travel timeisochrones, people servedStage two is the turn: after it, every count and every travel time is for one resolved date

GTFS looks like the easiest data on this site — a zip of CSV files — and it is the one where the most numbers come out plausibly wrong. A trip does not name its dates, a time can be 25:10:00, and the travel time between two places depends on the minute you leave. These guides read a feed properly, resolve its calendar to a date, measure frequency per route and direction, clip and map it, route across it with a connection scan, draw isochrones and walking catchments, count the population served, and read the realtime feeds that correct it — with the fixes for times past midnight, empty dates, straight-line routes and travel times that flatter the network.

The calendar guide at step two is the turn in this path. Before it, a feed is a set of tables; after it, every count is for a date, and the holiday that removes one timetable and adds another stops being a trap. Everything later — frequency, routing, isochrones, population served — is computed on one resolved service day.

The full path, in order

The concepts underneath the work, then each task, then the errors that task produces. Work down, or jump to the step you need.

  1. GTFS service calendars explained: calendar, calendar_dates and the service day gtfs calendar_dates explained 🧭 Concept
  2. Transit frequency and headways explained transit headway frequency 🧭 Concept
  3. Transit accessibility explained: why travel time depends on the minute you leave transit accessibility travel time 🧭 Concept
  4. GTFS Realtime explained: trip updates, vehicle positions and alerts gtfs realtime explained 🧭 Concept
  5. How to read a GTFS feed in Python read gtfs python ⚙️ How-To
  6. How to find the trips running on a given date in GTFS gtfs trips on date ⚙️ How-To
  7. How to map transit routes and stops from GTFS shapes map gtfs routes python ⚙️ How-To
  8. How to calculate service frequency at every stop from GTFS gtfs stop frequency python ⚙️ How-To
  9. How to clip a GTFS feed to a study area clip gtfs feed ⚙️ How-To
  10. How to build walking catchments around transit stops transit stop walking catchment ⚙️ How-To
  11. How to compute transit travel times from GTFS in Python transit travel time python gtfs ⚙️ How-To
  12. How to draw a transit isochrone from a GTFS feed transit isochrone python ⚙️ How-To
  13. How to measure the population served by frequent transit population near frequent transit ⚙️ How-To
  14. How to read GTFS Realtime vehicle positions and delays in Python gtfs realtime python ⚙️ How-To
  15. GTFS times after 24:00 break time parsing gtfs time 24:00 🔧 Fix
  16. GTFS routes draw as straight lines between stops gtfs shapes straight lines 🔧 Fix
  17. A GTFS query returns no trips, or the wrong trips, on a date gtfs no trips on date 🔧 Fix
  18. Transit travel times come out too short transit travel time too short 🔧 Fix
  19. stop_times.txt is too big to load comfortably gtfs stop_times memory 🔧 Fix

Topics this path covers

A path is a route; a topic is everything the site has on a subject. Open a topic to see the guides this path skips.

Other ways in