collectiveidea / graticule

Graticule is a geocoding API for looking up address coordinates and performing distance calculations, supporting many popular APIs.

This URL has Read+Write access

brandon (author)
Fri Apr 17 13:33:48 -0700 2009
commit  2cb7e6c1b4d272c048f05dce508dc26564429c09
tree    02c6279ef534c72e1c852930232a9f3bddd95ee5
parent  501eace7dc6232d9a6c631648daa647baf4ae2c1
graticule / README.txt
100644 29 lines (18 sloc) 1.052 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
= Graticule
 
Graticule is a geocoding API for looking up address coordinates. It supports many popular APIs, including Yahoo, Google, Geocoder.ca, Geocoder.us, PostcodeAnywhere and MetaCarta.
 
= 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
 
= Source
 
The source code for Graticule is available at http://github.com/collectiveidea/graticule. Patches and bug reports are welcome at http://collectiveidea.lighthouseapp.com/projects/20262-graticule