We are announcing the addition of real-time transit trip updates to the CalcRoute API. Real-time transit data is made available by a limited set of transit agencies who provide their data in real-time format. We have coverage provided by 100 agencies in metro areas across the world including New York, Chicago, Boston, Los Angeles, Toronto, Houston, and Baltimore. Currently, the 4 markets where coverage exists are the United States, Canada, Australia, New Zealand, and the Netherlands, the last of which has coverage nationwide. The addition of real-time trip updates means we now 1) recommend better routes that accounts for these updates and 2) expose these updates to developers in the API response’s childItineraryItems object:
"Washington St @ E Newton St"
text: "Depart: Washington St @ E Newton St"
Definitions for the 3 new fields:
- isRealTimeTransit - Indicates if the trip schedule is from a realtime update or from a static schedule
- realTimeTransitDelay – Indicates the number of seconds of the delay the train is delayed from the expected arrival time as indicated by the static schedule
- realTimeTransitTimeOfUpdate – Indicates the time (with local time offset from UTC) when the real time update was last updated by the real time feed provider
If a real time update is provided, this means that the time field has been updated to reflect the real time update. To retrieve the original time scheduled in the static timetable for that leg of the trip, simply subtract the realTimeTransitDelay from time.
You can find a code-sample that leverages real-time trip updates here: https://github.com/v-chrfr/real-time-sample. The sample generates the viewer included below:
- Bing Maps Team