Page 1 of 1

Routing by ferry on xServer v2

Posted: Tue Sep 29, 2020 9:58 am
by Dobos Ionut
Hello,

I've stumbled upon an issue that I'm not quite sure what is the best approach to resolve. We are using xServer2 and we are calculating a route that we would like to be partially done by ferry (~200km total), but the server goes the long way around the water (~600 km).

This is my request:

Code: Select all

POST "https://xserver2.cloud.ptvgroup.com/services/rs/XRoute/experimental/calculateRoute"
{
  "resultFields": {
    "polyline": true,
    "legs": {
      "enabled": true,
      "polyline": false,
      "tollSummary": true
    },
    "toll": {
      "enabled": true,
      "sections": true,
      "systems": true
    },
    "eventTypes": [
      "TOLL_EVENT",
      "COUNTRY_EVENT",
      "ROUTE_VIOLATION_EVENT"
    ],
    "segments": {
      "enabled": true,
      "polyline": true,
      "featureThemeIds": [
        "PTV_SpeedPatterns",
        "PTV_TrafficIncidents"
      ]
    }
  },
  "geometryOptions": {
    "responseGeometryTypes": [
      "PLAIN"
    ]
  },
  "routeOptions": {
    "tollOptions": {
      "useDetailedToll": true
    },
    "timeConsideration": {
      "$type": "ExactTimeConsiderationAtStart",
      "referenceTime": "2020-09-28T14:06:10+00:00"
    }
  },
  "requestProfile": {
    "featureLayerProfile": {
      "themes": [
        {
          "id": "PTV_SpeedPatterns",
          "enabled": true
        },
        {
          "id": "PTV_TrafficIncidents",
          "enabled": true
        }
      ]
    },
    "routingProfile": {
      "course": {
        "toll": {
          "tollPenalty": 0
        },
        "distanceTimeWeighting": 90
      }
    },
    "vehicleProfile": {
      "electronicTollCollectionSubscriptions": "NONE",
      "engine": {
        "emissionTechnology": "SELECTIVE_CATALYTIC_REDUCTION",
        "emissionStandardEU": "EURO_EEV"
      },
      "axle": {
        "axleLoad": 15,
        "numberOfAxles": 5
      },
      "dimensions": {
        "height": "380",
        "heightAboveFrontAxle": 2.9,
        "length": "1362",
        "width": "255"
      },
      "weight": {
        "emptyWeight": 18,
        "loadWeight": 40
      }
    },
    "currency": "EUR"
  },
  "coordinateFormat": "EPSG:4326",
  "waypoints": [
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 10.881190312,
          "y": 56.413471194
        }
      }
    },
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 12.857498132,
          "y": 56.672267934
        }
      }
    },
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 12.249170269,
          "y": 57.107879628
        }
      }
    }
  ]
}
What I tried:
- I tried playing around with the distanceTimeWeighting parameter but we can't really go anywhere lower than 83 (because it has other business implications) and we observed that only in the low 70's it chooses the ferry route.
- I tried setting waypoints at the start and end of the ferry and it still goes the long way around

From what I found in the documentation, there's a "Combined transport" type of waypoint that would basically force the routing by ferry, but I can only find it in the v1 documentation. Is there a similar solution for v2 or could you give me an idea as to how to resolve this without altering the distance/time weighting or a way to set the weighting by leg without requiring multiple requests?

Thank you,
John

Re: Routing by ferry on xServer v2

Posted: Tue Sep 29, 2020 10:48 am
by Bernd Welter
Hi John,

how about the CombinedTransport Parameter?

By Default it is set to 100 but you could set it to
  • 0 to define "I do not punish ferries
  • values below 0 to push ferries (if this desireable)
different values of CombinedTransport.BoatPenalty (-50 / 0 / 50 / 100)
different values of CombinedTransport.BoatPenalty (-50 / 0 / 50 / 100)
Best regards,
Bernd

Re: Routing by ferry on xServer v2

Posted: Tue Sep 29, 2020 11:11 am
by Dobos Ionut
Hello Bernd,

That looks (and works) perfectly and I somehow missed it in the documentation.

Thank you,
John

Re: Routing by ferry on xServer v2

Posted: Tue Sep 29, 2020 1:10 pm
by Bernd Welter
PS:
your sample request applies PTV_SpeedPatterns - this is valid for a CAR.
For a truck you would have to refer to PTV_TruckSpeedPatterns (=historical speed information for TRUCKs) .
Furthermore I assume you want us to consider PTV_TruckAttributes (=legal restrictions which ensure that e.g. dimensions of a vehicle are matching the road network)