Symptom
ADR constraints such as tunnelRestrictionCode are configured in the vehicleProfile, but are not applied during route calculation or planTours optimization. Routes violate ADR restrictions even when the parameter appears correctly set in the request.
Cause
The PTV_TruckAttributes feature layer is not enabled. This feature layer controls whether the routing engine loads and applies truck-specific road attribute data, including:
- ADR tunnel restriction codes (categories A–E)
- Weight, height, width, and length restrictions
- Axle load constraints
- Hazardous goods prohibitions
Without this feature layer, the routing engine ignores all truck-specific constraints regardless of what is declared in the vehicleProfile.
Resolution
Always include the following in any request that involves truck or ADR routing (xRoute, DistanceMatrix, HPR creation):
"featureLayerProfile": {
"themes": [
{
"id": "PTV_TruckAttributes",
"enabled": true
}
]
}
Recommended validation workflow before using HPR + matrix in production:
- Call xRoute directly with PTV_TruckAttributes enabled and tunnelRestrictionCode set.
- Verify the route correctly avoids restricted tunnels.
- Only then create the HPR and Distance Matrix using the same profile.
For ExistingDistanceMatrix mode in planTours: the feature layer must be included at HPR creation time. It is not sufficient to declare it only in the planTours request, as the profile is inherited from the HPR.
Related articles
PTV xServer 2: Dynamic vehicle state changes not supported in ExistingDistanceMatrix planTours
PTV xServer 2 :ADR tunnel restrictions not applied in planTours when using ExistingDistanceMatrix
PTV xServer 2: Route divergence after changing vehicle parameters (height, weight)
PTV xServer 2: Height Violations Disappear or Route Changes When Adding a Waypoint