Skip to content

GTFS Realtime Tutorial #3: Vehicle Positions

Kelly Dunn edited this page Feb 21, 2021 · 2 revisions

The following tutorial was created by Brian Ferris:

In my third tutorial about working with GTFS-realtime data, I'm going to be talking about vehicle positions:

https://developers.google.com/transit/gtfs-realtime/vehicle-positions

Vehicle positions tell us where a transit vehicle is actually located, typically as a lat-lon coordinate.

In my first two tutorials, I focused on demonstrating how to produce a GTFS-realtime feed, but in this example I'll show how to consume a GTFS-realtime feed. Specifically, this demo project will input data from a GTFS-realtime vehicle positions feed and display the resulting transit vehicles on a nice map, dynamically updating the map as positions are updated. The nice thing about GTFS-realtime is that it's pretty simple to consume. The code to import the data is just a handful of lines!

I hope you find this useful! Stay tuned for more tutorials about working with GTFS-realtime data. I'll be finishing off the week talking about GTFS-realtime support in the OneBusAway application server and also discussing a number of GTFS-realtime converters that I have written to help agencies more easily produce GTFS-realtime data.