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.
i have a problem to calculate the toll distance per country. I get toll events in france from type "PASS" in the xserver response. These events don't have a relatedEventIndex or a "EXIT" event. So i don't have the chance to calculate the distance.
Here is my code snippet in PHP from which i use:
With this snippet i get 88.6km toll distance in france. But in real it must be around 152km. Can anybody help me to get a functional calculation based on the attached response?
The missing distance is for the section "FONTAINE-LARIVIERE" and the opposite direction, right? The distance for this section by the provider (not in our data, but from https://voyage.aprr.fr/sites/default/fi ... r_2023.pdf) is 33.2 km.
The workaround that you can do is to sum up the distances of all consecutive segments that have the flag toll=true before and after the PASS event which should be all segments that are rendered as toll road in the following screenshot. If you do that you should get at least about 44 km more of toll distance as indicated by the second screenshot. That's the best you can do at the moment.
However, if you implement that you should also consider special cases like two consecutive PASS events where all segments in between have the toll flag (I found such situations for example in Florida).
The toll flag at the segments is not vehicle dependent. So it is not necessarily correct to always sum up the distances of all segments where the toll flag is set. For example it is possible that you have to pay toll for a truck but not for a car. Then the toll distance for the car would be too high.
sounds like it would be a good idea to add proper output KPIs in a future API version
Thanks for the hint!
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...
SPOILER ALERT - this feature is about to come in V2.30...
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...