How to apply a rule in a routing request? (xRoute2)

This forum deals with any kind of routing computation whether it is simple A:B-routing, calculation of isochrones, simple matrix computation or nearest search.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to apply a rule in a routing request? (xRoute2)

Post by Bernd Welter »

Today a colleague asked me for a sample request that demonstrates how to activate a rule as mentioned in PTV_TruckAttributes.Rules:
rules.png

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
  }
}
Depending on the boolean parameter in line 15 the TruckAttributes are ignored or not ;-)
Attachments
rule in LU,DE enabled - detours
rule in LU,DE enabled - detours
rule in LU,DE disabled  - no detours
rule in LU,DE disabled - no detours
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply