There seems to be quite a plethora of Ruby/Rails libraries appearing aiming to simplify handling geography and distances. In some cases these libraries do quite distinct things (zip codes vs. longitude/latitude, map output vs. distance calculations) but they’re frequently lumped together and it’s difficult to tell which will be best to use in your projects.
I’ve used several of these projects and have previously blogged about YM4R and acts_as_locateable, but I’m still not sure which I’d pick for new projects. So I thought it would be helpful to try to put together a comparison of which libraries offer what functionality. Here I’ll just offer a quick chart, but I’m hoping to write them up in a bit more detail over the coming days/weeks. If there’s sufficient interest, I’d consider moving this out to a wiki for more general use.
| Auto-geocoding ActiveRecord models | Multi-provider geo-coding | Distance based finds | Distance based :through finds | Google map output | Yahoo map output | |
|---|---|---|---|---|---|---|
| GeoKit (plugin index) |
Y | Y | Y | N | N | N |
|
acts_as_geocodable ( plugin index) |
Y | Y* | Y | N | N | N |
|
acts_as_geocode (plugin index) |
Website currently down | |||||
|
actsaslocateable (plugin index) |
N | N | Y | Y | N | N |
|
YM4R (plugin index) |
N | N | N | N | Y | Y |
(* through companion gem)
Also worth mentioning are SpatialAdapter and GeoRuby (from the same developer as YM4R) which respectively provide ActiveRecord support for MySql Spatial and PostGIS geometric columns, and ruby data types for that information.
A recent addition is this Ruby library for the Geonames API which provides a nice way to interface with the GeoNames database of 2.2 million populated places. Properly harnessed, that service begins to make it possible to allow your users to describe their location in natural language and convert that into machine-parseable co-ordinates.
Update (8th March): Updated versions of this comparison will now appear on the foss4r wiki

Comparing rails geo-plugins…
[Source: a work on process] quoted: There seems to be quite a plethora of Ruby/Rails libraries appearing aiming to simplify handling geography and distances. In some cases these libraries do quite distinct things (zip codes vs. …
Trackback by Geotags.org — 6 March 2007 @ 6:38 am
[...] a work on process » Comparing rails geo-plugins There seems to be quite a plethora of Ruby/Rails libraries appearing aiming to simplify handling geography and distances. In some cases these libraries do quite distinct things (zip codes vs. longitude/latitude, map output vs. distance calculations) but t (tags: programming ruby rubyonrails geo) [...]
Pingback by High Earth Orbit » Blog Archive » links for 2007-03-06 — 6 March 2007 @ 4:36 pm
[...] http://jystewart.net/process/2007/03/comparing-rails-geo-plugins/ [...]
Pingback by ror blog » Blog Archive » [Rails] Re: how to calculate the distance/radius on zipcodes? — 12 September 2007 @ 8:03 am
[...] http://jystewart.net/process/2007/03/comparing-rails-geo-plugins/ [...]
Pingback by GSIY … Ruby-Rails Portal — 12 September 2007 @ 8:41 am
great list!
just what i was looking for thanks!
you do know it is overlapping the right column? its a little hard to read, so no biggie. im on a mac firefox 3
Comment by taelor — 17 July 2008 @ 8:37 pm
taelor - glad it’s helpful.
Yeah, I’m aware that the layout isn’t ideal, and I think the wiki where this was living has now died. I’m hoping to do another run through shortly and find a better home for the updated comparison.
Comment by James Stewart — 18 July 2008 @ 12:58 pm