public
Fork of collectiveidea/graticule
Description: Graticule is a geocoding API for looking up address coordinates and performing distance calculations, supporting many popular APIs.
Homepage: http://graticule.rubyforge.org/
Clone URL: git://github.com/tomtaylor/graticule.git
Added some more detailed precision information for a geocoding response.
tomtaylor (author)
Fri Oct 03 02:42:39 -0700 2008
commit  05862decf8cb2f56f59cc5e8744ccc9559d09b2e
tree    7e8c37b5df51cd42334a1c6a9663000b9b615ff8
parent  28994f79c7465a462018da50743237e97d4604cf
...
5
6
7
 
 
 
 
8
9
10
11
12
 
 
 
 
 
13
14
15
 
 
 
 
 
 
 
16
17
18
19
20
 
 
21
22
23
...
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
30
31
32
33
34
35
36
37
0
@@ -5,19 +5,33 @@ module Graticule #:nodoc:
0
     
0
     class Multimap < Rest
0
       
0
+ # This precision information is not complete.
0
+ # More details should be implemented from:
0
+ # http://www.multimap.com/share/documentation/clientzone/gqcodes.htm
0
+
0
       PRECISION = {
0
- "4"=> :country,
0
- "3" => :state,
0
- "2" => :city,
0
- "2" => :zip,
0
+ "6"=> :country,
0
+ "5" => :state,
0
+ "4" => :postal_code,
0
+ "3" => :city,
0
+ "2" => :street,
0
         "1" => :address
0
       }
0
       
0
+ # Web services initializer.
0
+ #
0
+ # The +api_key+ is the Open API key that uniquely identifies your
0
+ # application.
0
+ #
0
+ # See http://www.multimap.com/openapi/
0
+
0
       def initialize(api_key)
0
         @api_key = api_key
0
         @url = URI.parse "http://clients.multimap.com/API/geocode/1.2/#{@api_key}"
0
       end
0
       
0
+ # Returns a location for an address in the form of a String, Hash or Location.
0
+
0
       def locate(address)
0
         location = address.is_a?(String) ? address : location_from_params(address)
0
         case location

Comments

    No one has commented yet.