views:

90

answers:

1

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

+1  A: 

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.

SylanderXS