Providing transit updates in real-time to users greatly enhances their experience of your transit services. Providing up-to-date information about current arrival and departure times allows users to plan their trips even more smoothly. And, in case of an unfortunate delay, a rider would be relieved to know that they can stay home a little bit longer.
GTFS realtime is a feed specification that allows public transportation agencies to provide realtime updates about their fleet to application developers. It is an extension to GTFS (General Transit Feed Specification), an open data format for public transportation schedules and associated geographic information. GTFS realtime was designed around ease of implementation, good GTFS interoperability and a focus on passenger information.
The specification was designed through a partnership of the initial Live Transit Updates partner agencies, a number of transit developers and Google. The specification is published under the Apache 2.0 License.
What is Live Transit Updates for Google Maps?
Live Transit Updates is a service providing real-time transit updates to users of Google Maps and Google Maps for mobile. These updates include live departure and arrival times to transit stations, as well as service alerts.
At this time, Live Transit Updates provide 2 types of real-time updates to users: live departure times and service alerts. These updates should be provided in feeds by transit partners. We created the GTFS-realtime feed format that complements the widely used GTFS format for static transit schedules. Your feed needs to be available on a location where we can fetch it periodically. The updates in the feed will be immediately processed as Live Transit Updates information.
How do I start?
For Google to provide live updates on your fleet, we need to have your static schedule information available through Google Maps first. If you don’t provide your static schedule information yet, please follow the instructions to participate.
- If your static transit information is available in Google Maps, please fill out the contact form. We will get back to you on how to create the appropriate feeds with real-time updates.
- Continue reading the overview below.
- Decide which feed types you will be providing.
- Take a look at example feeds.
- Create your own feeds using the reference.
- Publish your feed.
Overview of GTFS realtime feed types
The specification currently supports the following types of information:
- Trip updates: Delays, cancellations, changed routes
- Service alerts: Stop moved, unforeseen events affecting a station, route or the entire network
- Vehicle positions: Information about the vehicles including location and congestion level
Updates of each type are provided in a separate feed. Feeds are served via
HTTP and updated frequently. The file itself is a regular binary file, so
any type of webserver can host and serve the file (other transfer protocols
might be used as well). Alternatively, web application servers could also
be used which as a response to a valid HTTP
GET request will return the
feed. There are no constraints on how frequently nor on the exact method of
how the feed should be updated or retrieved.
Because GTFS realtime allows you to present the actual status of your fleet, the feed needs to be updated regularly - preferably whenever new data comes in from your Automatic Vehicle Location system.
The GTFS realtime data exchange format is based on Protocol Buffers.
Protocol buffers are a language- and platform-neutral mechanism for serializing structured data (think XML, but smaller, faster, and simpler). The data structure is defined in a gtfs-realtime.proto file, which then is used to generate source code to easily read and write your structured data from and to a variety of data streams, using a variety of languages, such as Java, C++, or Python.
The hierarchy of elements and their type definitions are specified in the gtfs-realtime.proto file.
This text file is used to generate the necessary libraries in your choice of programming language. These libraries provide the classes and functions needed for generating valid GTFS realtime feeds. The libraries not only make feed creation easier but also ensure that only valid feeds are produced.
To participate in discussions around GTFS realtime and suggest changes and additions to the specification, join the GTFS realtime discussion group.
Additional resources are available on the Community page.
Google Maps and live Transit updates
One of the possible applications that uses GTFS realtime is Live Transit Updates, a feature within Google Maps that provides users with realtime transit information.
If you provide a transportation service that is open to the public, and operates with fixed schedules and routes, we welcome your participation; it is simple and free.