A single route event contains information which might be interesting for the driver or characterizes the course of the route such as reaching a waypoint, entering a different country or subdivision, or executing a certain maneuver.
The list of route events in response parameter events is ordered chronologically along the route. The events to be returned can be selected by using the request parameter results.
This example shows how to request a route with border events.
https://api.myptv.com/routing/v1/routes?waypoints=48.8281361,8.130226135&waypoints=48.847332494,8.058471679&results=BORDER_EVENTS&options[trafficMode]=AVERAGE
The result of the request above will look like this:
{
"distance": 6483,
"travelTime": 511,
"violated": false,
"events": [{
"latitude": 48.833287265,
"longitude": 8.1075147383,
"distanceFromStart": 2060,
"travelTimeFromStart": 186,
"countryCode": "FR",
"utcOffset": 60,
"border": {
"countryCode": "FR"
}
}
]
}
General
- Each route event in the chronologically ordered list contains some basic and some type-specific information.
- Use the basic information such as type and coordinates for marking the event in a map.
- Events with the same travelTimeFromStart are aggregated to one event which has all type-specific information. Please note that events from the same type could not be aggregated, even with the same travelTimeFromStart (for example when different violation events occur at the same place).
Schedule events
- Requesting SCHEDULE_EVENTS provides schedule events of the types SERVICE, BREAK, DAILY_REST and WAITING, in other words non-driving events.
- With SCHEDULE_EVENTS_WITH_DRIVING there will be additional schedule events of type DRIVING after each sequence of non-driving schedule events, but only if the driving time is greater than 0. With these DRIVING events the durations of all schedule events make up the total travel time of the route and every moment of the route can be attributed to a schedule type.
- When requesting SCHEDULE_EVENTS or SCHEDULE_EVENTS_WITH_DRIVING it is recommended to additionally request
- WAYPOINT_EVENTS to match non-driving schedule events at waypoints to their respective waypoint as well as
- COMBINED_TRANSPORT_EVENTS to understand that a BREAK or DAILY_REST is split because a combined transport is used.