GTFS Realtime
   HOME

TheInfoList



OR:

GTFS Realtime (also known as GTFS-rt) is an extension to
GTFS GTFS, or the General Transit Feed Specification, defines a common data format for public transportation schedules and associated geographic information. GTFS contains only static or scheduled information about public transport services, and is ...
, in which
public transport Public transport (also known as public transit, mass transit, or simply transit) are forms of transport available to the general public. It typically uses a fixed schedule, route and charges a fixed fare. There is no rigid definition of whic ...
agencies share real-time vehicle locations, arrival time predictions, and alerts such as detours and cancellations via
Protocol Buffers Protocol Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs that communicate with each other over a network or for storing data. The method involves an ...
web server. Realtime location data is created continuously by an agency from
automatic vehicle location Automatic vehicle location (AVL or ~locating; telelocating in EU) is a means for automatically determining and transmitting the geographic location of a vehicle. This vehicle location data, from one or more vehicles, may then be collected by a ...
(AVL) systems. Trip arrival times are computed using machine learning models that analyse historical positional data and timetables. The standard is used by public transport agencies globally, including the United States, Canada, most countries in the European Union, United Kingdom, Australia, New Zealand, and in
Yokohama, Japan is the second-largest city in Japan by population as well as by area, and the country's most populous municipality. It is the capital and most populous city in Kanagawa Prefecture, with a population of 3.7 million in 2023. It lies on Tokyo B ...
.


History

On 22 August 2011, a first version of GTFS-rt was released by Google. This data was shown to
Google Maps Google Maps is a web mapping platform and consumer application offered by Google. It offers satellite imagery, aerial photography, street maps, 360° interactive panorama, interactive panoramic views of streets (Google Street View, Street View ...
users. In July 2012,
Google Maps Google Maps is a web mapping platform and consumer application offered by Google. It offers satellite imagery, aerial photography, street maps, 360° interactive panorama, interactive panoramic views of streets (Google Street View, Street View ...
began showing alerts from GTFS-rt. A proposal that was created on July 28, 2015 and merged on Aug 15, 2015 allowed the combination of several feed entity types into a single feed. While the majority of agencies separate feed entity types (Vehicle Positions, Trips, and Alerts), some feeds are still joined. On August 30, 2021, an experimental feed entity types, Shapes, was released. Shapes has the ability to update route shapes in real time to reflect detour, as route updates are either reflected by referencing an existing shape_id or by defining in real time a new shape as an encoded polyline. In 2022, CalTrans' Integrated Travel Project began validating GTFS Schedule and Realtime feeds published by municipality and county public transport agencies within California. Monthly reports are published on the errors in agency data, along with analysis of typical street speeds and traffic. In September 2023, Swiftly and the app
Transit Transit may refer to: Arts and entertainment Film * ''Transit'' (1980 film), a 1980 Israeli film * ''Transit'' (1986 film), a Canadian short film * ''Transit'' (2005 film), a film produced by MTV and Staying-Alive about four people in countrie ...
proposed 2 additional feed entity types: Stop and Trip Modifications. These allow agencies to broadcast new detour paths of routes and new temporary stops. The change has been released to users in the Transit app across several agencies. On March 11, 2024, the proposal was merged and released by GTFS maintainers.


Standard

The GTFS Realtime specification is defined by a .proto file hosted by Google. Data is serialized into raw bytes by the server and then deserialized by a client. Officially supported GTFS-rt binding libraries have been built in
.NET The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
,
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
,
Javascript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (prog ...
, and Go. Unofficial libraries have been written in other languages, such as
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH) ...
. There are currently three official feed types defined in the standard, TripUpdates, VehiclePositions, and Alerts. Shapes, Trip Modifications, and Stops are currently experimental. Agencies supporting GTFS-Realtime typically provide separate urls for the three separate feed types, and may choose to only provide some of the feeds. Unlike GTFS Schedule zip files, many agencies may require developers to request an API key via email or a web form. Developers then write programs to periodically fetch an agency's web API over
HTTP HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
, typically every few seconds to minutes. Agencies typically refresh data in frequencies ranging between 1 second to 1 minute. There is no standard for streaming GTFS Realtime data, also support is built in to allow for deletion of items from previous iterations.


Trip updates

In the GTFS Specification, a trip refers to an operator driving a fixed-route vehicle from the start of the route to the end. A new trip is started for when the vehicle turns around at the end of its route. The Trip Update feed allows maps to show the departure or arrival times of vehicles, and allows routing algorithms to update their directions. This feed contains an array of Trip Updates. Each trip update enumerates a description of a trip (trip id, route id, start time and date, direction), last updated time, may include an associated vehicle number and route number, and contains an array of ''StopTimeUpdate''. The ''StopTimeUpdate'' can define past, current, and future stop times, delays, and cancellations. The stop id references the GTFS Schedule feed the agency provides.


Vehicle positions

Vehicle Positions are sometimes shown on mapping applications to aid users in tracking the location of buses. This feed contains an array of ''VehiclePositions''. Like Trip Updates, each ''VehiclePosition'' can also contain a basic description of the trip, such as its trip id, start and stop times, route number, and relationship to the schedule. The ''VehiclePosition'' also contains the current latitude and longitude of the vehicle, and can also include bearing, odometer, and speed in m/s. Finally, it can also contain information on how crowded the bus is, known as occupancy status, and status of road congestion experienced by the vehicle.


Alerts

Alerts can be shown to mapping application users to alert them of detours, cancellations, or other service changes. This feed contains an array of ''Alerts.'' Alerts typically don't update as often as Vehicle Positions or Trip Updates. Each Alert stores the cause (such as labour strike or a mechanical fault) of an incident, along with its effect (reduced service, detour, stop cancellation, etc.). Alerts also contain detailed headers, descriptions, urls, images, and a list of routes or stops affected (known as the Informed Entity). Alerts specify their beginning and expiration times using "active periods". Alerts can be localised into several languages.


References

{{Reflist Public transport information systems Scheduling (transportation) Web syndication formats Computer file formats Real-time computing