# 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. The representation of this profile is formatted truck[parameter]=value. For the available parameters, see the Routing API specification.

## Truck Restrictions

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

• Legal restrictions – apply to segments 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

## Route Section Notices

If no route is found that obeys all specified options and truck parameters and avoids all applicable restrictions, a route may still be provided.

In this case, notices with possible reasons are returned in the relevant section of a route. Notices about violated vehicle restrictions contain details about the restrictions that were violated. This gives users a hint to either change their waypoints or truck parameters to be able to get to the desired destination.

Please refer to the Routing API specification for full details on notices.

Example response with detailed notices:

curl -X GET \
'https://router.hereapi.com/v8/routes?origin=50.892387,20.655124&destination=50.894911,20.64899&transportMode=truck&truck[grossWeight]=4000&departureTime=2020-10-28T00:01:00+01:00'

{
"routes": [
{
"id": "4ff6518f-ebf4-4c69-aa6f-ed1a67c0daec",
"sections": [
{
"id": "f9fd7dca-e7ca-4c95-9033-fb5b395a5452",
"type": "vehicle",
"departure": {
"time": "2020-10-28T00:01:00+01:00",
"place": {
"type": "place",
"location": {
"lat": 50.8924,
"lng": 20.655124
},
"originalLocation": {
"lat": 50.892387,
"lng": 20.6551239
}
}
},
"arrival": {
"time": "2020-10-28T00:04:32+01:00",
"place": {
"type": "place",
"location": {
"lat": 50.8948931,
"lng": 20.6489882
},
"originalLocation": {
"lat": 50.8949109,
"lng": 20.64899
}
}
},
"notices": [
{
"title": "Violated vehicle restriction.",
"code": "violatedVehicleRestriction",
"severity": "critical",
"details": [
{
"type": "restriction",
"cause": "Route violates vehicle restriction",
"maxGrossWeight": 3500,
"timeDependent": true
}
]
}
],
"transport": {
"mode": "truck"
}
}
]
}
]
}