Route calculations in truck routing take into account truck-related restrictions and other user-specified truck options. Truck routing is enabled by setting
transportMode=truck, and supports
short routing modes.
truck parameters are deprecated. Use
vehicle parameters instead. Do not use
truck parameters and
vehicle parameters in the same request.
Calculations will consider the following types of restrictions:
In areas with too many restrictions, route calculation might not be possible. By default, in these cases, the response will contain a route that violates some restrictions and a set of critical notes that inform about the violations included in the route. In rare cases, such as Romania, which has a 11.5t weight per axle restriction on most main roads, it is not even possible to calculate a default route with warnings about violations when the truck profile violates too many restrictions.
Travel time estimations are based on various factors, including live traffic conditions, historical traffic patterns, time taken for performing various maneuvers, and legal speed limits.
In some cases a vehicle may have a special speed limit that is lower than the legally mandated one. This could be because of fleet policies or some vehicle limitation. For such cases, the
vehicle[speedCap] parameter can be used to specify this limit to improve the accuracy of the travel time estimation for that vehicle.
Truck routing supports a set of request parameters that specify additional variables to be considered in route calculation. The representation of this profile is in the form
vehicle[parameter-name]=value. For a full list of supported parameters, see the Routing API specification.
Certain roads and bridges may have weight per axle restrictions, which your route consideration needs to take into account.
In most countries the regulations define maximum allowed weight per any axle, without specifying any details about that axle. Such generic weight per axle restrictions are often signposted like this:
Some countries, for instance USA, Sweden or Russia, define maximum allowed weights per specific axle groups. An example sign could look as follows:
Routing API offers two ways to specify the truck's maximum axle load:
These two parameters are exclusive to each other.
weightPerAxle is recommended in places where local regulations do not differentiate restrictions per different axle group types, or if only the weight of the truck's heaviest axle is known. Routing evaluates
weightPerAxle value against generic weight per axle restrictions and restrictions for all axle group types. In countries where local regulations specify maximum weights per different axle groups, it is recommended to use
weightPerAxleGroup to provide weights of different axle group types.
Examples for use of
vehicle[weightPerAxleGroup]=single:12, truck with 12 tons per single axle group
vehicle[weightPerAxleGroup]=tandem:16, truck with 16 tons per tandem axle group
vehicle[weightPerAxleGroup]=single:12,tandem:16,triple:20, truck with 12 tons per single axle group, 16 tons per tandem axle group and 20 tons per triple axle group
In some countries, such as Russia, weight per axle group restrictions are signposted as the maximum allowed weight of one physical axle within a tandem or a triple axle group. However, this does not change the API usage. You need to provide the total weight of each axle group using
vehicle[shippedHazardousGoods] parameter is used when transporting hazardous materials. With this parameter set the route calculation will avoid roads on which the specified hazardous materials are prohibited.
The rules for excluding roads with such restrictions include the following:
vehicle[shippedHazardousGoods]=harmfulToWater, roads prohibited for shipment of water pollutants are excluded from route calculation.
vehicle[shippedHazardousGoods]=explosive,flammable, roads prohibited for shipment of explosive and flammable materials are excluded from route calculation.
Although some hazardous material categories overlap, the routing engine does not implicitly map the hazardous materials to restricted goods. For example, if the cargo specifies combustible materials or gas (which could be flammable), roads prohibited for flammable materials are not excluded from route calculations. Similarly, if the cargo specifies poison or gas (which could be toxic), roads prohibited for materials that are poisonous upon inhalation are not excluded from route calculations.
Setting a value for the hazardous materials parameter does not automatically set a value for the
vehicle[tunnelCategory] parameter. You must set the appropriate value for both parameters. For more details about shipping hazardous materials on routes with tunnels, see the Set tunnel categories section.
Route calculation in truck routing ensures that vehicles are only routed on roads which are open to general trucks. The truck categories parameter,
vehicle[categories], can be used to modify this constraint for specific and limited use cases.
The default truck routing behavior is chosen by not specifying this parameter or setting this parameter as
undefined. such as
There are the following supported categories:
lightTruck category is selected by setting
In some regions "No Trucks" road signs have an implicit assumptions about the physical characteristics (height, weight, etc.) of the trucks that are restricted. The
lightTruck category can be used to specify that the vehicle does not qualify for these restrictions.
The canonical use case for this category is the "No Trucks" signs in Japan which apply to trucks weighing over 8T or have a loading capacity over 5T or boarding capacity over 11 people. The
lightTruck category can be used if the physical characteristics of a vehicle do not exceed these limits.
lightTruck category does not imply that any physical dimensions of the vehicle are assumed. The user must specify the height, weight and other physical parameters of their vehicle to ensure that the route complies with other physical and legal restrictions.
Tunnel categories specify which dangerous goods are not allowed to enter a regulated tunnel. A tunnel category can be specified with the parameter
vehicle[tunnelCategory]. The categories range from
B being the most restrictive.
B- transport is forbidden through tunnels displaying signs:
C- transport is forbidden through tunnels displaying signs:
D- transport is forbidden through tunnels displaying signs:
E- transport is forbidden through tunnels displaying sign
Setting a tunnel category does not automatically set a value for the
vehicle[shippedHazardousGoods] parameter. You must set the appropriate value for both parameters. For more details about transporting hazardous materials, see the Hazardous Materials Restrictions section.
By default, routes calculation in truck routing tries to avoid some turns and manuevers that are difficult or impossible for trucks. However, larger trucks may find the default behavior to be insufficient for their requirement. Stricter penalities can be enforced by using,
avoid[features]=difficultTurns. With this parameter set, route calculation will try to avoid more types of turns and will consider longer detours to avoid these turns.
These are examples of turns that truck routing will avoid:
If you apply
avoid[features]=difficultTurns, this does not avoid U-turns at stopover waypoints.
avoid[features]=uTurns will avoid U-turns on highways and motorways. It provides an alternative to
avoid[features]=difficultTurns - prevents smaller trucks from U-turning on roads with fast-moving traffic while allowing them to take sharp turns, which they are usually able to perform.
If you apply
avoid[features]=uTurns, this does not avoid U-turns at stopover waypoints.
For information on calculating truck routing with ferries, see these tutorials:
Truck routing does not penalize dirt roads by default; this is only possible by means of an option
avoid[features]=dirtRoad. If you'd like to create applications on top of this service, make sure to set
dirtRoad with every truck routing request, unless the circumstances allow or force these trucks to use dirt roads frequently.