Displaying articles with tag

Graticule: Geocoding on Rails

Posted by hardwarehank, Fri Jan 26 11:30:17 UTC 2007

I’ve been using Graticule for geocoding in a Rails project at work, and I decided I needed to make some changes. So, I turned the Graticule gem into a plugin. It’s available here:


./script/plugin install -x https://modzer0.cs.uaf.edu/repos/hank/code/ruby/graticule_plugin

It’s as simple as that. Then just jam this into your environment and change it accordingly:


GEOCODERS = [
  Graticule.service(:google).new('google_key'),
  Graticule.service(:yahoo).new('yahoo_key'),
  Graticule::GeocoderUsGeocoder.new,
  Graticule::MetaCartaGeocoder.new
]

Then you can just perform looping on GEOCODERS to do your queries on every site. There’s also some other changes you can do to catch Graticule::AddressError, but I won’t go into those here.

Tags: