Routing API Developer's Guide

Managing Time in Public Transport Requests

In Timetable Routing, the service provides scheduled transit departure times in the response, based on information provided by public transport companies. The routing engine incorporates a time buffer between walking into the station and the actual transit departure time, known as waitTime. You can calculate the actual transit departure time by adding the waitTime shown in the response to the time associated with the maneuver.

The waitTime is also included in the overall travelTime for the route. If you would like to get the journey time only, you must subtract associated waitTime values from the overall travelTime.

Calculating Departure Time

In the public transport routing example response below, we see that the actual train departure time is 2013-04-10T11:51:00+02, which is 60 seconds later than the time specified as the maneuver time.
{
  "position": {...},
  "instruction": "...",
  "travelTime": 720,
  "time": "2013-04-10T11:50:00+02",
  "action": "enter",
  "waitTime": 60,
  "_type": "PublicTransportManeuverType"
}

Calculating Departure Time with a Line Change

If the route itinerary contains a transit line change, then waitTime specifies the amount of time available to change lines. In this example, the journey itself takes only six minutes. Four minutes waitTime is required to change the transit line:
{
  "position": {...},
  "instruction": "...",
  "travelTime": 600,
  "time": "2013-04-10T12:02:00+02",
  "action": "change",
  "waitTime": 240,
  "_type": "PublicTransportManeuverType"
}

Arrival and Departure Guarantees

When you request a public transport route, it is not always possible for the API to strictly follow departure and arrival parameters. Due to transit availability, the schedule may start and end later or earlier than the time specified. In such cases, you can use alternative routes to offer more schedule options to your end user.