graticule 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. data/.autotest +13 -0
  2. data/.gitignore +10 -0
  3. data/.travis.yml +14 -0
  4. data/CHANGELOG.txt +4 -1
  5. data/Gemfile +7 -0
  6. data/LICENSE.txt +1 -1
  7. data/README.md +122 -0
  8. data/Rakefile +78 -0
  9. data/graticule.gemspec +26 -0
  10. data/lib/graticule/cli.rb +3 -1
  11. data/lib/graticule/geocoder/google.rb +33 -4
  12. data/lib/graticule/geocoder/mapquest.rb +52 -59
  13. data/lib/graticule/precision.rb +3 -1
  14. data/lib/graticule/version.rb +1 -1
  15. data/site/index.html +114 -0
  16. data/site/plugin.html +82 -0
  17. data/site/stylesheets/style.css +69 -0
  18. data/test/config.yml.default +33 -0
  19. data/test/fixtures/responses/freethepostcode/not_found.txt +3 -0
  20. data/test/fixtures/responses/freethepostcode/success.txt +2 -0
  21. data/test/fixtures/responses/geocoder_ca/success.xml +12 -0
  22. data/test/fixtures/responses/geocoder_us/success.xml +8 -0
  23. data/test/fixtures/responses/geocoder_us/unknown.xml +1 -0
  24. data/test/fixtures/responses/geonames/missing.xml +4 -0
  25. data/test/fixtures/responses/geonames/success.xml +14 -0
  26. data/test/fixtures/responses/geonames/unknown.xml +4 -0
  27. data/test/fixtures/responses/google/address.json +64 -0
  28. data/test/fixtures/responses/google/badkey.json +4 -0
  29. data/test/fixtures/responses/google/country.json +43 -0
  30. data/test/fixtures/responses/google/limit.json +4 -0
  31. data/test/fixtures/responses/google/locality.json +58 -0
  32. data/test/fixtures/responses/google/region.json +48 -0
  33. data/test/fixtures/responses/google/server_error.json +4 -0
  34. data/test/fixtures/responses/google/street.json +58 -0
  35. data/test/fixtures/responses/google/success.json +64 -0
  36. data/test/fixtures/responses/google/success_multiple_results.json +68 -0
  37. data/test/fixtures/responses/google/zero_results.json +4 -0
  38. data/test/fixtures/responses/host_ip/private.txt +4 -0
  39. data/test/fixtures/responses/host_ip/success.txt +4 -0
  40. data/test/fixtures/responses/host_ip/unknown.txt +4 -0
  41. data/test/fixtures/responses/local_search_maps/empty.txt +1 -0
  42. data/test/fixtures/responses/local_search_maps/not_found.txt +1 -0
  43. data/test/fixtures/responses/local_search_maps/success.txt +1 -0
  44. data/test/fixtures/responses/mapquest/multi_result.xml +317 -0
  45. data/test/fixtures/responses/mapquest/success.xml +54 -0
  46. data/test/fixtures/responses/multimap/missing_params.xml +4 -0
  47. data/test/fixtures/responses/multimap/no_matches.xml +4 -0
  48. data/test/fixtures/responses/multimap/success.xml +19 -0
  49. data/test/fixtures/responses/simple_geo/error.json +4 -0
  50. data/test/fixtures/responses/simple_geo/success.json +255 -0
  51. data/test/fixtures/responses/yahoo/success.xml +3 -0
  52. data/test/fixtures/responses/yahoo/unknown_address.xml +6 -0
  53. data/test/fixtures/responses/yandex/badkey.xml +5 -0
  54. data/test/fixtures/responses/yandex/success.xml +204 -0
  55. data/test/graticule/distance_test.rb +59 -0
  56. data/test/graticule/geocoder/freethepostcode_test.rb +37 -0
  57. data/test/graticule/geocoder/geocoder_ca_test.rb +42 -0
  58. data/test/graticule/geocoder/geocoder_us_test.rb +44 -0
  59. data/test/graticule/geocoder/geocoders.rb +56 -0
  60. data/test/graticule/geocoder/geonames_test.rb +56 -0
  61. data/test/graticule/geocoder/google_signed_test.rb +19 -0
  62. data/test/graticule/geocoder/google_test.rb +138 -0
  63. data/test/graticule/geocoder/host_ip_test.rb +41 -0
  64. data/test/graticule/geocoder/local_search_maps_test.rb +31 -0
  65. data/test/graticule/geocoder/mapquest_test.rb +56 -0
  66. data/test/graticule/geocoder/multi_test.rb +52 -0
  67. data/test/graticule/geocoder/multimap_test.rb +53 -0
  68. data/test/graticule/geocoder/simple_geo_test.rb +45 -0
  69. data/test/graticule/geocoder/yahoo_test.rb +50 -0
  70. data/test/graticule/geocoder/yandex_test.rb +42 -0
  71. data/test/graticule/geocoder_test.rb +24 -0
  72. data/test/graticule/location_test.rb +79 -0
  73. data/test/graticule/precision_test.rb +38 -0
  74. data/test/mocks/uri.rb +53 -0
  75. data/test/test_helper.rb +32 -0
  76. metadata +147 -75
  77. data/README.textile +0 -64
@@ -7,6 +7,7 @@ module Graticule
7
7
  attr_reader :name
8
8
 
9
9
  NAMES = [
10
+ :point,
10
11
  :unknown,
11
12
  :country,
12
13
  :region,
@@ -23,6 +24,7 @@ module Graticule
23
24
  end
24
25
 
25
26
  Unknown = Precision.new(:unknown)
27
+ Point = Precision.new(:point)
26
28
  Country = Precision.new(:country)
27
29
  Region = Precision.new(:region)
28
30
  Locality = Precision.new(:locality)
@@ -44,4 +46,4 @@ module Graticule
44
46
  (self <=> other) == 0
45
47
  end
46
48
  end
47
- end
49
+ end
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module Graticule
3
- VERSION = '2.3.0' unless defined?(::Graticule::VERSION)
3
+ VERSION = '2.4.0' unless defined?(::Graticule::VERSION)
4
4
  end
@@ -0,0 +1,114 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+ <title>Graticule</title>
8
+ <link rel="stylesheet" type="text/css" href="http://opensoul.org/stylesheets/code.css" />
9
+ <link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
10
+ <link href="http://opensoul.org/stylesheets/ci.css" rel="stylesheet" type="text/css" />
11
+ <script src="http://opensoul.org/javascripts/code_highlighter.js" type="text/javascript"></script>
12
+ <script src="http://opensoul.org/javascripts/ruby.js" type="text/javascript"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div id="collectiveidea">
17
+ <a href="http://collectiveidea.com"><img src="http://opensoul.org/images/header_logo.gif" alt="Collective Idea" class="logo" width="17" height="22" /></a>
18
+ <ul class="links">
19
+ <li><a href="http://daniel.collectiveidea.com/blog">Daniel</a></li>
20
+ <li><a href="http://opensoul.org">Brandon</a></li>
21
+ <li class="name"><a href="http://collectiveidea.com"><img src="http://opensoul.org/images/header_collectiveidea.gif" alt="Collective Idea" width="123" height="21" /></a></li>
22
+ </ul>
23
+ </div>
24
+ <div id="main">
25
+ <div id="header">
26
+ <h1><a href="/">Graticule</a></h1>
27
+ <ul id="nav">
28
+ <li><a href="graticule">API Docs</a></li>
29
+ <li><a href="plugin.html">Rails Plugin</a></li>
30
+ <li><a href="http://rubyforge.org/projects/graticule">RubyForge</a></li>
31
+ <li><a href="http://opensoul.org/tags/geocoding">Blog</a></li>
32
+ </ul>
33
+ </div>
34
+ <div id="content">
35
+ <dl lang="en" xml:lang="en">
36
+ <dt><strong>grat·i·cule</strong>, <span class="pronunciation">|ˈgratəˌkyoōl|</span>,
37
+ <em><abbr title="noun">n.</abbr></em>
38
+ <span class="description">technical</span>
39
+ </dt>
40
+ <dd><em>Navigation.</em> a network of parallels and meridians on a map or chart.</dd>
41
+ </dl>
42
+
43
+ <p>Graticule is a geocoding API for looking up address coordinates and performing distance calculations. It supports many popular APIs, including:</p>
44
+
45
+ <ul>
46
+ <li>Yahoo</li>
47
+ <li>Google</li>
48
+ <li>Geocoder.ca</li>
49
+ <li>Geocoder.us</li>
50
+ <li>PostcodeAnywhere</li>
51
+ <li>MetaCarta</li>
52
+ </ul>
53
+
54
+ <p>There is a <a href="plugin.html">companion Rails plugin</a> that makes geocoding seem like magic.</p>
55
+
56
+ <h2>Example</h2>
57
+
58
+ <pre><code class="ruby">require 'rubygems'
59
+ require 'graticule'
60
+ geocoder = Graticule.service(:google).new "api_key"
61
+ location = geocoder.locate "1600 Amphitheatre Parkway, Mountain View, CA"
62
+ location.coordinates #=> [37.423021, -122.083739]
63
+ location.country #=> "US"</code></pre>
64
+
65
+ <p>See the <a href="graticule">API documentation</a> for more details.</p>
66
+
67
+ <h2>International Support</h2>
68
+
69
+ <p>Graticule supports several services with international support. The international geocoders require slightly more structured data than the US ones:</p>
70
+
71
+ <pre><code class="ruby">g = Graticule.service(:local_search_maps).new
72
+ location = g.locate :street => '48 Leicester Square', :locality => 'London', :country => 'UK'
73
+ location.coordinates #=> [51.510036, -0.130427]</code></pre>
74
+
75
+ <h2>Distance Calculation</h2>
76
+
77
+ <p>Graticule includes 3 different distance formulas, Spherical (simplest but least accurate), Vincenty (most accurate and most complicated), and Haversine (somewhere inbetween).</p>
78
+
79
+ <pre><code class="ruby">location = geocoder.locate("Holland, MI")
80
+ location.distance_to(geocoder.locate("Chicago, IL"))
81
+ #=> 101.997458788177</code></pre>
82
+
83
+ <h2>Command Line</h2>
84
+ <p>Graticule also includes a command line interface to the various geocoders:</p>
85
+
86
+ <pre>
87
+ $ geocode -s yahoo -a yahookey Washington, DC
88
+ Washington, DC US
89
+ latitude: 38.895222, longitude: -77.036758</pre>
90
+
91
+ <h2>Installation</h2>
92
+
93
+ <p>Install the gem by executing:</p>
94
+
95
+ <pre>gem install graticule</pre>
96
+
97
+ <p>Or, download it from <a href="http://rubyforge.org/frs/?group_id=2643">RubyForge</a>.</p>
98
+
99
+ <h2>Contributing</h2>
100
+
101
+ <p>Contributions are welcome and appreciated! Join the <a href="http://rubyforge.org/mailman/listinfo/graticule-users">mailing list</a> and grab the source from:</p>
102
+
103
+ <pre>http://source.collectiveidea.com/public/geocode/trunk/</pre>
104
+ </div>
105
+ </div>
106
+
107
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
108
+ </script>
109
+ <script type="text/javascript">
110
+ _uacct = "UA-194397-7";
111
+ urchinTracker();
112
+ </script>
113
+ </body>
114
+ </html>
@@ -0,0 +1,82 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+ <title>acts_as_geocodable - Graticule</title>
8
+ <link rel="stylesheet" type="text/css" href="http://opensoul.org/stylesheets/code.css" />
9
+ <link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
10
+ <link href="http://opensoul.org/stylesheets/ci.css" rel="stylesheet" type="text/css" />
11
+ <script src="http://opensoul.org/javascripts/code_highlighter.js" type="text/javascript"></script>
12
+ <script src="http://opensoul.org/javascripts/ruby.js" type="text/javascript"></script>
13
+ </head>
14
+
15
+ <body>
16
+ <div id="collectiveidea">
17
+ <a href="http://collectiveidea.com"><img src="http://opensoul.org/images/header_logo.gif" alt="Collective Idea" class="logo" width="17" height="22" /></a>
18
+ <ul class="links">
19
+ <li><a href="http://daniel.collectiveidea.com/blog">Daniel</a></li>
20
+ <li><a href="http://opensoul.org">Brandon</a></li>
21
+ <li class="name"><a href="http://collectiveidea.com"><img src="http://opensoul.org/images/header_collectiveidea.gif" alt="Collective Idea" width="123" height="21" /></a></li>
22
+ </ul>
23
+ </div>
24
+ <div id="main">
25
+ <div id="header">
26
+ <h1><a href="/">Graticule</a> » acts_as_geocodable</h1>
27
+ <ul id="nav">
28
+ <li><a href="acts_as_geocodable">API Docs</a></li>
29
+ <li><a href="plugin.html">Rails Plugin</a></li>
30
+ <li><a href="http://rubyforge.org/projects/graticule">RubyForge</a></li>
31
+ <li><a href="http://opensoul.org/tags/geocoding">Blog</a></li>
32
+ </ul>
33
+ </div>
34
+ <div id="content">
35
+ <p>acts_as_geocodable is a Rails plugin that makes your applications geo-aware. A picture (er, example) is worth a thousand words:</p>
36
+
37
+ <h2>Examples</h2>
38
+
39
+ <pre><code class="ruby">event = Event.create :street =&gt; &quot;777 NE Martin Luther King, Jr. Blvd.&quot;,
40
+ :locality =&gt; &quot;Portland&quot;, :region =&gt; &quot;Oregon&quot;, :postal_code =&gt; 97232
41
+
42
+ # how far am I from RailsConf 2007?
43
+ event.distance_to &quot;49423&quot; #=&gt; 1807.66560483205
44
+
45
+ # Find our new event, and any other ones in the area
46
+ Event.find(:all, :within =&gt; 50, :origin =&gt; &quot;97232&quot;)
47
+
48
+ # Find the nearest restaurant with beer
49
+ Restaurant.find(:nearest, :origin =&gt; event, :conditions =&gt; 'beer = true')</code></pre>
50
+
51
+
52
+ <p>See the <a href="acts_as_geocodable">API documentation</a> for more details.</p>
53
+
54
+ <h2>IP-based geocoding</h2>
55
+
56
+ <p>acts_as_geocodable adds a <code>remote_location</code> method to your Rails controllers for retrieving a user's location based on their remote IP address.</p>
57
+
58
+ <pre><code class="ruby">@nearest_store = Store.find(:nearest, :origin =&gt; remote_location) if remote_location</code></pre>
59
+
60
+ <p>Don't rely too heavily on remote_location because the location of many IP addresses cannot be determined through <a href="http://hostip.info">HostIP</a>.
61
+
62
+ <h2>Installation</h2>
63
+
64
+ <p>Install the plugin by executing:</p>
65
+
66
+ <pre>script/plugin install -x http://source.collectiveidea.com/public/rails/plugins/acts_as_geocodable</pre>
67
+
68
+ <h2>Contributing</h2>
69
+
70
+ <p>Contributions are welcome and appreciated! Grab the source from:</p>
71
+
72
+ <pre>http://source.collectiveidea.com/public/rails/plugins/acts_as_geocodable</pre>
73
+ </div>
74
+ </div>
75
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
76
+ </script>
77
+ <script type="text/javascript">
78
+ _uacct = "UA-194397-7";
79
+ urchinTracker();
80
+ </script>
81
+ </body>
82
+ </html>
@@ -0,0 +1,69 @@
1
+ body {
2
+ font-family: "Lucida Grande", Helvetica, Arial, sans-serif;
3
+ font-size: 76%;
4
+ background: #2A2A2A;
5
+ margin: 0;
6
+ padding: 0;
7
+ }
8
+
9
+ #collectiveidea {
10
+ border-bottom: 1px solid #444;
11
+ }
12
+
13
+ a {
14
+ color: #2D5385;
15
+ }
16
+
17
+ #main {
18
+ background-color: #FFF;
19
+ width: 700px;
20
+ margin: 0 auto;
21
+ border: 5px #CCC;
22
+ border-left-style: solid;
23
+ border-right-style: solid;
24
+ padding: 0 1em;
25
+ }
26
+
27
+ #header {
28
+ position: relative;
29
+ }
30
+
31
+ #header h1 {
32
+ margin: 0;
33
+ padding: 0.5em 0;
34
+ color: #2D5385;
35
+ border-bottom: 1px solid #999;
36
+ }
37
+
38
+ #header h1 a {
39
+ text-decoration: none;
40
+ }
41
+
42
+ #nav {
43
+ list-style: none;
44
+ position: absolute;
45
+ right: 0;
46
+ top: 0.6em;
47
+ }
48
+ #nav li {
49
+ display: inline;
50
+ padding: 0 0.5em;
51
+ }
52
+
53
+ #content {
54
+ padding: 1em 0;
55
+ }
56
+
57
+ dl {
58
+ background-color: #DDD;
59
+ padding: 1em;
60
+ border: 1px solid #CCC;
61
+ }
62
+ dl .pronunciation {
63
+ color: #C00;
64
+ }
65
+ dl .description {
66
+ text-transform: uppercase;
67
+ font-size: 0.8em;
68
+ font-family: fixed;
69
+ }
@@ -0,0 +1,33 @@
1
+ google:
2
+ key: PUT YOUR KEY HERE
3
+ responses:
4
+ success.xml: "http://maps.google.com/maps/geo?q=1600+amphitheatre+mtn+view+ca&output=xml&key=:key"
5
+ badkey.xml: http://maps.google.com/maps/geo?q=1600+amphitheatre+mtn+view+ca&output=xml&key=this_is_a_bad_key
6
+ missing_address.xml: "http://maps.google.com/maps/geo?output=xml&key=:key"
7
+ unknown_address.xml: "http://maps.google.com/maps/geo?q=xxxxx&output=xml&key=:key"
8
+ partial.xml: "http://maps.google.com/maps/geo?q=sf+ca&output=xml&key=:key"
9
+ #unavailable.xml: no way to reproduce this
10
+ #limit.xml: no way to reproduce this
11
+ #server_error.xml: no way to reproduce this
12
+ geocoder_us:
13
+ responses:
14
+ success.xml: http://rpc.geocoder.us/service/rest/geocode?address=1600%20Pennsylvania%20Ave%20NW,%20Washington%20DC
15
+ unknown.xml: http://rpc.geocoder.us/service/rest/geocode?address=1600
16
+ host_ip:
17
+ responses:
18
+ private.txt: http://api.hostip.info/get_html.php?ip=192.168.0.1&position=true
19
+ success.txt: http://api.hostip.info/get_html.php?ip=64.233.167.99&position=true
20
+ unknown.txt: http://api.hostip.info/get_html.php?ip=254.254.254.254&position=true
21
+ local_search_maps:
22
+ responses:
23
+ success.txt: http://geo.localsearchmaps.com/?street=48+Leicester+Square&city=London&country=UK
24
+ empty.txt: http://geo.localsearchmaps.com/
25
+ not_found.txt: http://geo.localsearchmaps.com/?street=48
26
+ yahoo:
27
+ key: PUT YOUR KEY HERE
28
+ responses:
29
+ success.xml: http://api.local.yahoo.com/MapsService/V1/geocode?location=701%20First%20Street,%20Sunnyvale,%20CA&output=xml&appid=:key
30
+ unknown_address.xml: http://api.local.yahoo.com/MapsService/V1/geocode?location=thisprobablycantbefound&output=xml&appid=:key
31
+ geonames:
32
+ responses:
33
+ success.xml: http://ws.geonames.org/timezone?formatted=true&lat=41.85&lng=-87.65&style=full
@@ -0,0 +1,3 @@
1
+ # looking up postcode z12 9pp
2
+
3
+
@@ -0,0 +1,2 @@
1
+ # looking up postcode w12 1aa
2
+ 51.503172 -0.241641 W12 9AE
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <geodata>
3
+ <latt>45.418076</latt>
4
+ <longt>-75.693293</longt>
5
+ <postal>K2P1P6</postal>
6
+ <standard>
7
+ <stnumber>200</stnumber>
8
+ <staddress>MUTCALF </staddress>
9
+ <city>ottawa</city>
10
+ <prov>ON</prov>
11
+ </standard>
12
+ </geodata>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0"?>
2
+ <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
3
+ <geo:Point rdf:nodeID="aid78656681">
4
+ <dc:description>1600 Pennsylvania Ave NW, Washington DC 20502</dc:description>
5
+ <geo:long>-77.037684</geo:long>
6
+ <geo:lat>38.898748</geo:lat>
7
+ </geo:Point>
8
+ </rdf:RDF>
@@ -0,0 +1 @@
1
+ couldn't find this address! sorry
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <geonames>
3
+ <status message="missing lat/lng" value="14"/>
4
+ </geonames>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <geonames>
3
+ <timezone>
4
+ <countryCode>US</countryCode>
5
+ <countryName>United States</countryName>
6
+ <lat>41.85</lat>
7
+ <lng>-87.65</lng>
8
+ <timezoneId>America/Chicago</timezoneId>
9
+ <dstOffset>-5.0</dstOffset>
10
+ <gmtOffset>-6.0</gmtOffset>
11
+ <rawOffset>-6.0</rawOffset>
12
+ <time>2009-10-07 15:08</time>
13
+ </timezone>
14
+ </geonames>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <geonames>
3
+ <status message="no timezone information found for lat/lng" value="12"/>
4
+ </geonames>
@@ -0,0 +1,64 @@
1
+ {
2
+ "results" : [
3
+ {
4
+ "address_components" : [
5
+ {
6
+ "long_name" : "1600",
7
+ "short_name" : "1600",
8
+ "types" : [ "street_number" ]
9
+ },
10
+ {
11
+ "long_name" : "Amphitheatre Parkway",
12
+ "short_name" : "Amphitheatre Pkwy",
13
+ "types" : [ "route" ]
14
+ },
15
+ {
16
+ "long_name" : "Mountain View",
17
+ "short_name" : "Mountain View",
18
+ "types" : [ "locality", "political" ]
19
+ },
20
+ {
21
+ "long_name" : "Santa Clara",
22
+ "short_name" : "Santa Clara",
23
+ "types" : [ "administrative_area_level_2", "political" ]
24
+ },
25
+ {
26
+ "long_name" : "California",
27
+ "short_name" : "CA",
28
+ "types" : [ "administrative_area_level_1", "political" ]
29
+ },
30
+ {
31
+ "long_name" : "United States",
32
+ "short_name" : "US",
33
+ "types" : [ "country", "political" ]
34
+ },
35
+ {
36
+ "long_name" : "94043",
37
+ "short_name" : "94043",
38
+ "types" : [ "postal_code" ]
39
+ }
40
+ ],
41
+ "formatted_address" : "1600 Amphitheatre Parkway, Mountain View, CA 94043, USA",
42
+ "geometry" : {
43
+ "location" : {
44
+ "lat" : 37.4216410,
45
+ "lng" : -122.08550160
46
+ },
47
+ "location_type" : "ROOFTOP",
48
+ "viewport" : {
49
+ "northeast" : {
50
+ "lat" : 37.42298998029150,
51
+ "lng" : -122.0841526197085
52
+ },
53
+ "southwest" : {
54
+ "lat" : 37.42029201970850,
55
+ "lng" : -122.0868505802915
56
+ }
57
+ }
58
+ },
59
+ "partial_match" : true,
60
+ "types" : [ "street_address" ]
61
+ }
62
+ ],
63
+ "status" : "OK"
64
+ }