General Transit Feed Specification

From Wikipedia, the free encyclopedia
  (Redirected from GTFS)
Jump to: navigation, search
General Transit Feed Specification
Visualization of GTFS transit routes in Madrid
A visualization created from GTFS data for transit routes in Madrid, Spain
Filename extension .zip
Initial release 27 September 2006; 9 years ago (2006-09-27)
Type of format Transit schedule format
Extended from CSV
Standard De facto standard
Open format? Yes, CC BY 3.0
Website [1]

The General Transit Feed Specification (GTFS) defines a common format for public transportation schedules and associated geographic information.

History[edit]

What was to become GTFS started out as a side project of Google employee Chris Harrelson in 2005, who “monkeyed around with ways to incorporate transit data into Google Maps […] when he heard from Tim and Bibiana McHugh, married IT managers at TriMet, the transit agency for Portland, Ore[gon]”.[1] McHugh is cited with being frustrated about finding transit directions in unfamiliar cities, while popular mapping services were already offering easy-to-use driving directions at the time.[2]

Bibiana and Tim McHugh eventually got into contact with Google and provided the company with CSV exports of TriMet's schedule data. In December 2005, Portland became the first city to be featured in the first version of Google's “Transit Trip Planner”.[3] In September 2006, five more US cities were added to the Google Transit Trip Planner, and the data format released as the Google Transit Feed Specification.[4]

In the United States, there had not been any standard for public transit timetables prior to the advent of GTFS, not even a de-facto standard. According to long-time BART website manager Timothy Moore, before the advent of GTFS, BART had to provide different data consumers with different formats, making a standardized transit format very desirable.[1] The publicly and freely available format specification, as well as the availability of GTFS schedules, quickly made developers base their transit-related software on the format. This resulted in “hundreds of useful and popular transit applications”[2] as well as catalogues listing available GTFS feeds. Due to the common data format those applications adhere to, solutions do not need to be custom-tailored to one transit operator, but can easily be extended to any region where a GTFS feed is available.

Due to the wide use of the format, the “Google” part of the original name was seen as a misnomer “that makes some potential users shy away from adopting GTFS”. As a consequence, it was proposed to change the name of the specification to General Transit Feed Specification in 2009.[5]

Structure[edit]

 Class diagram of GTFS
Class diagram of GTFS

A GTFS feed is a collection of at least six, and up to 13 CSV files (with extension .txt) contained within a .zip file. Preferred character encoding is UTF-8. Together, the related CSV tables describe a transit system's scheduled operations as visible to riders. The specification is designed to be sufficient to provide trip planning functionality, but is also useful for other applications such as analysis of service levels and some general performance measures. In contrast to European transit industry exchange standards such as Transmodel or VDV-45X, GTFS only includes scheduled operations that are meant to be distributed to riders. It is also limited to scheduled information and does not include real-time information. However, real-time information can be related to GTFS schedules according to the related GTFS-realtime specification.[6]

Following are descriptions of the tables required for a valid GTFS data feed. Each table is literally a text CSV file whose filename is the name of the table, suffixed by '.txt'. So for the 'agency' table below, a CSV file called 'agency.txt' would be included in a valid GTFS feed.

agency[edit]

The agency table provides information about the transit agency as such, including name, website and contact information.

Required fields:

  • agency_name
  • agency_url
  • agency_timezone

routes[edit]

The routes table identifies distinct routes. This is to be distinguished from distinct routings, several of which may belong to a single route.

Required fields:

  • route_id (primary key)
  • route_short_name
  • route_long_name
  • route_type

trips[edit]

Required fields:

  • trip_id (primary key)
  • route_id (foreign key)
  • service_id (foreign key)

Optional fields:

  • block_id - The block ID indicates the schedule block to which a trip belongs.

stop_times[edit]

Required fields:

  • stop_id (primary key)
  • trip_id (foreign key)
  • arrival_time
  • departure_time
  • stop_sequence

Note that dwell time may be modelled by the difference between the arrival and departure times. However, many agencies do not seem to model dwell time for most stops.

stops[edit]

The stops table defines the geographic locations of each and every actual stop or station in the transit system as well as, and optionally, some of the amenities associated with those stops.

Required fields:

  • stop_id (primary key)
  • stop_name
  • stop_lon
  • stop_lat

calendar[edit]

The calendar table defines service patterns that operate recurrently such as, for example, every weekday. Service patterns that don't repeat such as for a one-time special event will be defined in the calendar_dates table.

Required fields:

  • service_id (primary key)
  • monday
  • tuesday
  • wednesday
  • thursday
  • friday
  • saturday
  • sunday
  • start_date
  • end_date

Optional tables:

  • calendar_dates.txt
  • fare_attributes.txt
  • fare_rules.txt
  • shapes.txt
  • frequencies.txt
  • transfers.txt
  • feed_info.txt

See also[edit]

References[edit]

  1. ^ a b Roush, Wade (2012). "Welcome to Google transit: How (and why) the search giant is remapping public transportation" (PDF). Community Transportation: 3. 
  2. ^ a b Dyson, Lauren; Goldstein, Brett; Nemani, Abhi (2013). Beyond Transparency. Code for America Press. pp. 125–135. 
  3. ^ Garg, Avichal. "Public Transit via Google". Official Google Blog. Retrieved 14 March 2016. 
  4. ^ Harrelson, Chris. "Happy Trails with Google Transit". Official Google Blog. Retrieved 14 March 2016. 
  5. ^ Hughes, Joe. "proposal: remove "Google" from the name of GTFS". General Transit Feed Spec Changes. Google Groups. Retrieved 14 March 2016. 
  6. ^ "What is GTFS-realtime?". Google Developers. Google. 

External links[edit]