Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Graticule is a geocoding API for looking up address coordinates and performing distance calculations, supporting many popular APIs.
Branch: master
Pull request Compare This branch is 94 commits behind collectiveidea:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
site
test
.autotest
.gitignore
CHANGELOG.txt
Gemfile
Gemfile.lock
LICENSE.txt
README.textile
Rakefile
graticule.gemspec

README.textile

Graticule

Graticule is a geocoding API for looking up address coordinates. It supports many popular APIs, including Yahoo, Google, Geocoder.ca and Geocoder.us.

Usage

require 'rubygems'
require 'graticule'
geocoder = Graticule.service(:google).new "api_key"
location = geocoder.locate "61 East 9th Street, Holland, MI"

Distance Calculation

Graticule includes 3 different distance formulas, Spherical (simplest but least accurate), Vincenty (most accurate and most complicated), and Haversine (somewhere inbetween).

geocoder.locate("Holland, MI").distance_to(geocoder.locate("Chicago, IL"))
#=> 101.997458788177

Command Line

Graticule includes a command line interface (CLI).

$ geocode -s yahoo -a yahookey Washington, DC
Washington, DC US
latitude: 38.895222, longitude: -77.036758

Mailing List

Join us on the mailing list.

How to contribute

If you find what you might think is a bug:

  1. Check the GitHub issue tracker to see if anyone else has had the same issue.
  2. If you don’t see anything, create an issue with information on how to reproduce it.

If you want to contribute an enhancement or a fix:

  1. Fork the project on GitHub.
  2. Make your changes with tests.
  3. Commit the changes without making changes to the Rakefile, VERSION, or any other files that aren’t related to your enhancement or fix
  4. Send a pull request.
Something went wrong with that request. Please try again.