Andre Lewis has been hard at work writing our new sister book Beginning Google Maps with RAILS and Ajax. It’s due back from the printers in about a week, so on the eve of its release he has also released GeoKit for Rails along with Bill Eisenhauer. Bill also has a few examples on his site. Check them out.
From the site:
Geokit is a Rails plugin for building location-based apps. It provides geocoding, location finders, and distance calculation in one cohesive package. If you have any tables with latitude/longitude columns in your database, or if you every wanted to easily query for “all the stores within a 50 mile radius,” then GeoKit is for you.
What can GeoKit do for you?
- Distance calculations between two points on the earth. Calculate the distance in miles or KM, with all the trigonometry abstracted away by GeoKit.
- ActiveRecord distance-based finders. For example, you can find all the points in your database within a 50-mile radius.
- Geocoding from multiple providers. It currently supports Google, Yahoo, Geocoder.us, and Geocoder.ca geocoders, and it provides a uniform response structure from all of them. It also provides a fail-over mechanism, in case your input fails to geocode in one service.
- IP-based location lookup utilizing hostip.info. Provide an IP address, and get city name and latitude/longitude in return.
- A before_filter helper to geocode the user’s location based on IP address, and retain the location in a cookie.
If this is interesting to you consider helping us get the word out for Andre and Bill by digging the announcement for them.
Keep an eye out for a chance to win a copy of his new book in the next few days and be the first in your local RUG to get it!