Tour Calculation


Short description

The PTV xRoute service is able to respect provisions on working hours when calculating a route. If this feature is used, the PTV xRoute service considers these provisions by scheduling break and rest periods and by respecting limits on driving times and travel times.


The following technical concept explains how to make the PTV xRoute service regard the working hours. It describes which regulations are supported to which degree, and how to interpret the response.

Detailed Consideration

How to calculate tour information ?

PTV xRoute is able to calculate a routeA route corresponds to a path of a vehicle through the underlying transport network. The main attributes of a route are the distance and the time that the vehicle travels along the path. considering the opening intervals and service time on each waypointA waypoint is a geographic location used to specify start, destination and possible stopovers for a route. and the working hours restrictions.
As a post-processing of a routeClosed A route corresponds to a path of a vehicle through the underlying transport network. The main attributes of a route are the distance and the time that the vehicle travels along the path. calculation, if TourRestrictions are defined, a tour calculation is done. This tour calculation try to insert breaks and rests, taking into account the opening intervals and the service time on waypointsClosed A waypoint is a geographic location used to specify start, destination and possible stopovers for a route., and the defined restrictions.
Even if no valid tour can be calculated (because of the constraints), a response is returned with a reasonable violated solution.

Route response

From the route response point of view, each tour information (break, rest, service period, or waiting period) is returned as a NOT_DRIVING segment. Thus, it is guarantee that the sum of the travel time of the segments is equal to the total travel time of the route response.
Moreover, the travel time returned in route response is also equal to the tour period returned in the tour report response.

If several tour information are related to a waypoint (for waiting or service time), only one NOT_DRIVING segment is returned. This segment is always after the waypoint ; i.e. the tour operations start after reaching the waypoint.
However, for consistency reason, for the last waypoint of the route, the tour operations are performed before ; i.e. the NOT_DRIVING segment is before the waypoint.
The two nodes of a NOT_DRIVING segment are always located on the same coordinates ; which means that the vehicleThe term vehicle describes what is being routed or planned for. Vehicles are used in route calculation, distance matrix calculation and effectively also in tour planning. In route calculation, vehicle properties like overall size, weight and speed are in focus. In tour planning, it is vehicle properties like capacity and availability. Commonly a vehicle is motorized, like a truck - including its trailer or a car. However also a bike or even a pedestrian are included in this definition. doesn't move when performing a break, rest, service,...
Moreover, if a NOT_DRIVING segment is linked to a waypoint, the coordinates of its nodes are located on the waypoint.

Relation between tour information and waypoints, nodes, segments and legs

Tour events

To get more information about the calculated tour, it is possible to request the TOUR_EVENT.
The tour events are linked to the first node of the NOT_DRIVING segment. The coordinates of the event refer to the coordinates of this node. But the events will occur during the following segment, depending on the travelTimeFromStart field.

Relation between tour information and route events

Good to know

Tour restrictions on waypoint

Only OnRoadWaypoints and OffRoadWaypoints can deal with TourStopOptions.
Moreover only StartDurationInterval and StartEndInterval are supported to define the opening intervals on a waypoint.

Working hours regulations

PTV xRoute considers the following Drivers' working Hours:

  • In the European Union, the Regulation (EC) No. 561/2006.
  • In the United States, the Hours of Service Regulation (FMCSA) No. 395/2013.
To get more details, see Driving Time Regulation technical concept.

Time dependency

For technical reasons, only the following time consideration mode are supported:

For no time consideration and optimistic modes, since some rules of the regulations require a starting date, midnight 1/1/1970 is used as the reference date/time. Please note that this reference is taken into account to insert the breaks and rests, but no start time is returned in the tour report response.
SnapshotTimeConsideration, TimeSpanConsideration or ExactTimeConsiderationAtStart are mandatory to handle opening intervals on waypoints. If not set, an exception is thrown.

Maximum driving/travel time

Beside the rules of the choosen regulation, it is possible to set either the maximum travel time and/or the maximum driving time of the route (see TourRestrictions).
If these limitations are not observed, the flag violated is set to true in the tour report response. If tour events are requested, tour violations will be returned.
Moreover, if limits are set in combination with SingleDayWorkingHours, these limits are automatically adjusted regarding the regulation ; i.e. the limit cannot be upper than the regulation.

Rest positions

In case of MultiDayWorkingHours, it is mandatory to set dailyRestPositions to ANYWHERE which is not the default value.
PTV xRoute can only insert breaks into one trip. So the other options are not supported.

Technical Concept Working Hours
Technical Concept Driving Time Regulation
Showcase Routing with Tour information
Showcase Consider route events