RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

vladimirivic — 1 posts

Project links: Github | Rubygems

The functionality that the gem gives us is to lookup addresses, zip codes, cities and coordinates in the simplest way possible.

Geocoding is the process of finding associated geographic coordinates (often expressed as latitude and longitude) from other geographic data, such as street addresses, or ZIP codes (postal codes).
~ Wikipedia: Geocoding

Example 1, lookup a city:
'Los Angeles'.geocoding_lookup
=> [{:address=>"Los Angeles, CA, USA", :lat=>34.0522342, :lng=>-118.2436849, :types=>["locality", "political"]}]

Example 2, lookup by latitude and longitude:
[35.68, 139.76].geocoding_lookup.last
=> {:address=>"Japan", :lat=>36.204824, :lng=>138.252924, :types=>["country", "political"]}

Download: GeocodingLite at Github | GeocodingLite at Rubygems