0.0
No commit activity in last 3 years
No release in over 3 years
Simple Geocoder
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.7.3
 Project Readme

simple_geocoder¶ ↑

Simple Ruby interface to the Google Geocoding Service API V3 code.google.com/apis/maps/documentation/geocoding/

  • returns results in parsed JSON format

  • API configuration in config/api.yml

Examples¶ ↑

require 'rubygems'
require 'simple_geocoder'
result = SimpleGeocoder::Geocoder.new.geocode('2000 28th St, Boulder, CO')
puts result['results'][0]['geometry']['location'].inspect # => {"lat"=> 40.0185510,"lng"=> -105.2582644}

Accepts optional parameters as a hash, keyed by parameter name symbols. Optional parameters include: bounds, region, language, sensor. Default region is ‘us’. Default sensor value is ‘false’

Example for region parameter:

result =  SimpleGeocoder::Geocoder.new.geocode("Toledo",{:region=>'es'})

returns location for Toledo, Spain.

Example for bounds (viewport biasing):

result =  SimpleGeocoder::Geocoder.new.geocode("Winnetka", { :bounds => "34.172684,-118.604794|34.236144,-118.500938" } )

Returns location for Winnetka in California instead of Illinois.

Requirements¶ ↑

Copyright © 2010, 2011, 2012 Ying Tsen Hong. See LICENSE for details