Routing by ferry on xServer v2

This forum deals with any kind of routing computation whether it is simple A:B-routing, calculation of isochrones, simple matrix computation or nearest search.
Post Reply
Dobos Ionut
Posts: 25
Joined: Tue Dec 03, 2019 11:27 am

Routing by ferry on xServer v2

Post 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
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Routing by ferry on xServer v2

Post 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
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:
Dobos Ionut
Posts: 25
Joined: Tue Dec 03, 2019 11:27 am

Re: Routing by ferry on xServer v2

Post by Dobos Ionut »

Hello Bernd,

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

Thank you,
John
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Routing by ferry on xServer v2

Post 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)
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