Is there a service that will give me the driving distance between two addresses? Apparently Google Maps API requires you to display a map, which I don't want to do (on that particular page), and I'd like to just snag the data and save it to my DB after a user submits a form, rather than waiting for JS to do it's thing.
If it's relevant, this is going into a Django app. I discovered that CloudMade offers a Python API, which is nice, except their latest dev release has a bug in it (can't use the API object), but more importantly, it's support for Canada is awful (couldn't find directions from any major city around here!).
It is designed to work on both mobile devices as well as traditional desktop browser applications. The API includes language localization for over 50 languages, region localization and geocoding, and has mechanisms for enterprise developers who want to utilize the Google Maps API within an intranet.
The Distance Matrix API uses a pay-as-you-go pricing model.
The API returns information based on the recommended route between start and end points. You can request distance data for different travel modes, request distance data in different units such kilometers or miles, and estimate travel time in traffic.
MapQuest's Directions API is HTTP Querystring based (I'm not sure if it's entirely RESTful). Can get XML or JSON response. Just need to send it an HTTP GET Request.
http://developer.mapquest.com/web/products/open/directions-service
Use the "distance" response parameter.
I don't have a high enough reputation on SO to comment on an answer but I just wanted to be clear that contrary to the voted correct answer, Google Directions API has to adhere to the Google Maps API. If you scroll down the supplied link, you will see:
Note: the Directions API may only be used in conjunction with displaying results on a Google map; using Directions data without displaying a map for which directions data was requested is prohibited. Additionally, calculation of directions generates copyrights and warnings which must be displayed to the user in some fashion. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With