How to apply a rule in a routing request? (xRoute2)
Posted: Tue Dec 19, 2023 12:47 pm
Today a colleague asked me for a sample request that demonstrates how to activate a rule as mentioned in PTV_TruckAttributes.Rules:
Here's a ridiculous example - depending on the swith in line 15 the truck attributes consideration is disabled but only within Germany and Luxemburg:
Depending on the boolean parameter in line 15 the TruckAttributes are ignored or not
Here's a ridiculous example - depending on the swith in line 15 the truck attributes consideration is disabled but only within Germany and Luxemburg:
Code: Select all
{
"requestProfile":{
"featureLayerProfile":{
"themes":[
{
"id": "PTV_TruckAttributes",
"enabled":true,
"countrySpecificParameters":[
{
"id":"DE,LU",
"enabled":true,
"rules":[
{
"id":"ALL",
"enabled":false
}
]
}
]
}
]
}
},
"waypoints": [
{
"$type": "OffRoadWaypoint",
"location": {
"offRoadCoordinate": {
"x": 6.22029,
"y": 49.61513
}
}
},
{
"$type": "OffRoadWaypoint",
"location": {
"offRoadCoordinate": {
"x": 6.06479,
"y": 49.62127
}
}
}
],
"resultFields": {
"eventTypes": [
"MANEUVER_EVENT"
],
"polyline": true
}
}