Geocoding Addresses & Calculating Time/Distance with Google Maps APIs

This is mostly for my own personal reference…

To convert between addresses and latitude/longitude, it’s pretty easy to use the Google Maps Geocoding API. A pretty simple concatenation of either an address or a lat/long will get you the result you want in either JSON or XML.

Say you have a bunch of addresses and you want to quickly calculate distance and travel time between all of them. Well, that is super duper simple with the Google Maps Distance Matrix API. It’s pretty easy to configure to obtain driving calculation where tolls, freeways, or ferries are avoided, and you can configure it for whatever unit or language you need as well. It also allows queries for transit, walking, and bicycling. Just plug in a bunch of addresses, and get back all the data you’d need for a mileage and time table in JSON or XML.

Both of these APIs are likely to require API keys when deployed.

Leave a Reply

Your email address will not be published. Required fields are marked *