Google::Geo

A simple, elegant library for getting geocoding information from Google Maps. Very much inspired by the google-geocode gem, but completely dependency free!

Examples

geo = Google::Geo.new API_KEY

address = geo.locate '1600 Amphitheatre Parkway, Mountain View, CA'

address.country      # 'US'
address.city         # 'Mountain View'
address.full_address # '1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA'

address.query        # '1600 Amphitheatre Parkway, Mountain View, CA'
address.accuracy     # 8

In the case of sufficiently vague queries, Google::Geo will return an Array:

addresses = geo.locate 'hell'

addresses.size                  # 2
addresses.map { |a| a.country } # ['US', 'NO']

Contributors

Seth Thomas Rasmussen - sethrasmussen.com - [email protected]