ktulasi
Joined: 21 Oct 2009 Posts: 59
|
Posted: Sat May 29, 2010 7:20 am Post subject: Concept of geocoding in rails |
|
|
Google Maps with the local search, there's a new geocoding plugin for RubyOnRails: http://geokit.rubyforge.org/
It a cool feature set, allowing us to do very easy geocode lookups and distance calculation
for eg
Code:
dist1 = GeoKit::Geocoders::GoogleGeocoder.geocode("Nyros technologies,Kakinada")
dist2=GeoKit::Geocoders::GoogleGeocoder.geocode("main road,kakinada")
distance = dist1.distance_from(dist2, :units => :kms)
And then,add a "lat" and "lng" column to th database (and get the correct values of course),
we can go for searching like the way
Code:
@addresses = Address.find(:all, :origin => "4light junction", :conditions => "distance < 10")
So cool. |
|