The example is quite minimalistic (2² matrix) and I applied some manual SearchSpaceBounds. XDima2.CreateAndGetDistanceMatrixRequest:
Code: Select all
{
"$type": "CreateAndGetDistanceMatrixRequest",
"distanceMatrixOptions":{
"geographicRestrictions":{
"searchSpaceBounds":{
"restrictionMode":"CUSTOM",
"customBounds":{
"minX" :15.0, "maxX" :18.0, "minY" : 39.0, "maxY" : 50.0
}
}
}
},
"resultFields": {
"distances": true, "travelTimes": true, "violated": true, "estimatedByDirectDistance": true
},
"startLocations": [
{
"$type": "OffRoadRouteLocation",
"offRoadCoordinate": { "x": 15.334595, "y": 47.170803 }
},
{
"$type": "OffRoadRouteLocation",
"offRoadCoordinate": { "x": 17.174305, "y": 40.877792 }
}
]
}
Code: Select all
{
"$type": "DistanceMatrixResponse", "summary": {
"numberOfStartLocations": 2, "numberOfDestinationLocations": 2,
"percentageOfDirectDistanceRelations": 50, "routingType": "CONVENTIONAL"
},
"contents": {
"$type": "DistanceMatrixContentsArrays",
"distances": [
0, 986731, 986731, 0
],
"travelTimes": [
0, 59203.852, 59203.852, 0
],
"violated": [
false, false, false, false
],
"estimatedByDirectDistance": [
false, true, true, false
]
}
}
To get rid of this there are several strategies:
- Enlarge the custom rectangle
- Add an additional waypoint in the desired area such as "near Milano" which would also have an impact on performance (but better to have a successful routing compared to no one).
- Switch to HPR which does not apply the rectangle limitation.
- Routing means to consider many options at the same time, e.g. the example above would also occur with a larger rectangle if the usage of ferries is set to "forbidden".