Page 1 of 1
Highway Kilometers per country from waypoint to waypoint
Posted: Thu Nov 28, 2024 7:05 am
by martinmctx
Hello.
How can I use the PTV Developer API to determine the toll highway kilometers per country from waypoint to waypoint?
Thanks in advance for your help.
Best regards,
Martin
Re: Highway Kilometers per country from waypoint to waypoint
Posted: Thu Nov 28, 2024 10:11 am
by Bernd Welter
Hi Martin,
thanks for that question - The detailed report you'd like to generate is not an "out of the box" response element in Developer Routing API.
I forwarded your question to DEV & Product Management for a comment and also created a feature request.
To anyone who wants such a feature, too: Please describe the benefit for a user if he has access to such a report. I can then add the info to the story.
My statement about the API itself:
The required elements might be spread over toll events,
- waypoint events / border events / toll events (structure of legs, bordercrossings...)
- toll sections (distances...)
but I doubt that all the current references between the arrays are sufficient to create the desired report.
Bernd
Re: Highway Kilometers per country from waypoint to waypoint
Posted: Thu Nov 28, 2024 4:02 pm
by Bernd Welter
Wow - here comes a very detailed response from our experts!
#BestTeamEver
Thanks!
- You're correct that there is no toll distance report on route level or leg level. And there is no toll distance report that distinguishes road types or toll types.
- I have a question about the term "highway". What does to the customer mean by that? Is it to distinct general toll roads from special tolls like bridges, tunnels and city toll? Highway may refer to different roads in different countries. So in order to build what the customer needs, a clarification is required.
- A report of toll distances per leg and country is possible to derive solely from the events. As you suggested, by requesting waypoint events, border events toll events, you are perfectly able to aggregate for each leg the toll distance in the countries of these legs. You can simply add and subtract the value of the field distanceFromStart of the different events according to some business logic. With the waypoint and border events you memorize to which country and leg to add the distanceFromStart. If it's an EXIT toll event, you add it and if it's an ENTER toll event you subtract it.
- Note that waypoint events can occur in between a pair of toll events. In such cases, you should add the distanceFromStart of the waypoint event for the current leg and subtract it for the next leg.
- Note that border events will never occur in between a pair of toll events (if so, that would be a bug).
- This does not yet distinguish the different toll road types. For that, you would indeed request the toll sections and add up the reported section distances per toll road type. But the basic logic to iterate over the events to decide to which leg and country the values of the toll sections should be added to, can be reused.
- For an actual distinction between highway and not highway, API extensions are necessary.
Please provide as much information about the use cases and specific requirements as you can.
Afaik someone asked for a distiction between
- German Autobahns (I guess that was meant by "highways", Martin?)
- German Federal Roads aka Bundesstraße
If that is relevant for you let us know why... so far we do not see a benefit of that detail level (also discussed it with some colleagues from subsidiaries).