Hi Jakub,
( samples in C# )
this is a brilliant usecase for the high performance routing. For this you need a proper routing profile which supports HIGH_PERFORMANCE_ROUTING:
If you work with the cloud services you can gather the profiles through XData2.listHighPerformanceRoutingNetworks:
Code: Select all
HighPerformanceRoutingNetworksListResponse res = svcData.listHighPerformanceRoutingNetworks(new ListHighPerformanceRoutingNetworksRequest()
{
resultFields = new ListHighPerformanceRoutingNetworksResultFields() {
profilesSpecified = true,
profiles = true,
highPerformanceRoutingNetworkOptionsSpecified = true,
highPerformanceRoutingNetworkOptions = true
}
}) ;
Then apply this to the xDima2.dimaRequest and its requestProfile. Ensure to set proper values for the distanceMatrixOptions, too. This refers to RoutingType.HIGH_PERFORMANCE_ROUTING but also to the
DistanceMatrixOptions.geographicRestrictions
DistanceMatrixOptions.timeConsideration
DistanceMatrixOptions.contentSnapshotId
Look at this:
Code: Select all
CreateDistanceMatrixRequest dimaRequest = new CreateDistanceMatrixRequest()
{
startLocations = dictLocation.Values.Select(l => l.routeLocation).ToArray(),
distanceMatrixOptions = new DistanceMatrixOptions()
{
routingTypeSpecified = true,
routingType = RoutingType.HIGH_PERFORMANCE_ROUTING,
},
requestProfile = info.highPerformanceRoutingNetworkDescription.profile
};
if (info.highPerformanceRoutingNetworkDescription != null)
{
dimaRequest.distanceMatrixOptions.geographicRestrictions = info.highPerformanceRoutingNetworkDescription?.highPerformanceRoutingNetworkOptions?.geographicRestrictions;
dimaRequest.distanceMatrixOptions.timeConsideration = info.highPerformanceRoutingNetworkDescription?.highPerformanceRoutingNetworkOptions?.timeConsideration;
dimaRequest.distanceMatrixOptions.contentSnapshotId = info.highPerformanceRoutingNetworkDescription?.highPerformanceRoutingNetworkOptions?.contentSnapshotId;
}
Attention:
you can't create own searchgraphs in the cloud.
If you work on premise you might need xData.startCreateHighPerformanceRoutingNetwork.
Best regards,
Bernd