Sample Workflow DIMA calculation with HPR

Data which is used in a more general manner can be requested by xData service. Therefore this data is not provided by one of the other functional services, but concentrated in an own independent service.
Attention: this is not the platform for the data itself. If you have questions about missing data or the handling of binary maps please look at Data and Content.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2860
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Sample Workflow DIMA calculation with HPR

Post by Bernd Welter »

From time to time new users encounter performance issues with the distance matrix calculation not knowing that PTV's routing experts developer an extremely fast mechanism which enables you to compute even large matrices within seconds. You may have heard of High-performance Routing

I therefore decided to provide a sequence of sample requests which could help to understand the necessary steps:
  • You first need to pre-process the search graph with specific options such as
    • a stored profile
    • a scope
    • some geographic restrictions (e.g. "allowedCountries")
  • Each routing request (wether its a dima request or a simple a:b routing) which should use the created HPR via RoutingMode.HIGH_PERFORMANCE_ROUTING or RoutingMode.HIGH_PERFORMANCE_ROUTING_WITH_FALLBACK_CONVENTIONAL has to apply the same routing options that have been used during the creation of the graph. This also includes the geographic restrictions.
Now here's the example:
  • A searchgraph for the Luxemburg area, applies the FeatureLayer PTV_TruckAttributes and uses a standard profile "trucktrailer". I also applied a simple scope called "samplerequest":

    Code: Select all

    {
      "label": "hello searchgraph",
      "scope": "samplerequest",
      "storedProfile": "trailertruck",
      "requestProfile": {
        "featureLayerProfile": {
          "themes": [
            {
              "id": "PTV_TruckAttributes",
              "enabled": true
            }
          ]
        }
      },
      "highPerformanceRoutingNetworkOptions": {
        "geographicRestrictions": {
          "allowedCountries": [
            "LU"
          ]
        }
      }
    }
  • A Dima request:

    Code: Select all

    {
      "scope":"samplerequest",  
      "$type": "CreateAndGetDistanceMatrixRequest",
      "distanceMatrixOptions":{
        "routingType": "HIGH_PERFORMANCE_ROUTING",
        "geographicRestrictions":
        {
          "allowedCountries": [
            "LU"
          ]
        }
      },
      "storedProfile":"trailertruck",
      "requestProfile":{
        "featureLayerProfile": {
          "themes": [
            {
              "id": "PTV_TruckAttributes",
              "enabled": true
            }
          ]
        }
      },
      "resultFields": {
        "distances": true,
        "travelTimes": true,
        "violated": true,
        "estimatedByDirectDistance": true
      },
      "startLocations": [
        {
          "$type": "OffRoadRouteLocation",
          "offRoadCoordinate": {
            "x": 6.22029,
            "y": 49.61513
          }
        },
        {
          "$type": "OffRoadRouteLocation",
          "offRoadCoordinate": {
            "x": 6.1029,
            "y": 49.6432
          }
        }
      ]
    }
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