geokit 1.8.5 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +0 -1
  3. data/CHANGELOG.md +7 -0
  4. data/README.markdown +31 -14
  5. data/fixtures/vcr_cassettes/geonames_geocode.yml +1 -1
  6. data/fixtures/vcr_cassettes/geonames_geocode_premium.yml +42 -0
  7. data/fixtures/vcr_cassettes/google_country_code_biased_result_orly.yml +160 -0
  8. data/fixtures/vcr_cassettes/google_country_code_biased_result_toledo.yml +111 -0
  9. data/fixtures/vcr_cassettes/google_result_toledo_default_bias.yml +275 -0
  10. data/fixtures/vcr_cassettes/google_sublocality.yml +126 -0
  11. data/fixtures/vcr_cassettes/mapbox_forward_geocode.yml +59 -0
  12. data/fixtures/vcr_cassettes/mapbox_reverse_geocode.yml +63 -0
  13. data/fixtures/vcr_cassettes/opencage_city.yml +51 -0
  14. data/fixtures/vcr_cassettes/opencage_full.yml +65 -0
  15. data/fixtures/vcr_cassettes/opencage_language_response_es.yml +66 -0
  16. data/fixtures/vcr_cassettes/opencage_reverse_madrid.yml +51 -0
  17. data/fixtures/vcr_cassettes/opencage_reverse_prilep.yml +53 -0
  18. data/geokit.gemspec +5 -3
  19. data/lib/geokit/bounds.rb +40 -31
  20. data/lib/geokit/core_ext.rb +1 -1
  21. data/lib/geokit/geo_loc.rb +63 -41
  22. data/lib/geokit/geocoders.rb +13 -13
  23. data/lib/geokit/geocoders/bing.rb +9 -9
  24. data/lib/geokit/geocoders/ca_geocoder.rb +29 -29
  25. data/lib/geokit/geocoders/fcc.rb +4 -4
  26. data/lib/geokit/geocoders/free_geo_ip.rb +6 -7
  27. data/lib/geokit/geocoders/geo_plugin.rb +5 -6
  28. data/lib/geokit/geocoders/geocodio.rb +2 -2
  29. data/lib/geokit/geocoders/geonames.rb +18 -12
  30. data/lib/geokit/geocoders/google.rb +31 -30
  31. data/lib/geokit/geocoders/ip.rb +3 -4
  32. data/lib/geokit/geocoders/mapbox.rb +94 -0
  33. data/lib/geokit/geocoders/mapquest.rb +5 -5
  34. data/lib/geokit/geocoders/opencage.rb +93 -0
  35. data/lib/geokit/geocoders/openstreetmap.rb +9 -6
  36. data/lib/geokit/geocoders/ripe.rb +3 -3
  37. data/lib/geokit/geocoders/us_geocoder.rb +10 -9
  38. data/lib/geokit/geocoders/yahoo.rb +33 -34
  39. data/lib/geokit/geocoders/yandex.rb +17 -17
  40. data/lib/geokit/inflectors.rb +4 -10
  41. data/lib/geokit/lat_lng.rb +50 -26
  42. data/lib/geokit/mappable.rb +83 -83
  43. data/lib/geokit/multi_geocoder.rb +25 -20
  44. data/lib/geokit/net_adapter/net_http.rb +7 -4
  45. data/lib/geokit/polygon.rb +36 -4
  46. data/lib/geokit/version.rb +1 -1
  47. data/test/helper.rb +15 -13
  48. data/test/test_base_geocoder.rb +6 -7
  49. data/test/test_bing_geocoder.rb +20 -21
  50. data/test/test_bounds.rb +26 -28
  51. data/test/test_ca_geocoder.rb +9 -10
  52. data/test/test_fcc_geocoder.rb +1 -1
  53. data/test/test_free_geo_ip_geocoder.rb +1 -1
  54. data/test/test_geo_plugin_geocoder.rb +9 -9
  55. data/test/test_geoloc.rb +7 -6
  56. data/test/test_geonames_geocoder.rb +28 -6
  57. data/test/test_google_geocoder.rb +210 -176
  58. data/test/test_inflector.rb +0 -1
  59. data/test/test_ipgeocoder.rb +17 -18
  60. data/test/test_latlng.rb +105 -85
  61. data/test/test_map_quest.rb +18 -21
  62. data/test/test_mapbox_geocoder.rb +31 -0
  63. data/test/test_mappable.rb +46 -0
  64. data/test/test_maxmind_geocoder.rb +1 -3
  65. data/test/test_multi_geocoder.rb +8 -9
  66. data/test/test_multi_ip_geocoder.rb +3 -5
  67. data/test/test_net_adapter.rb +4 -4
  68. data/test/test_opencage_geocoder.rb +108 -0
  69. data/test/test_openstreetmap_geocoder.rb +62 -44
  70. data/test/{test_polygon_contains.rb → test_polygon.rb} +30 -20
  71. data/test/test_ripe_geocoder.rb +2 -0
  72. data/test/test_us_geocoder.rb +7 -8
  73. data/test/test_yahoo_geocoder.rb +20 -21
  74. data/test/test_yandex_geocoder.rb +34 -35
  75. metadata +79 -56
  76. data/fixtures/vcr_cassettes/google_country_code_biased_result.yml +0 -401
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 98e06d3c4938d6abb5d93ffa864c847d327c914a
4
+ data.tar.gz: 96b8865be8cf94ab9a50887af007550de8fc90b6
5
+ SHA512:
6
+ metadata.gz: 8c2a873dde628c7d662df14ce2540db29cbb7676b73800dd58b545fc97a440e31c2ee59b0b9e6a753696118e6ac1527cbf0c1c35b1cf0e384bde07c6aaa83029
7
+ data.tar.gz: 94d0cd927bdeeb27dd6457e7a83fac92b919624f2a2b20d0824ea8fd6cc0b008097384b79427536090c7b9bb6661c55379db6fd765e41bd13c431ddadcbbcf6e
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8
4
3
  - 1.9
5
4
  - 2.0
6
5
  - 2.1
@@ -1,3 +1,10 @@
1
+ ## 1.9.0
2
+
3
+ * Drop Ruby 1.8 support
4
+ * Make meter centric
5
+ * Add meters as a unit
6
+ * Use state_name/state_code instead of state
7
+
1
8
  ## 1.8.5
2
9
 
3
10
  * HTTPS on Google, Bing, Yahoo and MapQuest
@@ -11,7 +11,7 @@ Geokit
11
11
 
12
12
  The Geokit gem provides:
13
13
 
14
- * Distance calculations between two points on the earth. Calculate the distance in miles, kilometers, or nautical miles, with all the trigonometry abstracted away by Geokit.
14
+ * Distance calculations between two points on the earth. Calculate the distance in miles, kilometers, meters, or nautical miles, with all the trigonometry abstracted away by Geokit.
15
15
  * Geocoding from multiple providers. It supports Google, Yahoo, Geocoder.us, and Geocoder.ca geocoders, and others. It provides a uniform response structure from all of them.
16
16
  It also provides a fail-over mechanism, in case your input fails to geocode in one service.
17
17
  * Rectangular bounds calculations: is a point within a given rectangular bounds?
@@ -45,11 +45,15 @@ Combine this gem with the [geokit-rails](http://github.com/geokit/geokit-rails)
45
45
  * Yandex
46
46
  * MapQuest
47
47
  * Geocod.io
48
+ * Mapbox - requires an access token
49
+ * [OpenCage](http://geocoder.opencagedata.com) - requires an API key
48
50
 
49
51
  ### address geocoders that also provide reverse geocoding
50
52
  * Google - Supports multiple results and bounding box/country code biasing. Also supports Maps API for Business keys; see the configuration section below.
51
53
  * FCC
52
- * Open Street Map
54
+ * OpenStreetMap
55
+ * Mapbox
56
+ * OpenCage
53
57
 
54
58
  ### IP address geocoders
55
59
  * IP - geocodes an IP address using hostip.info's web service.
@@ -64,6 +68,8 @@ Combine this gem with the [geokit-rails](http://github.com/geokit/geokit-rails)
64
68
  * Bing
65
69
  * FCC
66
70
  * MapQuest
71
+ * Mapbox
72
+ * OpenCage
67
73
 
68
74
  Options to control the use of HTTPS are described below in the Configuration section.
69
75
 
@@ -100,7 +106,7 @@ If you're using this gem by itself, here are the configuration options:
100
106
 
101
107
  ```ruby
102
108
  # These defaults are used in Geokit::Mappable.distance_to and in acts_as_mappable
103
- Geokit::default_units = :miles
109
+ Geokit::default_units = :miles # others :kms, :nms, :meters
104
110
  Geokit::default_formula = :sphere
105
111
 
106
112
  # This is the timeout value in seconds to be used for calls to the geocoder web
@@ -152,11 +158,22 @@ If you're using this gem by itself, here are the configuration options:
152
158
  # and http://geocoder.ca/?register=1
153
159
  Geokit::Geocoders::CaGeocoder.key = 'KEY'
154
160
 
161
+ # This is your username key for geonames.
162
+ # To use this service either free or premium, you must register a key.
163
+ # See http://www.geonames.org
164
+ Geokit::Geocoders::GeonamesGeocoder.key = 'KEY'
165
+
155
166
  # Most other geocoders need either no setup or a key
156
167
  Geokit::Geocoders::BingGeocoder.key = ''
157
- Geokit::Geocoders::GeonamesGeocoder.key = ''
158
168
  Geokit::Geocoders::MapQuestGeocoder.key = ''
159
169
  Geokit::Geocoders::YandexGeocoder.key = ''
170
+ Geokit::Geocoders::MapboxGeocoder.key = 'ACCESS_TOKEN'
171
+ Geokit::Geocoders::OpencageGeocoder.key = 'some_api_key'
172
+
173
+ # Geonames has a free service and a premium service, each using a different URL
174
+ # GeonamesGeocoder.premium = true will use http://ws.geonames.net (premium)
175
+ # GeonamesGeocoder.premium = false will use http://api.geonames.org (free)
176
+ Geokit::Geocoders::GeonamesGeocoder.premium = false
160
177
 
161
178
  # require "external_geocoder.rb"
162
179
  # Please see the section "writing your own geocoders" for more information.
@@ -176,11 +193,11 @@ If you're using this gem by itself, here are the configuration options:
176
193
 
177
194
  # Disable HTTPS globally. This option can also be set on individual
178
195
  # geocoder classes.
179
- Geokit::Geocoders::secure = false
180
-
196
+ Geokit::Geocoders::secure = false
197
+
181
198
  # Control verification of the server certificate for geocoders using HTTPS
182
- Geokit::Geocoders::ssl_verify_mode = OpenSSL::SSL::VERIFY_(PEER/NONE)
183
- # Setting this to VERIFY_NONE may be needed on systems that don't have
199
+ Geokit::Geocoders::ssl_verify_mode = OpenSSL::SSL::VERIFY_(PEER/NONE)
200
+ # Setting this to VERIFY_NONE may be needed on systems that don't have
184
201
  # a complete or up to date root certificate store. Only applies to
185
202
  # the Net::HTTP adapter.
186
203
  ```
@@ -196,19 +213,19 @@ The Google Geocoder sports a number of useful tricks that elevate it a little bi
196
213
  @ne=#<Geokit::LatLng:0x53b204 @lat=37.7968528, @lng=-122.3926933>,
197
214
  @sw=#<Geokit::LatLng:0x53b2b8 @lat=37.7905576, @lng=-122.3989885>>
198
215
 
199
- In addition, you can use viewport or country code biasing to make sure the geocoders prefers results within a specific area. Say we wanted to geocode the city of Syracuse in Italy. A normal geocoding query would look like this:
216
+ In addition, you can use viewport or country code biasing to make sure the geocoders prefers results within a specific area. Say we wanted to geocode the city of Toledo in Spain. A normal geocoding query would look like this:
200
217
 
201
- irb> res = Geokit::Geocoders::GoogleGeocoder.geocode('Syracuse')
218
+ irb> res = Geokit::Geocoders::GoogleGeocoder.geocode('Toledo')
202
219
  irb> res.full_address
203
- => "Syracuse, NY, USA"
220
+ => "Toledo, OH, USA"
204
221
  ```
205
222
 
206
- Not exactly what we were looking for. We know that Syracuse is in Italy, so we can tell the Google Geocoder to prefer results from Italy first, and then wander the Syracuses of the world. To do that, we have to pass Italy's ccTLD (country code top-level domain) to the `:bias` option of the `geocode` method. You can find a comprehensive list of all ccTLDs here: http://en.wikipedia.org/wiki/CcTLD.
223
+ Not exactly what we were looking for. We know that Toledo is in Spain, so we can tell the Google Geocoder to prefer results from Spain first, and then wander the Toledos of the world. To do that, we have to pass Italy's ccTLD (country code top-level domain) to the `:bias` option of the `geocode` method. You can find a comprehensive list of all ccTLDs here: http://en.wikipedia.org/wiki/CcTLD.
207
224
 
208
225
  ```ruby
209
- irb> res = Geokit::Geocoders::GoogleGeocoder.geocode('Syracuse', :bias => 'it')
226
+ irb> res = Geokit::Geocoders::GoogleGeocoder.geocode('Toledo', :bias => 'es')
210
227
  irb> res.full_address
211
- => "Syracuse, Italy"
228
+ => "Toledo, Toledo, Spain"
212
229
  ```
213
230
 
214
231
  Alternatively, we can specify the geocoding bias as a bounding box object. Say we wanted to geocode the Winnetka district in Los Angeles.
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://ws.geonames.org/postalCodeSearch?maxRows=10&placename=Adelaide
5
+ uri: http://api.geonames.org/postalCodeSearch?maxRows=10&placename=Adelaide&username=demo
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://ws.geonames.net/postalCodeSearch?maxRows=10&placename=Adelaide&username=demo
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Fri, 20 Jun 2014 02:41:39 GMT
23
+ Server:
24
+ - Apache/2.2.17 (Linux/SUSE)
25
+ Cache-Control:
26
+ - no-cache
27
+ Access-Control-Allow-Origin:
28
+ - '*'
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Content-Type:
32
+ - text/xml;charset=UTF-8
33
+ body:
34
+ encoding: UTF-8
35
+ string: |
36
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
37
+ <geonames>
38
+ <status message="Please provide a valid username for the GeoNames Premium Web Service or use the free api.geonames.org server. Thank you for your understanding." value="10"/>
39
+ </geonames>
40
+ http_version:
41
+ recorded_at: Fri, 20 Jun 2014 02:41:29 GMT
42
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,160 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://maps.google.com/maps/api/geocode/json?address=orly&region=fr&sensor=false
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Date:
24
+ - Tue, 23 Sep 2014 13:48:29 GMT
25
+ Expires:
26
+ - Wed, 24 Sep 2014 13:48:29 GMT
27
+ Cache-Control:
28
+ - public, max-age=86400
29
+ Vary:
30
+ - Accept-Language
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Server:
34
+ - mafe
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ Alternate-Protocol:
40
+ - 443:quic,p=0.002
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: !binary |-
46
+ ewogICAicmVzdWx0cyIgOiBbCiAgICAgIHsKICAgICAgICAgImFkZHJlc3Nf
47
+ Y29tcG9uZW50cyIgOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAg
48
+ ImxvbmdfbmFtZSIgOiAiT3JseSIsCiAgICAgICAgICAgICAgICJzaG9ydF9u
49
+ YW1lIiA6ICJPcmx5IiwKICAgICAgICAgICAgICAgInR5cGVzIiA6IFsgImxv
50
+ Y2FsaXR5IiwgInBvbGl0aWNhbCIgXQogICAgICAgICAgICB9LAogICAgICAg
51
+ ICAgICB7CiAgICAgICAgICAgICAgICJsb25nX25hbWUiIDogIlZhbC1kZS1N
52
+ YXJuZSIsCiAgICAgICAgICAgICAgICJzaG9ydF9uYW1lIiA6ICI5NCIsCiAg
53
+ ICAgICAgICAgICAgICJ0eXBlcyIgOiBbICJhZG1pbmlzdHJhdGl2ZV9hcmVh
54
+ X2xldmVsXzIiLCAicG9saXRpY2FsIiBdCiAgICAgICAgICAgIH0sCiAgICAg
55
+ ICAgICAgIHsKICAgICAgICAgICAgICAgImxvbmdfbmFtZSIgOiAiw45sZS1k
56
+ ZS1GcmFuY2UiLAogICAgICAgICAgICAgICAic2hvcnRfbmFtZSIgOiAiSURG
57
+ IiwKICAgICAgICAgICAgICAgInR5cGVzIiA6IFsgImFkbWluaXN0cmF0aXZl
58
+ X2FyZWFfbGV2ZWxfMSIsICJwb2xpdGljYWwiIF0KICAgICAgICAgICAgfSwK
59
+ ICAgICAgICAgICAgewogICAgICAgICAgICAgICAibG9uZ19uYW1lIiA6ICJG
60
+ cmFuY2UiLAogICAgICAgICAgICAgICAic2hvcnRfbmFtZSIgOiAiRlIiLAog
61
+ ICAgICAgICAgICAgICAidHlwZXMiIDogWyAiY291bnRyeSIsICJwb2xpdGlj
62
+ YWwiIF0KICAgICAgICAgICAgfQogICAgICAgICBdLAogICAgICAgICAiZm9y
63
+ bWF0dGVkX2FkZHJlc3MiIDogIk9ybHksIEZyYW5jZSIsCiAgICAgICAgICJn
64
+ ZW9tZXRyeSIgOiB7CiAgICAgICAgICAgICJib3VuZHMiIDogewogICAgICAg
65
+ ICAgICAgICAibm9ydGhlYXN0IiA6IHsKICAgICAgICAgICAgICAgICAgImxh
66
+ dCIgOiA0OC43NTI4ODUsCiAgICAgICAgICAgICAgICAgICJsbmciIDogMi40
67
+ MzY2OTQKICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgInNvdXRo
68
+ d2VzdCIgOiB7CiAgICAgICAgICAgICAgICAgICJsYXQiIDogNDguNzI3NjQ5
69
+ MSwKICAgICAgICAgICAgICAgICAgImxuZyIgOiAyLjM2OTMyMDkKICAgICAg
70
+ ICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICAibG9jYXRp
71
+ b24iIDogewogICAgICAgICAgICAgICAibGF0IiA6IDQ4Ljc0NTE5MywKICAg
72
+ ICAgICAgICAgICAgImxuZyIgOiAyLjQwMTM3MwogICAgICAgICAgICB9LAog
73
+ ICAgICAgICAgICAibG9jYXRpb25fdHlwZSIgOiAiQVBQUk9YSU1BVEUiLAog
74
+ ICAgICAgICAgICAidmlld3BvcnQiIDogewogICAgICAgICAgICAgICAibm9y
75
+ dGhlYXN0IiA6IHsKICAgICAgICAgICAgICAgICAgImxhdCIgOiA0OC43NTI4
76
+ ODUsCiAgICAgICAgICAgICAgICAgICJsbmciIDogMi40MzY2OTQKICAgICAg
77
+ ICAgICAgICAgfSwKICAgICAgICAgICAgICAgInNvdXRod2VzdCIgOiB7CiAg
78
+ ICAgICAgICAgICAgICAgICJsYXQiIDogNDguNzI3NjQ5MSwKICAgICAgICAg
79
+ ICAgICAgICAgImxuZyIgOiAyLjM2OTMyMDkKICAgICAgICAgICAgICAgfQog
80
+ ICAgICAgICAgICB9CiAgICAgICAgIH0sCiAgICAgICAgICJ0eXBlcyIgOiBb
81
+ ICJsb2NhbGl0eSIsICJwb2xpdGljYWwiIF0KICAgICAgfSwKICAgICAgewog
82
+ ICAgICAgICAiYWRkcmVzc19jb21wb25lbnRzIiA6IFsKICAgICAgICAgICAg
83
+ ewogICAgICAgICAgICAgICAibG9uZ19uYW1lIiA6ICJPcmx5IEFpcnBvcnQi
84
+ LAogICAgICAgICAgICAgICAic2hvcnRfbmFtZSIgOiAiT3JseSBBaXJwb3J0
85
+ IiwKICAgICAgICAgICAgICAgInR5cGVzIiA6IFsgImVzdGFibGlzaG1lbnQi
86
+ IF0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgewogICAgICAgICAgICAg
87
+ ICAibG9uZ19uYW1lIiA6ICJPcmx5IiwKICAgICAgICAgICAgICAgInNob3J0
88
+ X25hbWUiIDogIk9ybHkiLAogICAgICAgICAgICAgICAidHlwZXMiIDogWyAi
89
+ bG9jYWxpdHkiLCAicG9saXRpY2FsIiBdCiAgICAgICAgICAgIH0sCiAgICAg
90
+ ICAgICAgIHsKICAgICAgICAgICAgICAgImxvbmdfbmFtZSIgOiAiw45sZS1k
91
+ ZS1GcmFuY2UiLAogICAgICAgICAgICAgICAic2hvcnRfbmFtZSIgOiAiSURG
92
+ IiwKICAgICAgICAgICAgICAgInR5cGVzIiA6IFsgImFkbWluaXN0cmF0aXZl
93
+ X2FyZWFfbGV2ZWxfMSIsICJwb2xpdGljYWwiIF0KICAgICAgICAgICAgfSwK
94
+ ICAgICAgICAgICAgewogICAgICAgICAgICAgICAibG9uZ19uYW1lIiA6ICJG
95
+ cmFuY2UiLAogICAgICAgICAgICAgICAic2hvcnRfbmFtZSIgOiAiRlIiLAog
96
+ ICAgICAgICAgICAgICAidHlwZXMiIDogWyAiY291bnRyeSIsICJwb2xpdGlj
97
+ YWwiIF0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgewogICAgICAgICAg
98
+ ICAgICAibG9uZ19uYW1lIiA6ICI5NDM5MCIsCiAgICAgICAgICAgICAgICJz
99
+ aG9ydF9uYW1lIiA6ICI5NDM5MCIsCiAgICAgICAgICAgICAgICJ0eXBlcyIg
100
+ OiBbICJwb3N0YWxfY29kZSIgXQogICAgICAgICAgICB9CiAgICAgICAgIF0s
101
+ CiAgICAgICAgICJmb3JtYXR0ZWRfYWRkcmVzcyIgOiAiT3JseSBBaXJwb3J0
102
+ LCA5NDM5MCBPcmx5LCBGcmFuY2UiLAogICAgICAgICAiZ2VvbWV0cnkiIDog
103
+ ewogICAgICAgICAgICAiYm91bmRzIiA6IHsKICAgICAgICAgICAgICAgIm5v
104
+ cnRoZWFzdCIgOiB7CiAgICAgICAgICAgICAgICAgICJsYXQiIDogNDguNzQ2
105
+ MTA0NiwKICAgICAgICAgICAgICAgICAgImxuZyIgOiAyLjQwNzI5NTcKICAg
106
+ ICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgInNvdXRod2VzdCIgOiB7
107
+ CiAgICAgICAgICAgICAgICAgICJsYXQiIDogNDguNzEzMTY1OSwKICAgICAg
108
+ ICAgICAgICAgICAgImxuZyIgOiAyLjMxMDI4MDMKICAgICAgICAgICAgICAg
109
+ fQogICAgICAgICAgICB9LAogICAgICAgICAgICAibG9jYXRpb24iIDogewog
110
+ ICAgICAgICAgICAgICAibGF0IiA6IDQ4LjcyNjI0MzMsCiAgICAgICAgICAg
111
+ ICAgICJsbmciIDogMi4zNjUyNDcyCiAgICAgICAgICAgIH0sCiAgICAgICAg
112
+ ICAgICJsb2NhdGlvbl90eXBlIiA6ICJBUFBST1hJTUFURSIsCiAgICAgICAg
113
+ ICAgICJ2aWV3cG9ydCIgOiB7CiAgICAgICAgICAgICAgICJub3J0aGVhc3Qi
114
+ IDogewogICAgICAgICAgICAgICAgICAibGF0IiA6IDQ4Ljc0NjEwNDYsCiAg
115
+ ICAgICAgICAgICAgICAgICJsbmciIDogMi40MDcyOTU3CiAgICAgICAgICAg
116
+ ICAgIH0sCiAgICAgICAgICAgICAgICJzb3V0aHdlc3QiIDogewogICAgICAg
117
+ ICAgICAgICAgICAibGF0IiA6IDQ4LjcxMzE2NTksCiAgICAgICAgICAgICAg
118
+ ICAgICJsbmciIDogMi4zMTAyODAzCiAgICAgICAgICAgICAgIH0KICAgICAg
119
+ ICAgICAgfQogICAgICAgICB9LAogICAgICAgICAidHlwZXMiIDogWyAiYWly
120
+ cG9ydCIsICJ0cmFuc2l0X3N0YXRpb24iLCAiZXN0YWJsaXNobWVudCIgXQog
121
+ ICAgICB9LAogICAgICB7CiAgICAgICAgICJhZGRyZXNzX2NvbXBvbmVudHMi
122
+ IDogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICJsb25nX25hbWUi
123
+ IDogIk9ybHktc3VyLU1vcmluIiwKICAgICAgICAgICAgICAgInNob3J0X25h
124
+ bWUiIDogIk9ybHktc3VyLU1vcmluIiwKICAgICAgICAgICAgICAgInR5cGVz
125
+ IiA6IFsgImxvY2FsaXR5IiwgInBvbGl0aWNhbCIgXQogICAgICAgICAgICB9
126
+ LAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICJsb25nX25hbWUiIDog
127
+ IlNlaW5lLWV0LU1hcm5lIiwKICAgICAgICAgICAgICAgInNob3J0X25hbWUi
128
+ IDogIjc3IiwKICAgICAgICAgICAgICAgInR5cGVzIiA6IFsgImFkbWluaXN0
129
+ cmF0aXZlX2FyZWFfbGV2ZWxfMiIsICJwb2xpdGljYWwiIF0KICAgICAgICAg
130
+ ICAgfSwKICAgICAgICAgICAgewogICAgICAgICAgICAgICAibG9uZ19uYW1l
131
+ IiA6ICLDjmxlLWRlLUZyYW5jZSIsCiAgICAgICAgICAgICAgICJzaG9ydF9u
132
+ YW1lIiA6ICJJREYiLAogICAgICAgICAgICAgICAidHlwZXMiIDogWyAiYWRt
133
+ aW5pc3RyYXRpdmVfYXJlYV9sZXZlbF8xIiwgInBvbGl0aWNhbCIgXQogICAg
134
+ ICAgICAgICB9LAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICJsb25n
135
+ X25hbWUiIDogIkZyYW5jZSIsCiAgICAgICAgICAgICAgICJzaG9ydF9uYW1l
136
+ IiA6ICJGUiIsCiAgICAgICAgICAgICAgICJ0eXBlcyIgOiBbICJjb3VudHJ5
137
+ IiwgInBvbGl0aWNhbCIgXQogICAgICAgICAgICB9CiAgICAgICAgIF0sCiAg
138
+ ICAgICAgICJmb3JtYXR0ZWRfYWRkcmVzcyIgOiAiT3JseS1zdXItTW9yaW4s
139
+ IEZyYW5jZSIsCiAgICAgICAgICJnZW9tZXRyeSIgOiB7CiAgICAgICAgICAg
140
+ ICJib3VuZHMiIDogewogICAgICAgICAgICAgICAibm9ydGhlYXN0IiA6IHsK
141
+ ICAgICAgICAgICAgICAgICAgImxhdCIgOiA0OC45MTM2MTMsCiAgICAgICAg
142
+ ICAgICAgICAgICJsbmciIDogMy4yNTI2MjUKICAgICAgICAgICAgICAgfSwK
143
+ ICAgICAgICAgICAgICAgInNvdXRod2VzdCIgOiB7CiAgICAgICAgICAgICAg
144
+ ICAgICJsYXQiIDogNDguODg3NjMyLAogICAgICAgICAgICAgICAgICAibG5n
145
+ IiA6IDMuMjA0MzUyCiAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwK
146
+ ICAgICAgICAgICAgImxvY2F0aW9uIiA6IHsKICAgICAgICAgICAgICAgImxh
147
+ dCIgOiA0OC45MDM4NzY5OTk5OTk5OSwKICAgICAgICAgICAgICAgImxuZyIg
148
+ OiAzLjIyOTgzNgogICAgICAgICAgICB9LAogICAgICAgICAgICAibG9jYXRp
149
+ b25fdHlwZSIgOiAiQVBQUk9YSU1BVEUiLAogICAgICAgICAgICAidmlld3Bv
150
+ cnQiIDogewogICAgICAgICAgICAgICAibm9ydGhlYXN0IiA6IHsKICAgICAg
151
+ ICAgICAgICAgICAgImxhdCIgOiA0OC45MTM2MTMsCiAgICAgICAgICAgICAg
152
+ ICAgICJsbmciIDogMy4yNTI2MjUKICAgICAgICAgICAgICAgfSwKICAgICAg
153
+ ICAgICAgICAgInNvdXRod2VzdCIgOiB7CiAgICAgICAgICAgICAgICAgICJs
154
+ YXQiIDogNDguODg3NjMyLAogICAgICAgICAgICAgICAgICAibG5nIiA6IDMu
155
+ MjA0MzUyCiAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAg
156
+ ICB9LAogICAgICAgICAidHlwZXMiIDogWyAibG9jYWxpdHkiLCAicG9saXRp
157
+ Y2FsIiBdCiAgICAgIH0KICAgXSwKICAgInN0YXR1cyIgOiAiT0siCn0K
158
+ http_version:
159
+ recorded_at: Tue, 23 Sep 2014 13:48:29 GMT
160
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,111 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://maps.google.com/maps/api/geocode/json?address=toledo&region=es&sensor=false
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Date:
24
+ - Tue, 23 Sep 2014 13:48:29 GMT
25
+ Expires:
26
+ - Wed, 24 Sep 2014 13:48:29 GMT
27
+ Cache-Control:
28
+ - public, max-age=86400
29
+ Vary:
30
+ - Accept-Language
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Server:
34
+ - mafe
35
+ X-Xss-Protection:
36
+ - 1; mode=block
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ Alternate-Protocol:
40
+ - 443:quic,p=0.002
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: UTF-8
45
+ string: |
46
+ {
47
+ "results" : [
48
+ {
49
+ "address_components" : [
50
+ {
51
+ "long_name" : "Toledo",
52
+ "short_name" : "Toledo",
53
+ "types" : [ "locality", "political" ]
54
+ },
55
+ {
56
+ "long_name" : "Toledo",
57
+ "short_name" : "Toledo",
58
+ "types" : [ "administrative_area_level_4", "political" ]
59
+ },
60
+ {
61
+ "long_name" : "Toledo",
62
+ "short_name" : "TO",
63
+ "types" : [ "administrative_area_level_2", "political" ]
64
+ },
65
+ {
66
+ "long_name" : "Castile-La Mancha",
67
+ "short_name" : "CM",
68
+ "types" : [ "administrative_area_level_1", "political" ]
69
+ },
70
+ {
71
+ "long_name" : "Spain",
72
+ "short_name" : "ES",
73
+ "types" : [ "country", "political" ]
74
+ }
75
+ ],
76
+ "formatted_address" : "Toledo, Toledo, Spain",
77
+ "geometry" : {
78
+ "bounds" : {
79
+ "northeast" : {
80
+ "lat" : 39.88605099999999,
81
+ "lng" : -3.9192423
82
+ },
83
+ "southwest" : {
84
+ "lat" : 39.8383676,
85
+ "lng" : -4.0629256
86
+ }
87
+ },
88
+ "location" : {
89
+ "lat" : 39.8628316,
90
+ "lng" : -4.027323099999999
91
+ },
92
+ "location_type" : "APPROXIMATE",
93
+ "viewport" : {
94
+ "northeast" : {
95
+ "lat" : 39.88605099999999,
96
+ "lng" : -3.9192423
97
+ },
98
+ "southwest" : {
99
+ "lat" : 39.8383676,
100
+ "lng" : -4.0629256
101
+ }
102
+ }
103
+ },
104
+ "types" : [ "locality", "political" ]
105
+ }
106
+ ],
107
+ "status" : "OK"
108
+ }
109
+ http_version:
110
+ recorded_at: Tue, 23 Sep 2014 13:48:29 GMT
111
+ recorded_with: VCR 2.9.3