Google geocoding API ColdFusion

coldfusion geocodeOkay, that title was a mouthful, but I wanted to accurately describe how decided to Geocode thousands of locations for a client of mine.

Google, awesome as they are, have offered a ridiculously simple API to consume:

theaddress&sensor=false

But, they naturally have rate limits, and even if they didn't, I'd feel more comfortable using their API responsibly. It is completely free after all.

So, I decided to write a ColdFusion script which does the following:

  1. Pulls a single location record from a database
  2. Sends the address from the record to the Google API
  3. If the API returns a result, store it in the database
  4. Otherwise, indicate that geocoding failed, so we don't attempt to geocode this record again.

Since we're only doing one record at a time, we'll have to set this up to run automatically at a specified interval. This is where the JavaScript part comes in.

I could have setup a cron job without much effort, but knowing me, I'd forget to remove it once geocoding is complete. So, I decided to open up my web browsers console, and drop in the following:

setInterval(function {
$.ajax({
url: ' ',
success: function(data) {
console.log(data); }, 35000);

The 35 second interval is enough to comply with Google's 2, 500 query/day limit. The ColdFusion script follows below:

SELECT id, address
FROM locations

You might also like
Creating google maps with API V3
Creating google maps with API V3
Google Maps Geocoding Process for SugarCRM
Google Maps Geocoding Process for SugarCRM
google map api v3 codeigniter 01
google map api v3 codeigniter 01

Doyle Park...just up the street from my

by bikeriderdude

Office on Sonoma Avenue (towards Farmer's Lane).
Be great if you can bring a kid. We'll talk before then, but I'm pretty sure I can get my whole family to come.

7 Game of Thrones Apps That Will Get You Through the Much-awaited Winter  — Gizmodo India
.. or Winterfell, you get a dialog box, which asks you to buy more maps. Unfortunately, you can't dismiss the dialogue box, leading to the obstruction of the cartography. ..

Flagstaff's rocky lava field became a little piece of the moon  — azcentral
If American know-how could put a man on the moon, the man should bring back rocks to study. The government agreed, and in 1963, the .. Volcanoes were chosen because of the moon's volcanic history, the test site for its impact craters.

O'Reilly Media Google Maps Hacks
Book (O'Reilly Media)
  • Used Book in Good Condition

Missing in Alaska without a trace  — Anchorage Daily News
The official version of events, according to a still active missing person's bulletin from the Alaska State Troopers is that Griffis went into the wild "to test out a survival 'cocoon' that he had invented.

No Starch Press Map Scripting 101: An Example-Driven Guide to Building Interactive Maps with Bing, Yahoo!, and Google Maps
eBooks (No Starch Press)
Wrox Professional Android 2 Application Development
Book (Wrox)
Garmin Garmin nuvi 880 4.3-Inch Widescreen Bluetooth Portable GPS Navigator
GPS or Navigation System (Garmin)
  • Sleek, ultra-slim design fits in a pocket; High-sensitivity GPS receiver for fast satellite lock
  • Pre-loaded with City Navigtor NT maps for North America, including more than 6-million name-searchable points of interest
  • Speech recognition -- speak menu options and keep your eyes on the road
  • Multi-destination routing -- enter several destinations and get the best route to all of them; Where am I? and Where s my car? features
  • Full feature set -- text to speech for spoken directions with real street names; MP3 player, and Photo viewer
Related Posts