# Truck Routing

The Truck Routing features of the API extend router with truck-specific options.

## Truck Transport Mode

Route calculations in Truck Transport Mode take into account truck-related restrictions and other user-specified options like avoiding difficult turns.

Supported routing modes are fast and short.

## Truck Profile

Truck Profile refers to a set of request parameters that specify the truck parameters used in route calculation. It's represented in format truck[parameter]=value. Please refer to the Routing API specification for available parameters.

## Truck Restrictions

Routes calculated in Truck Routing Mode take the following Truck Restrictions into account:

• Legal restrictions – apply to links and maneuvers prohibited for trucks.
• Physical restrictions – apply to physical attributes of a vehicle, for example: weight, weight per axle, height, width, or length.
• Hazardous materials restrictions – apply to cargoes with hazardous materials.
• Tunnel categories – apply to a tunnel category for hazardous materials.
• Axle restrictions – related to a vehicle axle count.
• Time dependent restrictions – apply to restrictions for a specific period of time. Routes using roads that violate a time dependent restriction are penalized if the vehicle reaches the road while the restriction is valid. However, this restriction is not taken into account if the road is reached outside of the restricted period or if the route is calculated in the planning mode.
• Conditional restrictions – apply to legal or physical restrictions dependent on time or Truck Profile, where the Truck Profile may include attributes such as axleCount.

## Hazardous Materials Restrictions

This restriction applies to truck cargo, where the resulting route excludes roads on which hazardous materials are prohibited from being transported. 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 truck[shippedHazardousGoods]=harmfulToWater, roads prohibited for shipment of water pollutants are excluded from route calculation.
• when the request specifies truck[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.

## Tunnel Categories

Tunnel Categories specify which dangerous goods are not allowed to enter the regulated tunnel. 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

Because tunnel categories include restrictions for dangerous goods, you might expect the routing engine to automatically select the most appropriate tunnel category based on the shippedHazardousGoods parameter. However, this is not the case. If you have set the shippedHazardousGoods parameter, you must still set the tunnelCategory parameter as well. The routing engine cannot calculate the value for tunnelCategory based on the shippedHazardousGoods alone.

## Difficult Turns

Routes calculated in Truck Transport Mode may avoid turns that are difficult, dangerous or impossible to take when driving long trucks. That feature is controlled with following avoid option:

avoid[features]=difficultTurns

Examples of such turns might be:

• sharp driver-side turn that requires taking a big arc (and thus going through opposite direction traffic) to perform
• sharp passenger-side turn which has an angle that is close to the angle of a u-turn

## Detailed Route Calculation Failure Notices

In case router fails to calculate the route for a given request, notices(RouteResponseNotice) with possible failure reasons might be returned in response. This gives user a hint to either change his waypoints or truck parameters to be able to get to desired destination.

Details contain information about the following:

• possible truck restriction violations (TruckRestrictionNoticeDetail detail type)
• possible access restriction violations (AccessRestrictionNoticeDetail detail type)

For details about RouteResponseNotice, TruckRestrictionNoticeDetail and AccessRestrictionNoticeDetail types please refer to the Routing API specification.

Example response with detailed notices:

{
"notice": [{
"title": "Route calculation failed: Couldn't find a route.",
"code": "noRouteFound",
"details": [
{
"cause": "Potential route would violate truck restriction",
"type": "truckRestriction",
"restriction":
{
"maxAxleCount": 4,
"maxGrossWeight": 12000,
}
},
{
"cause": "Potential route would violate truck restriction",
"type": "truckRestriction",
"restriction":
{
"maxGrossWeight": 12000,
"timeDependent": "true"
}
},
{
"cause": "Potential route would violate access restrictions",
"type": "accessRestriction"
}]
}],
"routes": []
}