Andy Milk Interactive

Web site design and application development
  • rss
  • Home
  • About
  • Portfolio
  • Clients
  • Skills and Services
  • Edge and Approach
  • PR & Comm
  • Contact

Geocoding, a must-have for social networking apps

andymilk | December 23, 2008

I just started working on the “Find a Friend” portion of a social networking project, and I realized that I’ll need to filter users by their locations.  I’ve integrated geocoding on apps before and performed basic lookups of cities and states using Google & Yahoo’s APIs.  I’ve banged out the calculations needed to find zip codes within a certain radius of another zip code.  This is my first time integrating geocoding into a Rails application and, to my delight and lack of surprise, someone has already built a plug-in that handles geocoding.

It’s called Geokit and you can find it here:  http://geokit.rubyforge.org

It can do a lot.  All you need is to add “lat” and “lng” float columns to the table that you need geocoding on.  Install the gem & plug-in and it’s a SNAP after that.  You can find the distance between two points, you can auto-geocode a location on the creation of an object, you can find all the objects within a certain distance radius.  This last piece of functionality is what I needed.

So in about 90 minutes, I was able to find Geokit, install it, retrofit my tables with lat and lng, auto-geocode my objects on create, and implement a “Find a Friend” lookup.  Similiar to Facebook, I want users who search for other users to find nearby users first, before searching the whole database of users.  For the most part, it’s a sort by distance and then search term.

One of the slickest details of Geokit is its use of multiple geocoding sources.  Here it is straight from their project page:  Geocoding from multiple providers. It currently supports Google, Yahoo, Geocoder.us, Genames, 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.

Nicely done.

Categories
Tools
Comments rss
Comments rss
Trackback
Trackback

« Drum roll please… Take the opportunity to check your periodic service providers »

Leave a Reply

Click here to cancel reply.

About this Site

Andy Milk is a web software designer, developer, and consultant located in the Boston, MA area. This site showcases his portfolio and approach to design and development.

Phone: 617-290-8559
Email: andymilk@gmail.com

Other sites:
LinkedIn
Twitter
WorkingWithRails.com
Rock and Run

Hosting

- Blue Box Group
- MediaTemple

Post Topics

  • Good stuff
  • Partners
  • Projects
  • Techniques
  • Tools
  • Uncategorized

Partners

Elastic Communications
Anthony Caffiero
Ruth Lague
Ridge Marketing
Christopher Fannon Multimedia Design
Caroset Media
DesignSite
PixelSlam
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox

© 2009 Andy Milk Interactive, LLC