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 fast and 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:
Legal restrictions – apply to segments and maneuvers prohibited for trucks. These restrictions are enabled automatically when transportMode=truck is specified.
Physical restrictions – apply to physical attributes of a vehicle, for example: weight, weight per axle, height, width, or length. You need to specify your vehicle parameters for these restrictions to be applied.
Hazardous materials restrictions – apply to the nature of the goods that are being transported in the vehicle. You must specify the type of hazardous cargo/goods your vehicle is transporting with the vehicle[shippedHazardousGoods] parameter.
Tunnel categories – apply to a tunnel category for hazardous materials. You need to specify the tunnel categories to avoid tunnels with the vehicle[tunnelCategory] parameter.
Time-dependent restrictions – apply to any of the above restrictions but are valid only for a specific period of time. Routes using roads that violate a time-dependent restriction are penalized if the vehicle could reach that section of the route while the restriction is valid. However, this restriction is not taken into account if the section is reached outside of the restricted period. time-dependent restrictions are ignored if the route is calculated in the planning mode (departureTime=any).
Difficult turns - apply to U-turns and other sharp angled manuevers that may be difficult for large vehicles to execute. For this behavior, you must specify the parameter avoid[features]=difficultTurns.
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.
Truck travel time estimations
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.
Lower priority roads
The truck transport mode optimizes the route such that it prefers high-priority over low-priority roads. This can include avoiding road types such as residential roads, small forest roads,or narrow side streets. It can also lead to preferring to stay on a highway instead of detouring through a city center if the benefit for the chosen routing mode is only minor. These preferences are subject to adjustments as the Routing API is continously optimized for a better user experience.
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.
Weight per axle restrictions
Certain roads and bridges may have weight per axle restrictions, which your route consideration needs to take into account.
Types of weight per axle restrictions
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:
Weight per axle and weight per axle group
Routing API offers two ways to specify the truck's maximum axle load:
These two parameters are exclusive to each other.
Using 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 weightPerAxleGroup:
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[weightPerAxleGroup].
Hazardous materials restrictions
The 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:
when the truck contains hazardous materials, roads prohibited for shipment of dangerous materials are always excluded from route calculation.
when the request specifies vehicle[shippedHazardousGoods]=harmfulToWater, roads prohibited for shipment of water pollutants are excluded from route calculation.
when the request specifies vehicle[shippedHazardousGoods]=explosive,flammable, roads prohibited for shipment of explosive and flammable materials are excluded from route calculation.
when the request specifies a hazardous material that is in the truck, roads prohibited for shipment of that specific hazardous material 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 vehicle[category]=undefined
The lightTruck category is selected by setting vehicle[category]=lightTruck
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.
Using the 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.
Set tunnel categories
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 to E with B being the most restrictive.
B - transport is forbidden through tunnels displaying signs: B,C,D or E
C - transport is forbidden through tunnels displaying signs: C,D,E
D - transport is forbidden through tunnels displaying signs: D,E
E - transport is forbidden through tunnels displaying sign E only
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.
Avoid difficult turns
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:
U-turns on highways and motorways
Sharp passenger-side turns that have an angle that is close to the angle of a U-turn
Sharp driver-side turns that require taking a big arc (and thus going through opposite direction traffic) to perform
If you apply avoid[features]=difficultTurns, this does not avoid U-turns at stopover waypoints.
Setting the 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.