Dima Routing returns "EstimatedByDirectDistance": why?

deals with computation of distance matrices
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Dima Routing returns "EstimatedByDirectDistance": why?

Post by Bernd Welter »

Sometimes a DIMA calculation returns "estimatedByDirectDistance" for some relations though the involved waypoint coordinates are located in trivial areas (no critical truck attributes or pedestrian zones). Here's an example that explains some side effects - maybe some of you can benefit from this post.

The example is quite minimalistic (2² matrix) and I applied some manual SearchSpaceBounds.
Within the given  rectangle there's no route found: to get from the area north of the Adria to the southern part of italy within the rectangle it would require a ferry - I've restricted the rect for this example to an area which does exclude the ferries near Dubrovnik
Within the given rectangle there's no route found: to get from the area north of the Adria to the southern part of italy within the rectangle it would require a ferry - I've restricted the rect for this example to an area which does exclude the ferries near Dubrovnik
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      }
    }
  ]
}
The response is

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
    ]
  }
}
So as you can see the relations A:B and B:A are estimatedByDirectDistance.

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.
Sidenote:
  • 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".
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:
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Dima Routing returns "EstimatedByDirectDistance": why?

Post by Bernd Welter »

By the way - this topic also may touch further restrictions such as Effectively those restrictions will be applied through super positioning...
Attachments
ferries in the are between Italy and the south eastern european countries
ferries in the are between Italy and the south eastern european countries
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