Page 1 of 1

How to add a ROLA to the routing?

Posted: Wed Aug 28, 2024 9:23 am
by Uta Jäger-Frenk
Hey all together,

maybe someone could give me a good hint how to use a specific ROLA within a route calculation?
E.g. Wörgl-Brennero?

Re: How to add a ROLA to the routing?

Posted: Wed Aug 28, 2024 9:35 am
by Maximilian Vogel
The Data API offers the possibility to search for available combined transports, try this sample:
https://developer.myptv.com/en/document ... transports
Here's an excerpt when searching for "Rola":

Code: Select all

{
      "polyline": "{\"type\":\"LineString\",\"coordinates\":[[...]]}",
      "name": "Rola Wörgl-Brenner", "duration": 18082, "type": "RAIL",
      "start": {
        "latitude": 47.482539082, "longitude": 12.033915862, "name": "Wörgl", "countryCode": "AT"
      },
      "destination": {
        "latitude": 46.103613833, "longitude": 11.096358212, "name": "Trento", "countryCode": "IT"
      },
      "allowedFor": "VAN,TRUCK",
      "waypointsParameter": "combinedTransport=47.482539082,12.033915862,46.103613833,11.096358212"
    }
If you find the connection you desire you can use them as a combined transport waypoint in the Routing API where you specify the start and destination coordinates of the combined transport.

The response even contains the string how it needs to be specified as query parameter in the Routing API:

Code: Select all

combinedTransport=47.482539082,12.033915862,46.103613833,11.096358212

Re: How to add a ROLA to the routing?

Posted: Wed Aug 28, 2024 9:51 am
by Bernd Welter
Hello Uta,

the ROLA (=Rollende Landstraße) is s so-called combined transport, in this case a piggyback:
  • Therefore you may have to ensure that piggybacks are allowed (or even preferred) in the routing.
  • A side effect of Combined Transports is their contribution to the travel distance: "0 meters" because you are not driving. To push towards Combined Transports you may therefore consider to use the routing to go for "shortest" instead of "fastest".
  • If the comined transport you expect isn't chosen by the API automatically you may have to add a dedicated Waypoint type to your station list.
APIPTV xServer2 / xRoute2PTV Developer Routing API
Consider piggybackcom.ptvgroup.xserver.routingprofile.CombinedTransport.railPenaltyRoutingAPI.Options.avoid (you can block but not prefer them)
Waypoint propertiescom.ptvgroup.xserver.xroute.CombinedTransportViaWaypointConcept "CombinedTransports"
Where to get relevant properties?com.ptvgroup.xserver.xdata.SegmentsRequestDataAPI.getCombinedTransports()
Sample "Waypoints"

Code: Select all

[
    {
      "location": {
        "coordinate": {"x": 12.0934615394355,          "y": 47.5166958885238}
      },      "name": "OnRoadWaypoint[0]"
    },
    {
      "combinedTransportId": "SEGM0002...[..]",
      "name": "CombinedTransportViaWaypoint[1]"
    },
    {
      "location": {
        "coordinate": {"x": 11.1250001009574,          "y": 46.0564023668508}
      },      "name": "OnRoadWaypoint[2]"
    }
  ]

Code: Select all

  "waypoints": [
    "47.5166958885238,12.0934615394355",
    "combinedTransport=47.482539082,12.033915862,46.103613833,11.096358212",
    "46.0564023668508,11.1250001009574"
  ],
AttentionSegment IDs change from map version to map version.