How to add a ROLA to the routing?

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
Uta Jäger-Frenk
Posts: 5
Joined: Mon Jun 13, 2022 9:56 am

How to add a ROLA to the routing?

Post 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?
Uta Jäger-Frenk
Support Specialist at PTV Logistics - Germany

Happy to help the products PTV Developer, PTV xServer, PTV Navigator G1 and G2
Maximilian Vogel
Posts: 14
Joined: Fri Dec 29, 2017 9:00 am

Re: How to add a ROLA to the routing?

Post 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
Maximilian Vogel
Developer
PTV Logistics
User avatar
Bernd Welter
Site Admin
Posts: 2664
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to add a ROLA to the routing?

Post 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.
Attachments
brenner-xroute2.png
brenner-routingApi.png
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