xServer 2 - Swiss toll missing

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.
Andreas Schönebeck
Posts: 15
Joined: Fri Jul 09, 2021 3:11 pm

xServer 2 - Swiss toll missing

Post by Andreas Schönebeck »

When we calculate the toll for the route of a car in the old MapServer, so-called extra toll and named toll is calculated for Switzerland (standard toll is empty).

When calculating the route with xServer 2, no toll is returned at all for Switzerland. We set ResultFields.Toll to { Enabled = true, Sections = true, Systems = true }, but Toll.Summary/Sections/Systems are returned empty.

Is xServer 2 not supporting the mentioned additional tolls or are we missing certain route options?
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xServer 2 - Swiss toll missing

Post by Bernd Welter »

Hello Andreas,
please provide your complete request to me 1:1 (bernd.welter@ptvgroup.com).
I get toll for SUISSE immediately for my 40t truck profile on xServer Internet 2.
Bernd
Attachments
Lausanne - Luzern - Sankt Gallen
Lausanne - Luzern - Sankt Gallen
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:
Andreas Schönebeck
Posts: 15
Joined: Fri Jul 09, 2021 3:11 pm

Re: xServer 2 - Swiss toll missing

Post by Andreas Schönebeck »

Hello Bernd,

thank you very much for your response. Unfortunately, our problem is not about a 40t Truck. We get standard toll costs for that.

It is about a PKW and the extra tolls which were calculated in MapServer, and are now missing in xServer 2.

Code: Select all

{
  "$type":"RouteRequest",
  "waypoints":[
    {
      "$type":"OffRoadWaypoint",
      "location":{
        "$type":"OffRoadRouteLocation",
        "offRoadCoordinate":{
          "x":7.5878101004,
          "y":47.548801472
        }
      },
      "tourStopOptions":{
        "serviceTime":0.0
      },
      "name":"0"
    },
    {
      "$type":"OffRoadWaypoint",
      "location":{
        "$type":"OffRoadRouteLocation",
        "offRoadCoordinate":{
          "x":9.1817798897,
          "y":45.467960378
        }
      },
      "tourStopOptions":{
        "serviceTime":0.0
      },
      "name":"1"
    }
  ],
  "routeOptions":{
    "timeConsideration":{
      "$type":"ExactTimeConsiderationAtStart"
    },
    "geographicRestrictions":{
      "allowedCountries":[
        
      ],
      "prohibitedCountries":[
        
      ]
    },
    "emissionOptions":{
      "valueScenarios":[
        {
          "$type":"EmissionValueScenario_HBEFA_3_2",
          "scenarios":[
            "CURRENT_ROUTE"
          ]
        }
      ]
    },
    "currency":"EUR"
  },
  "resultFields":{
    "waypoints":true,
    "legs":{
      "enabled":true
    },
    "segments":{
      "enabled":true,
      "descriptors":true,
      "roadAttributes":true,
      "id":true
    },
    "eventTypes":[
      "COUNTRY_EVENT",
      "TOLL_EVENT",
      "ROUTE_VIOLATION_EVENT"
    ],
    "polyline":true,
    "toll":{
      "enabled":true,
      "sections":true,
      "systems":true
    },
    "emissions":true,
    "encodedPath":true
  },
  "requestProfile":{
    "vehicleProfile":{
      "engine":{
        "cylinderCapacity":1500,
        "fuelType":"GASOLINE",
        "fuelConsumption":6.0,
        "particleFilterInstalled":false,
        "emissionStandardEU":"EURO_6",
        "lowEmissionZoneTypes":"DE_GREEN"
      },
      "weight":{
        "emptyWeight":1200.0,
        "loadWeight":200.0,
        "totalPermittedWeight":2000.0
      },
      "dimensions":{
        "height":160.0,
        "heightAboveFrontAxle":100.0,
        "length":425.0,
        "width":175.0
      },
      "legalCondition":{
        "isEmergency":false,
        "isDelivery":false
      },
      "load":{
        "loadType":"PASSENGER"
      },
      "speeds":{
        "speedRangesByNetworkClass":{
          "maximumSpeeds":[
            135.0,
            125.0,
            85.0,
            60.0,
            50.0,
            40.0,
            16.0,
            6.0
          ],
          "minimumSpeeds":[
            70.0,
            35.0,
            25.0,
            25.0,
            20.0,
            18.0,
            9.0,
            4.0
          ]
        },
        "maximumSpeed":150.0
      },
      "yearOfManufacture":2019,
      "numberOfPassengers":2,
      "numberOfTrailers":0
    },
    "featureLayerProfile":{
      "themes":[
        {
          "id":"PTV_TruckAttributes",
          "enabled":false
        },
        {
          "id":"PTV_TruckSpeedPatterns",
          "enabled":false
        },
        {
          "id":"PTV_TrafficIncidents",
          "enabled":false
        }
      ]
    },
    "routingProfile":{
      "linking":{
        "maximumDistanceToSegment":10000.0
      },
      "course":{
        "violations":{
          "enabled":true
        },
        "network":{
          
        },
        "toll":{
          
        },
        "specialAreas":{
          
        },
        "combinedTransport":{
          "boatPenalty":0,
          "railPenalty":0
        },
        "distanceTimeWeighting":90.0
      }
    }
  },
  "coordinateFormat":"EPSG:4326"
}
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xServer 2 - Swiss toll missing

Post by Bernd Welter »

Hi Andreas,

I guess we have to distinguish between TOLL and VIGNETTE.
Toll applies on a distance base whenever you drive on a road. If you drive the road several times, this will increase the costs - no matter what time horizont was used.
Vignette is something different: this applies within a time horizon (a day, a week, a year...) and your driver either has a vignette or not.

This is described in the article Basics: differences between toll and vignette

Does this explain the missing output?

Bernd

PS: We currently evaluate how to modell Vignettes in xServer2
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:
Joost
Posts: 307
Joined: Fri Apr 25, 2014 1:46 pm

Re: xServer 2 - Swiss toll missing

Post by Joost »

My mapserver knowledge is a but rusty but IIRC what is mentioned here as extra toll would be the charges for tunnels/birdges/ferries/mountain passes that would be charged apart from regular toll or vingette. After a quick glance I'm not seeing any section in the example given that should contain these type of charges. If you do want an example of such a road try the Sankt Bernhard Tunnel.

Code: Select all

{
  "waypoints": [
    {
      "$type": "OffRoadWaypoint",
      "location":
      {
        "offRoadCoordinate":
        {
          "x": 7.187461853027345,
          "y": 45.991952783990875
        }
      }
    },
    {
      "$type": "OffRoadWaypoint",
      "location":
      {
        "offRoadCoordinate":
        {
          "x": 7.189178466796876,
          "y": 45.82329671534156
        }
      }
    }
  ],
  "resultFields":
  {
    "toll":
    {
      "enabled": true,
      "sections": true,
      "systems": true
    },
    "eventTypes": ["TOLL_EVENT"]
  },
  "routeOptions":
  {
    "timeConsideration":
    {
      "$type": "SnapshotTimeConsideration",
      "referenceTime": "2021-11-18T12:50:56"
    }
  },
  "storedProfile": "car"
}

Code: Select all

{
  "$type": "RouteResponse",
  "distance": 27640,
  "travelTime": 1441.448,
  "toll": {
    "summary": {
      "costs": [
        {
          "amount": 29.5,
          "currency": "CHF"
        }
      ],
      "countries": [
        {
          "country": "CH",
          "cost": {
            "amount": 29.5,
            "currency": "CHF"
          }
        }
      ]
    },
    "sections": [
      {
        "cost": {
          "amount": 29.5,
          "currency": "CHF",
          "paymentMethods": [
            "CASH"
          ]
        },
        "tollRoadType": "TUNNEL",
        "country": "CH",
        "tollSystemIndex": 0,
        "displayName": "Sankt Bernhard Tunnel"
      }
    ],
    "systems": [
      {
        "name": "Sankt Bernhard Tunnel",
        "operatorName": "SISEX SA",
        "tariffVersion": "2021 rate",
        "tariffVersionValidFrom": "2020-08-01T00:00:00.000Z"
      }
    ]
  },
  "violated": false
}
Joost Claessen
Senior Technical Consultant
PTV Benelux
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xServer 2 - Swiss toll missing

Post by Bernd Welter »

Cheers,

objects such as
- tunnels
- bridges
- mountain passes
are treated as "toll": You have to pay for them each time you drive through them.
Attention: some objects toll depends on time of passage. And for time dependent toll you have to apply a TimeConsideration Mode.
Without such a mode contributions of such objects will be omitted ;-)

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:
Andreas Schönebeck
Posts: 15
Joined: Fri Jul 09, 2021 3:11 pm

Re: xServer 2 - Swiss toll missing

Post by Andreas Schönebeck »

Many thanks to all,

I can confirm that the toll for example Saint Bernard Tunnel is calculated for cars in our case. I will ask the customer if maybe the vignette calculation is missing. Was this vignette calculation perhaps included in the MapServer and is no longer shown by xServer2?
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xServer 2 - Swiss toll missing

Post by Bernd Welter »

We used to have "vignette information" in xServer1 but not with tarrifs - only as a boolean flag on segments.
Afaik we evaluate how to implement this in the new APIs.

I'll forward this to DEV.

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:
Andreas Schönebeck
Posts: 15
Joined: Fri Jul 09, 2021 3:11 pm

Re: xServer 2 - Swiss toll missing

Post by Andreas Schönebeck »

Unfortunately, our customer informed us, that the toll information is still not calculated. Now after a diagnose session with them we could isolate the cause: If we activate the truck attribute layer, the toll for St. Bernhard Tunnel is not calculated. If the truck attribute layer is deactivated it is calculated successfully.

What could be the reason for this? We expected that the toll is calculated regardless of the activation of the truck attribute layer.

Code: Select all

...
    "featureLayerProfile":{
      "themes":[
        {
          "id":"PTV_TruckAttributes",
          "enabled":false                         <-- If set to true, toll calculation fails
        },
...
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xServer 2 - Swiss toll missing

Post by Bernd Welter »

I just played this request on https://xserver2-europe-eu-test.cloud.p ... Runner.htm
No matter whether TruckAttributes have been enabled/disdabled: I get toll for the Sankt Bernhard.
How did you test this?

Code: Select all

{
  "waypoints": [
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 7.187461853027345,
          "y": 45.991952783990875
        }
      }
    },
    {
      "$type": "OffRoadWaypoint",
      "location": {
        "offRoadCoordinate": {
          "x": 7.189178466796876,
          "y": 45.82329671534156
        }
      }
    }
  ],
  "resultFields": {
    "toll": {
      "enabled": true,
      "sections": true,
      "systems": true
    },
    "eventTypes": [
      "TOLL_EVENT"
    ]
  },
  "routeOptions": {
    "timeConsideration": {
      "$type": "SnapshotTimeConsideration",
      "referenceTime": "2021-11-18T12:50:56"
    }
  },
  "storedProfile": "car",
  "requestProfile": {
    "featureLayerProfile": {
      "themes": [
        {
          "id": "PTV_TruckAttributes",
          "enabled": true
        }
      ]
    }
  }
}
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