GTFS Schedule Overview¶
A GTFS feed, which contains static transit information, is composed of a number of text (.txt) files that are contained in a single ZIP file. Each file describes a particular aspect of transit information: stops, routes, trips, fares, etc. For more information about each file, consult the GTFS reference.
In order to create a GTFS feed follow the steps below.
- Create all the required files described in the GTFS Schedule reference. Create the optional files if their functionality is desired.
- Save all files in the .txt format. Field values should be comma delimited and each line should end with a line break. See the GTFS reference for detailed information on the file contents.
- Zip all the text files together. The zipped file comprises a version of the feed.
- Publish the feed by using one of the options below.
Making a Transit Feed Publicly Available¶
Datasets should be published at a public, permanent URL, including the zip file name. (e.g., www.agency.org/gtfs/gtfs.zip). Ideally, the URL should be directly downloadable without requiring login to access the file, to facilitate download by consuming software applications. While it is recommended (and the most common practice) to make a GTFS dataset openly downloadable, if a data provider does need to control access to GTFS for licensing or other reasons, it is recommended to control access to the GTFS dataset using API keys, which will facilitate automatic downloads.
The web-server hosting GTFS data should be configured to correctly report the file modification date (see HTTP/1.1 - Request for Comments 2616, under Section 14.29).
See “Best Practices: Dataset Publishing” for further recommendations.
The World Bank Open Learning Campus (OLC) offers a self-based online course called “Introduction to the General Transit Feed Specification (GTFS) and Informal Transit System Mapping”. This course includes the following sections:
- What is GTFS? History & File Structure
- What is GTFS? Visualization & Community
- Setting up a GTFS Feed
- Introduction to GitHub & Open Source Tools
- Stories from the Field
- How to Map Transit Data
- How to Collect Data for a City’s First Feed
- App Survey
See more online courses.
Getting Help & Community¶
There are a number of mailing lists that can be good resources when you have questions about public transit data, software, formats like GTFS and GTFS-realtime, and other issues:
- GTFS Changes: discussion of proposal for extending the GTFS specification, as outlined in the GTFS Changes document.
- GTFS Realtime: discussion of the GTFS-realtime specification.
- MobilityData Slack: Slack "organization" at with channels devoted to GTFS topics. Request an invite to mobilitydata-io.slack.com here.
- transitfeed: discussion of the open-source transitfeed project, as well of discussion of the GTFS specification and associated tools.
- transit-developers: general transit developer discussions. Many transit agencies also have their own developer mailing lists specific to the agency. For example:
Check with your local transit agency to see if they have a mailing list of their own.
See more community resources.