Toll
Characteristic
Short description
With the toll related parts of the xRoute API it is possible to retrieve toll costs for a specific route 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. and vehicle The 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.. The structure of the response is designed for flexibility and the possibility to tailor the toll report to your needs. Also with xDima the toll costs can optionally be calculated, stored and accessed for each relation of a matrix.
Use
A basic toll summary can be retrieved for a route by setting enabled to true in the toll result fields. With the further result fields sections and systems a detailed toll report can be requested.
In xDima, when a distance matrix is created, the toll costs have to be activated as additional contents in the distance matrix options. In order to get the toll costs of a matrix the corresponding result field has to be activated.
Detailed Consideration
With the toll related parts of the xRoute and xDima API it is possible to retrieve toll costs for a specific route or relation of a matrix, depending also on the vehicle parameters and the reference time.
The xRoute toll report
The toll report in the route response consists of three main parts:
- The toll summary contains the total toll costs for the route.
- An entry in the list of toll sections represents one single section on the route for which toll has to be paid and provides further information such as payment methods, in which country the cost has to be paid, etc. Please refer to the showcase to see how this information can be aggregated and displayed.
- For each toll system where toll has to be paid there will be an entry in this list. It contains basic information about the operator of this toll system and which tariff version was used.
The xDima toll calculation
In xDima, the toll costs calculation can be requested by setting the option persistTollCosts in the distance matrix options to true. To query the toll costs, the toll result field in the distance matrix contents result fields should be used.
Please note that when using a Create and Get distance matrix request, the option persistTollCosts is ignored and instead the toll costs result field should be used. The time consideration scenarios multiple travel times and exact are not supported when requesting toll prices in xDima.
Toll road distances
The main focus of PTV's toll data is to provide accurate prices, however sometimes the distance on toll roads is also of use. With the release of version 2.30 the behaviour of the toll events and the start and end node indexes of a toll section have been improved. Furtheremore, the field calculatedDistance
has been added to the toll section next to the official distance:
- Official distance: If the toll provider publishes the toll road distances in machine readable form it is usually captured by PTV and this field in the response is filled.
- Calculated distance: As implied above the official distance is not available for every toll system. Therefore, a best guess of the length of a toll section is returned combining information from the map provider as well as PTV's toll data.
When you request the toll sections you can determine the effective toll road distance. It is your decision what you take from the toll section but one suggestion is to use the official distance when returned and the calculated distance otherwise.
Then, to aggregate the toll road distance for:
- a complete route: Sum up the effective toll road distance for each section.
- a route leg: In addition to the toll sections you need to request the legs. Each leg provides a start toll section index and an end toll section index. Sum up the effective toll road distance for the specified range of sections belonging to a leg.
- a country: Each toll section also provides a country code so you can easily sum up the effective toll road distance per country.
- a toll system: In addition to the toll sections you need to request the toll systems. Then each toll section also provides a toll system index for which you can sum up the effective toll road distance.
Then, to aggregate the toll road distance for:
- a complete route: Sum up the effective toll road distance for all pairs of ENTER and EXIT events.
- a route leg: In addition to the toll events you need to request the waypoint A waypoint is a geographic location used to specify start, destination and possible stopovers for a route. events. A waypoint event signals that the following toll events belong to the next leg. Note that a waypoint event can be in between ENTER and EXIT toll events.
- a country: In addition to the toll events you need to request the country events. A country event signals that the following toll events belong the country of the event.
Waypoints on a toll road
There are differences in how toll systems work. Some toll systems require an onboard unit to track the vehicle. For others you have to pass a toll plaza once or a twice, for example when the vehicle enters the toll road and when it leaves the toll road. When one of the waypoints is on a toll road or at a service station inside a toll section, the toll information might be incomplete depending on how the toll data is modeled. For the case that two toll locations are required to calculate the toll price, several scenarios can be distinguished:
- A-B-C: Consider a route with three waypoints A, B and C where A and C are the depot and the customers location and B is an intermediate stop at a service station on a highway. The toll road is entered between A and B and left between B and C. The toll summary of the route will contain the correct price, but the leg toll summary for the leg A to B will have zero costs, because the toll road is left between B and C and only then the toll information to calculate the price is available.
- A-B where A is on the toll road: In this situation it is not known where the toll road is entered. Along the route it is checked where there is the next possibility to enter the toll road and then this information is used to calculate the toll price.
- A-B where B is on the toll road: In this situation it is not known where the toll road is left. Along the road after the destination it is checked where there is the next possibility to leave the toll road and then this information is used to calculate the toll price.
- A-B where both waypoints are on the toll road: This is just a combination of the two previous cases and both steps are done.
isApproximated
of the affected toll section and containsApproximatedSections
of the toll summary will be set to true.
Time dependency
The toll calculation also considers time dependent toll prices such as different prices for peak hours. It is also possible to calculate toll prices for dates in the future as far as this data is available and contained in the map. Please refer to the technical concept on time consideration which time consideration modes are supported. Without a time consideration mode provides a reference time it is possible to miss out on toll prices. In such cases use the mode TollOnlyTimeConsideration
as its reference time is only used for toll price determination but not for routing.
Avoiding toll roads during route selection
With setting the toll penalty it is possible to avoid toll roads during route selection. Please note that the toll road sections cannot be avoided if waypoints are put on a toll road.
Vehicle parametrization
In the documentation for the vehicle profile there are sets of numbers at each parameter describing for which features and feature layers they might be used. The number (2) is for toll calculation.
Furthermore, some vehicle parameters can be set through the generic mechanism in the feature layer profile. Sometimes new vehicle parameters are introduced first by this generic mechanism and are later added to the vehicle profile A profile is a collection of parameters used to configure the request. Full profiles consist of a number of specialized sub-profiles like the VehicleProfile which describes the properties of a vehicle. with the next API version. Of course it is also possible to adapt these parameters to your needs:
- Get the list of parameters relevant for toll calculation: Refer to the integration sample on how to retrieve the available metainformation in the map or check the following list:
featureLayerProfile/parameters[@key='isCommercial']/@value
: Toll operators may assign different prices to vehicles by their legal status. Accepted values are NONE, FALSE and TRUE.featureLayerProfile/parameters[@key='numberOfTractorAxles']/@value
: The number of axles for the whole vehicle do not always suffice to represent the vehicle definitions by the toll operators.featureLayerProfile/parameters[@key='numberOfTrailerAxles']/@value
: The number of axles for the whole vehicle do not always suffice to represent the vehicle definitions by the toll operators.featureLayerProfile/parameters[@key='totalPermittedNumberOfPassengers']/@value
: Used to distinguish buses from other vehicles.
- Adapt your profile: refer to the integration sample on vehicle parametrization.
Since the end of the year 2023 two new vehicle parameters are relevant for toll calculation in several European countries (e.g., Austria and Germany) with the implementation of the 2022 version of the Directive 1999/62/EC of the European Parliament and of the Council on the charging of heavy goods vehicles for the use of certain infrastructures.
The CO₂ emission class (available since xServer version 2.30): As specified in Article 7ga of the above mentioned directive, vehicles with high CO₂ emissions shall pay a higher toll compared to vehicles with low CO₂ emissions.
The total technically permitted weight (available since xServer version 2.32): It is a variant of the already existing total permitted weight and in particular refers to the technically permitted weight, which is normally specified by the manufacturer. It is possible to register a vehicle with a legally permitted weight (which we refer to with the existing parameter total permitted weight) smaller than the technically permitted weight. For example, in Germany often vehicles with a technically permitted weight of a bit more than 3.5t are registered with a legally permitted weight of just 3.5t; this procedure is also called "Ablasten" in German. On the one hand, the maximum allowed payload is smaller, on the other hand there are some benefits like the vehicle can be driven with a normal driver's license or it is allowed to use roads that are closed for trucks. Up to 2023 there was another benefit since the smaller legally permitted weight was also relevant for tolls, but with the implementation of the above mentioned EU directive the technically permitted weight becomes relevant instead.
The European Union Council Directive 1999/37/EC on the registration documents for vehicles specifies three different variants of permissible laden mass (which is called "permitted weight" at the xServer API):
- (F.1) maximum technically permissible laden mass
- (F.2) maximum permissible laden mass of the vehicle in service in the Member State of registration (optional)
- (F.3) maximum permissible laden mass of the whole vehicle in service in the Member State of registration (optional)
Often these values are the same, and in this case it is sufficient to set one of the parameters total permitted weight or total technically permitted weight to that value (see also the section on weight parameters of the technical concept on vehicle parameters). However, if they are different, you can set F.1 as total technically permitted weight and F.3 or F.2 as total permitted weight. This allows that the correct total technically permitted weight is used for toll calculation and the different total (legally) permitted weight is used for other decisions like whether a road is closed or not. Note that the term "total" indicates that the permitted weight parameters always refer to the whole vehicle including all trailers.
Good to know
Licensing
The license key toll needs to be activated to render toll roads and to calculate toll prices. Avoidance of toll roads is possible with the general xroute license.
Data formats and sources
As of xServer release 2.9 xRoute supports two different data formats regarding toll:
- For the legacy format the xServer provides basic support. A toll summary can be returned for the complete route as well as the legs. Furthermore, it is possible to avoid toll roads. However, it is not possible to get details like the toll sections, toll systems, and toll events along the route. The format won't be further developed and integrated.
- With the new format the full detailed toll API is supported, which is stable as of xServer release 2.16. It is in parts still under development.
VAT
The toll prices gathered by PTV are always without VAT.
Related Topics
Showcase | Calculate Toll Costs |
Showcase | Calculate Toll Costs with xDima and xRoute |
Showcase | Consider Route Events |
Integration sample | Displaying toll roads |
Integration Sample | Calculating Toll for a Route |
Integration Sample | How to Retrieve the Available Metainformation in the Map |
Technical Concept | Time Consideration |
Technical Concept | Distance Matrices |
Technical Concept | High Performance Routing |