I’ve created a plugin that will help you implement radius-based
location searches from a zip code or city/state. This plugin is based
on work I did for WalkingBoss (http://walkingboss.org).
This plugin includes everything you need to get started, including free
zip code data (about 45,000 zips and city/states), and a fully
functional ZipCodeSearchExampleController with a view.
Here are the quick installation instructions:
ruby script/plugin install
svn://rubyforge.org/var/svn/zipcodesearch/trunk
ruby script/generate zip_code_search ZipCode
rake migrate # This will take a long time!
ruby script/server
Then visit: http://localhost:3000/zip_code_search_example/index to see
the example controller in action.
See http://zipcodesearch.rubyforge.org/ for more info.
I’d like to thank Thomas Kurek, who posted the WGS-84 datum
approximation code (in C#) on which this plugin is based (see:
Methods for a location proximity search using GPS (WGS-84) mathematics - CodeProject).
Enjoy!
-Doug Fales
http://guod.net
http://walkingboss.org
[Sorry if this posts twice–I tried the Google G. interface earlier
and that didn’t seem to work.]