Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toll Charges for Google Maps?

I'm writing an application that will calculate the distance and cost between two points. One of the requirements is that I need to calculate the cost of the journey (gas and road tolls). Gas is easy. However, I can't think of a good way of doing toll charges. Google tells me if the GStep has a toll but it doesn't say how much. It seems like there is no central authority that publishes toll rates (this is for western europe). Anyone has experience dealing with this problem, and how did you solve it?

-- Pavel

like image 299
Pavel Avatar asked May 21 '10 13:05

Pavel


1 Answers

There is "no" clean way to do this. We tried it a few years ago and had to go to the toll services for the rates. This is difficult to do because many toll roads (at least in the US) have varying tolls depending on how long you've traveled on the road and the rates aren't linear. In the end we used a "best guess" method of figuring them out. Some toll services provide API's to the data (REST, etc) but most just give you the data on a web page and leave you to decide whether you want to keep them updated manually or attempt to screen-scrape. We ended up just providing a link for users to let us know if toll rates change and update them manually when they do. The solution isn't ideal but still works... mostly.

like image 128
SylanderXS Avatar answered Oct 21 '22 06:10

SylanderXS