Request HPR driven routings / matrices in xServer2 Internet

Proper forum for all questions related to xServer INTERNET = the Azure based cloud solution. This forum deals with the architecture topics such as load balancing, available profiles and standard server settings.
Please be aware that questions about core functionality such as routing, mapping, geocoding in general should be placed in the xServers dedicated forum ;-)
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Request HPR driven routings / matrices in xServer2 Internet

Post by Bernd Welter »

Hi there,

I recently faced several players who wanted to compute distance matrices / routings in xServer Internet 2 (test / prod) as quick as possible and who therefore parametrized their calls with the routing mode with an insufficient request like this one:

Code: Select all

{
  "startLocations": [
   .... 
  ],
  "destinationLocations": [],
  "storedProfile": "car",
  "distanceMatrixOptions": {
    "routingType": "HIGH_PERFORMANCE_ROUTING_WITH_FALLBACK_CONVENTIONAL"
  }
}
These players relied on the com.ptvgroup.xserver.routing.RoutingType to ensure the HPR usage. :!: But: in fact this is not sufficient!

Please take some time to understand the following mechanism:
  • Using that routing type tells the engine to look for a matching search graph: If the search is successful, the routing applies the HPR. If the search fails, the engine performs a fallback to CONVENTIONAL routing which is compareably slow.
  • Now many users are aware that we have standard graphs, e.g. for a car profile.
  • But what you need to understand is that ALL routing options have to match the graph and when we offer a "ZZ-EUR car with truck attributes" graph this means that the request above would need two inserts:
    • The feature layer theme PTV_TruckAttributes has to be added and enabled.
    • The geographic restriction to ZZ-EUR needs to be added.
So the following request returns a HPR based result and performance:

Code: Select all

{
  "startLocations": [
   .... 
  ],
  "destinationLocations": [],
  "storedProfile": "car",
  "requestProfile":{
     "featureLayerProfile":
        {   
           "themes":[
             {
                "id":"PTV_TruckAttributes",
                "enabled": true
             }
           ]
        }
  },
  "distanceMatrixOptions": {
    "routingType": "HIGH_PERFORMANCE_ROUTING_WITH_FALLBACK_CONVENTIONAL",
       "geographicRestrictions":{
          "allowedCountries": ["ZZ-EUR"]
    }
  }
}
Also check this article about Standard Search Graphs

Bernd
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