SixArm.com » Ruby Gem » GeocodeAddress using Google Maps API to get location, latitude, longitude, etc.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.codeclimate/badges
doc
lib
test
.codeclimate.yml
.document
.gemtest
.gitattributes
.gitignore
.rspec
.travis.yml
CHANGES.md
CONTRIBUTING.md
LICENSE.md
README.md
Rakefile
VERSION
sixarm_ruby_geocode_address-1.0.0-sha512.txt
sixarm_ruby_geocode_address-1.0.0.gem
sixarm_ruby_geocode_address-1.0.5.gem
sixarm_ruby_geocode_address.gemspec

README.md

SixArm.com → Ruby →
GeocodeAddress gem to connect to Google Maps API

Introduction

GeocodeAddress uses the Google Maps API to geocode an address string to a JSON result.

The address will cache as much as possible as it initializes and calls the Google Maps API.

For docs go to http://sixarm.com/sixarm_ruby_geocode_address/doc

Want to help? We're happy to get pull requests.

Install

To install using a Gemfile, add this:

gem "sixarm_ruby_geocode_address", ">= 1.0.5", "< 2"

To install using the command line, run this:

gem install sixarm_ruby_geocode_address -v ">= 1.0.5, < 2"

To install using the command line with high security, run this:

wget http://sixarm.com/sixarm.pem
gem cert --add sixarm.pem && gem sources --add http://sixarm.com
gem install sixarm_ruby_geocode_address -v ">= 1.0.5, < 2" --trust-policy HighSecurity

To require the gem in your code:

require "sixarm_ruby_geocode_address"

Examples

address = GeocodeAddress.new("1 Main St, San Francisco, CA 94111") address.href #=> "http://maps.googleapis.com/maps/api/geocode/json?address=1+Main+St,+San+Francisco,+CA+94111&sensor=false" address.get #=> ...calls the Google Maps API via Net::HTTP and returns a JSON-formatted string of results address.json #=> ...calls the Google Maps API via Net::HTTP and returns a JSON parse of results address.location #=> {"lat" => 37.7931108, "lng" => -122.3964898} address.lat #=> 37.7931108 address.lng #=> -122.3964898