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.
- 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 } } ] }