geocoder2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/.gitignore +5 -0
  2. data/.travis.yml +27 -0
  3. data/CHANGELOG.md +329 -0
  4. data/LICENSE +20 -0
  5. data/README.md +796 -0
  6. data/Rakefile +25 -0
  7. data/bin/geocode2 +5 -0
  8. data/examples/autoexpire_cache_dalli.rb +62 -0
  9. data/examples/autoexpire_cache_redis.rb +28 -0
  10. data/examples/cache_bypass.rb +48 -0
  11. data/gemfiles/Gemfile.mongoid-2.4.x +15 -0
  12. data/json?address=26+leonard+street%2C+Belmont&key=AIzaSyDoltU6YL8XeIQrSLFGk6ZfpKaWkPukwYQ&language=en +68 -0
  13. data/lib/generators/geocoder2/config/config_generator.rb +14 -0
  14. data/lib/generators/geocoder2/config/templates/initializer.rb +21 -0
  15. data/lib/geocoder2/cache.rb +89 -0
  16. data/lib/geocoder2/calculations.rb +389 -0
  17. data/lib/geocoder2/cli.rb +121 -0
  18. data/lib/geocoder2/configuration.rb +130 -0
  19. data/lib/geocoder2/configuration_hash.rb +11 -0
  20. data/lib/geocoder2/exceptions.rb +21 -0
  21. data/lib/geocoder2/lookup.rb +86 -0
  22. data/lib/geocoder2/lookups/baidu.rb +54 -0
  23. data/lib/geocoder2/lookups/base.rb +266 -0
  24. data/lib/geocoder2/lookups/bing.rb +47 -0
  25. data/lib/geocoder2/lookups/dstk.rb +20 -0
  26. data/lib/geocoder2/lookups/esri.rb +48 -0
  27. data/lib/geocoder2/lookups/freegeoip.rb +43 -0
  28. data/lib/geocoder2/lookups/geocoder_ca.rb +54 -0
  29. data/lib/geocoder2/lookups/geocoder_us.rb +39 -0
  30. data/lib/geocoder2/lookups/google.rb +69 -0
  31. data/lib/geocoder2/lookups/google_premier.rb +47 -0
  32. data/lib/geocoder2/lookups/mapquest.rb +59 -0
  33. data/lib/geocoder2/lookups/maxmind.rb +88 -0
  34. data/lib/geocoder2/lookups/nominatim.rb +44 -0
  35. data/lib/geocoder2/lookups/ovi.rb +62 -0
  36. data/lib/geocoder2/lookups/test.rb +44 -0
  37. data/lib/geocoder2/lookups/yahoo.rb +86 -0
  38. data/lib/geocoder2/lookups/yandex.rb +54 -0
  39. data/lib/geocoder2/models/active_record.rb +46 -0
  40. data/lib/geocoder2/models/base.rb +42 -0
  41. data/lib/geocoder2/models/mongo_base.rb +60 -0
  42. data/lib/geocoder2/models/mongo_mapper.rb +26 -0
  43. data/lib/geocoder2/models/mongoid.rb +32 -0
  44. data/lib/geocoder2/query.rb +107 -0
  45. data/lib/geocoder2/railtie.rb +26 -0
  46. data/lib/geocoder2/request.rb +23 -0
  47. data/lib/geocoder2/results/baidu.rb +79 -0
  48. data/lib/geocoder2/results/base.rb +67 -0
  49. data/lib/geocoder2/results/bing.rb +48 -0
  50. data/lib/geocoder2/results/dstk.rb +6 -0
  51. data/lib/geocoder2/results/esri.rb +51 -0
  52. data/lib/geocoder2/results/freegeoip.rb +45 -0
  53. data/lib/geocoder2/results/geocoder_ca.rb +60 -0
  54. data/lib/geocoder2/results/geocoder_us.rb +39 -0
  55. data/lib/geocoder2/results/google.rb +124 -0
  56. data/lib/geocoder2/results/google_premier.rb +6 -0
  57. data/lib/geocoder2/results/mapquest.rb +51 -0
  58. data/lib/geocoder2/results/maxmind.rb +135 -0
  59. data/lib/geocoder2/results/nominatim.rb +94 -0
  60. data/lib/geocoder2/results/ovi.rb +62 -0
  61. data/lib/geocoder2/results/test.rb +16 -0
  62. data/lib/geocoder2/results/yahoo.rb +55 -0
  63. data/lib/geocoder2/results/yandex.rb +80 -0
  64. data/lib/geocoder2/sql.rb +106 -0
  65. data/lib/geocoder2/stores/active_record.rb +272 -0
  66. data/lib/geocoder2/stores/base.rb +120 -0
  67. data/lib/geocoder2/stores/mongo_base.rb +89 -0
  68. data/lib/geocoder2/stores/mongo_mapper.rb +13 -0
  69. data/lib/geocoder2/stores/mongoid.rb +13 -0
  70. data/lib/geocoder2/version.rb +3 -0
  71. data/lib/geocoder2.rb +55 -0
  72. data/lib/hash_recursive_merge.rb +74 -0
  73. data/lib/oauth_util.rb +112 -0
  74. data/lib/tasks/geocoder2.rake +27 -0
  75. data/test/active_record_test.rb +15 -0
  76. data/test/cache_test.rb +35 -0
  77. data/test/calculations_test.rb +211 -0
  78. data/test/configuration_test.rb +78 -0
  79. data/test/custom_block_test.rb +32 -0
  80. data/test/error_handling_test.rb +43 -0
  81. data/test/fixtures/baidu_invalid_key +1 -0
  82. data/test/fixtures/baidu_no_results +1 -0
  83. data/test/fixtures/baidu_reverse +1 -0
  84. data/test/fixtures/baidu_shanghai_pearl_tower +12 -0
  85. data/test/fixtures/bing_invalid_key +1 -0
  86. data/test/fixtures/bing_madison_square_garden +40 -0
  87. data/test/fixtures/bing_no_results +16 -0
  88. data/test/fixtures/bing_reverse +42 -0
  89. data/test/fixtures/esri_madison_square_garden +59 -0
  90. data/test/fixtures/esri_no_results +8 -0
  91. data/test/fixtures/esri_reverse +21 -0
  92. data/test/fixtures/freegeoip_74_200_247_59 +12 -0
  93. data/test/fixtures/freegeoip_no_results +1 -0
  94. data/test/fixtures/geocoder_ca_madison_square_garden +1 -0
  95. data/test/fixtures/geocoder_ca_no_results +1 -0
  96. data/test/fixtures/geocoder_ca_reverse +34 -0
  97. data/test/fixtures/geocoder_us_madison_square_garden +1 -0
  98. data/test/fixtures/geocoder_us_no_results +1 -0
  99. data/test/fixtures/google_garbage +456 -0
  100. data/test/fixtures/google_madison_square_garden +57 -0
  101. data/test/fixtures/google_no_city_data +44 -0
  102. data/test/fixtures/google_no_locality +51 -0
  103. data/test/fixtures/google_no_results +4 -0
  104. data/test/fixtures/google_over_limit +4 -0
  105. data/test/fixtures/mapquest_error +16 -0
  106. data/test/fixtures/mapquest_invalid_api_key +16 -0
  107. data/test/fixtures/mapquest_invalid_request +16 -0
  108. data/test/fixtures/mapquest_madison_square_garden +52 -0
  109. data/test/fixtures/mapquest_no_results +16 -0
  110. data/test/fixtures/maxmind_24_24_24_21 +1 -0
  111. data/test/fixtures/maxmind_24_24_24_22 +1 -0
  112. data/test/fixtures/maxmind_24_24_24_23 +1 -0
  113. data/test/fixtures/maxmind_24_24_24_24 +1 -0
  114. data/test/fixtures/maxmind_74_200_247_59 +1 -0
  115. data/test/fixtures/maxmind_invalid_key +1 -0
  116. data/test/fixtures/maxmind_no_results +1 -0
  117. data/test/fixtures/nominatim_madison_square_garden +150 -0
  118. data/test/fixtures/nominatim_no_results +1 -0
  119. data/test/fixtures/ovi_madison_square_garden +72 -0
  120. data/test/fixtures/ovi_no_results +8 -0
  121. data/test/fixtures/yahoo_error +1 -0
  122. data/test/fixtures/yahoo_invalid_key +2 -0
  123. data/test/fixtures/yahoo_madison_square_garden +52 -0
  124. data/test/fixtures/yahoo_no_results +10 -0
  125. data/test/fixtures/yahoo_over_limit +2 -0
  126. data/test/fixtures/yandex_invalid_key +1 -0
  127. data/test/fixtures/yandex_kremlin +48 -0
  128. data/test/fixtures/yandex_no_city_and_town +112 -0
  129. data/test/fixtures/yandex_no_results +16 -0
  130. data/test/geocoder_test.rb +59 -0
  131. data/test/https_test.rb +16 -0
  132. data/test/integration/smoke_test.rb +26 -0
  133. data/test/lookup_test.rb +117 -0
  134. data/test/method_aliases_test.rb +25 -0
  135. data/test/mongoid_test.rb +46 -0
  136. data/test/mongoid_test_helper.rb +43 -0
  137. data/test/near_test.rb +61 -0
  138. data/test/oauth_util_test.rb +30 -0
  139. data/test/proxy_test.rb +36 -0
  140. data/test/query_test.rb +52 -0
  141. data/test/request_test.rb +29 -0
  142. data/test/result_test.rb +42 -0
  143. data/test/services_test.rb +393 -0
  144. data/test/test_helper.rb +289 -0
  145. data/test/test_mode_test.rb +59 -0
  146. metadata +213 -0
@@ -0,0 +1,456 @@
1
+ {
2
+ "status": "OK",
3
+ "results": [ {
4
+ "types": [ "postal_code" ],
5
+ "formatted_address": "Hedge End, Southampton, Hampshire SO30 4RT, UK",
6
+ "address_components": [ {
7
+ "long_name": "SO30 4RT",
8
+ "short_name": "SO30 4RT",
9
+ "types": [ "postal_code" ]
10
+ }, {
11
+ "long_name": "Hedge End",
12
+ "short_name": "Hedge End",
13
+ "types": [ "sublocality", "political" ]
14
+ }, {
15
+ "long_name": "Southampton",
16
+ "short_name": "Southampton",
17
+ "types": [ "locality", "political" ]
18
+ }, {
19
+ "long_name": "Hampshire",
20
+ "short_name": "Hampshire",
21
+ "types": [ "administrative_area_level_2", "political" ]
22
+ }, {
23
+ "long_name": "United Kingdom",
24
+ "short_name": "GB",
25
+ "types": [ "country", "political" ]
26
+ }, {
27
+ "long_name": "SO30",
28
+ "short_name": "SO30",
29
+ "types": [ "postal_code_prefix", "postal_code" ]
30
+ } ],
31
+ "geometry": {
32
+ "location": {
33
+ "lat": 50.9173897,
34
+ "lng": -1.3125111
35
+ },
36
+ "location_type": "APPROXIMATE",
37
+ "viewport": {
38
+ "southwest": {
39
+ "lat": 50.9142421,
40
+ "lng": -1.3156587
41
+ },
42
+ "northeast": {
43
+ "lat": 50.9205373,
44
+ "lng": -1.3093635
45
+ }
46
+ }
47
+ },
48
+ "partial_match": true
49
+ }, {
50
+ "types": [ "postal_code" ],
51
+ "formatted_address": "Enfield, London N13 4RT, UK",
52
+ "address_components": [ {
53
+ "long_name": "N13 4RT",
54
+ "short_name": "N13 4RT",
55
+ "types": [ "postal_code" ]
56
+ }, {
57
+ "long_name": "London",
58
+ "short_name": "London",
59
+ "types": [ "locality", "political" ]
60
+ }, {
61
+ "long_name": "Enfield",
62
+ "short_name": "Enfield",
63
+ "types": [ "administrative_area_level_3", "political" ]
64
+ }, {
65
+ "long_name": "Greater London",
66
+ "short_name": "Greater London",
67
+ "types": [ "administrative_area_level_2", "political" ]
68
+ }, {
69
+ "long_name": "United Kingdom",
70
+ "short_name": "GB",
71
+ "types": [ "country", "political" ]
72
+ }, {
73
+ "long_name": "N13",
74
+ "short_name": "N13",
75
+ "types": [ "postal_code_prefix", "postal_code" ]
76
+ } ],
77
+ "geometry": {
78
+ "location": {
79
+ "lat": 51.6329009,
80
+ "lng": -0.0994552
81
+ },
82
+ "location_type": "APPROXIMATE",
83
+ "viewport": {
84
+ "southwest": {
85
+ "lat": 51.6297533,
86
+ "lng": -0.1026028
87
+ },
88
+ "northeast": {
89
+ "lat": 51.6360485,
90
+ "lng": -0.0963076
91
+ }
92
+ }
93
+ },
94
+ "partial_match": true
95
+ }, {
96
+ "types": [ "postal_code" ],
97
+ "formatted_address": "Cardiff, South Glamorgan CF5 4RT, UK",
98
+ "address_components": [ {
99
+ "long_name": "CF5 4RT",
100
+ "short_name": "CF5 4RT",
101
+ "types": [ "postal_code" ]
102
+ }, {
103
+ "long_name": "Caerau",
104
+ "short_name": "Caerau",
105
+ "types": [ "locality", "political" ]
106
+ }, {
107
+ "long_name": "Cardiff",
108
+ "short_name": "Cardiff",
109
+ "types": [ "locality", "political" ]
110
+ }, {
111
+ "long_name": "South Glamorgan",
112
+ "short_name": "South Glam",
113
+ "types": [ "administrative_area_level_2", "political" ]
114
+ }, {
115
+ "long_name": "Cardiff",
116
+ "short_name": "Cardiff",
117
+ "types": [ "administrative_area_level_2", "political" ]
118
+ }, {
119
+ "long_name": "United Kingdom",
120
+ "short_name": "GB",
121
+ "types": [ "country", "political" ]
122
+ }, {
123
+ "long_name": "CF5",
124
+ "short_name": "CF5",
125
+ "types": [ "postal_code_prefix", "postal_code" ]
126
+ } ],
127
+ "geometry": {
128
+ "location": {
129
+ "lat": 51.4675314,
130
+ "lng": -3.2642245
131
+ },
132
+ "location_type": "APPROXIMATE",
133
+ "viewport": {
134
+ "southwest": {
135
+ "lat": 51.4643838,
136
+ "lng": -3.2673721
137
+ },
138
+ "northeast": {
139
+ "lat": 51.4706790,
140
+ "lng": -3.2610769
141
+ }
142
+ }
143
+ },
144
+ "partial_match": true
145
+ }, {
146
+ "types": [ "postal_code" ],
147
+ "formatted_address": "Monifieth, Dundee, Angus DD5 4RT, UK",
148
+ "address_components": [ {
149
+ "long_name": "DD5 4RT",
150
+ "short_name": "DD5 4RT",
151
+ "types": [ "postal_code" ]
152
+ }, {
153
+ "long_name": "Monifieth",
154
+ "short_name": "Monifieth",
155
+ "types": [ "sublocality", "political" ]
156
+ }, {
157
+ "long_name": "Dundee",
158
+ "short_name": "Dundee",
159
+ "types": [ "locality", "political" ]
160
+ }, {
161
+ "long_name": "Angus",
162
+ "short_name": "Angus",
163
+ "types": [ "administrative_area_level_2", "political" ]
164
+ }, {
165
+ "long_name": "United Kingdom",
166
+ "short_name": "GB",
167
+ "types": [ "country", "political" ]
168
+ }, {
169
+ "long_name": "DD5",
170
+ "short_name": "DD5",
171
+ "types": [ "postal_code_prefix", "postal_code" ]
172
+ } ],
173
+ "geometry": {
174
+ "location": {
175
+ "lat": 56.4840193,
176
+ "lng": -2.8291620
177
+ },
178
+ "location_type": "APPROXIMATE",
179
+ "viewport": {
180
+ "southwest": {
181
+ "lat": 56.4808717,
182
+ "lng": -2.8323096
183
+ },
184
+ "northeast": {
185
+ "lat": 56.4871669,
186
+ "lng": -2.8260144
187
+ }
188
+ }
189
+ },
190
+ "partial_match": true
191
+ }, {
192
+ "types": [ "postal_code" ],
193
+ "formatted_address": "Reading RG30 4RT, UK",
194
+ "address_components": [ {
195
+ "long_name": "RG30 4RT",
196
+ "short_name": "RG30 4RT",
197
+ "types": [ "postal_code" ]
198
+ }, {
199
+ "long_name": "Reading",
200
+ "short_name": "Reading",
201
+ "types": [ "locality", "political" ]
202
+ }, {
203
+ "long_name": "Reading",
204
+ "short_name": "Reading",
205
+ "types": [ "administrative_area_level_2", "political" ]
206
+ }, {
207
+ "long_name": "United Kingdom",
208
+ "short_name": "GB",
209
+ "types": [ "country", "political" ]
210
+ }, {
211
+ "long_name": "RG30",
212
+ "short_name": "RG30",
213
+ "types": [ "postal_code_prefix", "postal_code" ]
214
+ } ],
215
+ "geometry": {
216
+ "location": {
217
+ "lat": 51.4554901,
218
+ "lng": -1.0393378
219
+ },
220
+ "location_type": "APPROXIMATE",
221
+ "viewport": {
222
+ "southwest": {
223
+ "lat": 51.4523425,
224
+ "lng": -1.0424854
225
+ },
226
+ "northeast": {
227
+ "lat": 51.4586377,
228
+ "lng": -1.0361902
229
+ }
230
+ }
231
+ },
232
+ "partial_match": true
233
+ }, {
234
+ "types": [ "postal_code" ],
235
+ "formatted_address": "Blyth, Northumberland NE24 4RT, UK",
236
+ "address_components": [ {
237
+ "long_name": "NE24 4RT",
238
+ "short_name": "NE24 4RT",
239
+ "types": [ "postal_code" ]
240
+ }, {
241
+ "long_name": "Blyth",
242
+ "short_name": "Blyth",
243
+ "types": [ "locality", "political" ]
244
+ }, {
245
+ "long_name": "Northumberland",
246
+ "short_name": "Nthumb",
247
+ "types": [ "administrative_area_level_2", "political" ]
248
+ }, {
249
+ "long_name": "United Kingdom",
250
+ "short_name": "GB",
251
+ "types": [ "country", "political" ]
252
+ }, {
253
+ "long_name": "NE24",
254
+ "short_name": "NE24",
255
+ "types": [ "postal_code_prefix", "postal_code" ]
256
+ } ],
257
+ "geometry": {
258
+ "location": {
259
+ "lat": 55.1314523,
260
+ "lng": -1.5533331
261
+ },
262
+ "location_type": "APPROXIMATE",
263
+ "viewport": {
264
+ "southwest": {
265
+ "lat": 55.1283047,
266
+ "lng": -1.5564807
267
+ },
268
+ "northeast": {
269
+ "lat": 55.1345999,
270
+ "lng": -1.5501855
271
+ }
272
+ }
273
+ },
274
+ "partial_match": true
275
+ }, {
276
+ "types": [ "postal_code" ],
277
+ "formatted_address": "Glasgow, Glasgow City G44 4RT, UK",
278
+ "address_components": [ {
279
+ "long_name": "G44 4RT",
280
+ "short_name": "G44 4RT",
281
+ "types": [ "postal_code" ]
282
+ }, {
283
+ "long_name": "Glasgow",
284
+ "short_name": "Glasgow",
285
+ "types": [ "locality", "political" ]
286
+ }, {
287
+ "long_name": "Glasgow City",
288
+ "short_name": "Glasgow City",
289
+ "types": [ "administrative_area_level_2", "political" ]
290
+ }, {
291
+ "long_name": "United Kingdom",
292
+ "short_name": "GB",
293
+ "types": [ "country", "political" ]
294
+ }, {
295
+ "long_name": "G44",
296
+ "short_name": "G44",
297
+ "types": [ "postal_code_prefix", "postal_code" ]
298
+ } ],
299
+ "geometry": {
300
+ "location": {
301
+ "lat": 55.8234812,
302
+ "lng": -4.2507991
303
+ },
304
+ "location_type": "APPROXIMATE",
305
+ "viewport": {
306
+ "southwest": {
307
+ "lat": 55.8203336,
308
+ "lng": -4.2539467
309
+ },
310
+ "northeast": {
311
+ "lat": 55.8266288,
312
+ "lng": -4.2476515
313
+ }
314
+ }
315
+ },
316
+ "partial_match": true
317
+ }, {
318
+ "types": [ "postal_code" ],
319
+ "formatted_address": "Waltham Forest, London E17 4RT, UK",
320
+ "address_components": [ {
321
+ "long_name": "E17 4RT",
322
+ "short_name": "E17 4RT",
323
+ "types": [ "postal_code" ]
324
+ }, {
325
+ "long_name": "London",
326
+ "short_name": "London",
327
+ "types": [ "locality", "political" ]
328
+ }, {
329
+ "long_name": "Walthamstow",
330
+ "short_name": "Walthamstow",
331
+ "types": [ "locality", "political" ]
332
+ }, {
333
+ "long_name": "Waltham Forest",
334
+ "short_name": "Waltham Forest",
335
+ "types": [ "administrative_area_level_3", "political" ]
336
+ }, {
337
+ "long_name": "Greater London",
338
+ "short_name": "Greater London",
339
+ "types": [ "administrative_area_level_2", "political" ]
340
+ }, {
341
+ "long_name": "United Kingdom",
342
+ "short_name": "GB",
343
+ "types": [ "country", "political" ]
344
+ }, {
345
+ "long_name": "E17",
346
+ "short_name": "E17",
347
+ "types": [ "postal_code_prefix", "postal_code" ]
348
+ } ],
349
+ "geometry": {
350
+ "location": {
351
+ "lat": 51.5853714,
352
+ "lng": -0.0192463
353
+ },
354
+ "location_type": "APPROXIMATE",
355
+ "viewport": {
356
+ "southwest": {
357
+ "lat": 51.5822238,
358
+ "lng": -0.0223939
359
+ },
360
+ "northeast": {
361
+ "lat": 51.5885190,
362
+ "lng": -0.0160987
363
+ }
364
+ }
365
+ },
366
+ "partial_match": true
367
+ }, {
368
+ "types": [ "postal_code" ],
369
+ "formatted_address": "Dunstable, Central Bedfordshire LU5 4RT, UK",
370
+ "address_components": [ {
371
+ "long_name": "LU5 4RT",
372
+ "short_name": "LU5 4RT",
373
+ "types": [ "postal_code" ]
374
+ }, {
375
+ "long_name": "Dunstable",
376
+ "short_name": "Dunstable",
377
+ "types": [ "locality", "political" ]
378
+ }, {
379
+ "long_name": "Central Bedfordshire",
380
+ "short_name": "Central Bedfordshire",
381
+ "types": [ "administrative_area_level_2", "political" ]
382
+ }, {
383
+ "long_name": "United Kingdom",
384
+ "short_name": "GB",
385
+ "types": [ "country", "political" ]
386
+ }, {
387
+ "long_name": "LU5",
388
+ "short_name": "LU5",
389
+ "types": [ "postal_code_prefix", "postal_code" ]
390
+ } ],
391
+ "geometry": {
392
+ "location": {
393
+ "lat": 51.8869978,
394
+ "lng": -0.5175666
395
+ },
396
+ "location_type": "APPROXIMATE",
397
+ "viewport": {
398
+ "southwest": {
399
+ "lat": 51.8838502,
400
+ "lng": -0.5207142
401
+ },
402
+ "northeast": {
403
+ "lat": 51.8901454,
404
+ "lng": -0.5144190
405
+ }
406
+ }
407
+ },
408
+ "partial_match": true
409
+ }, {
410
+ "types": [ "postal_code" ],
411
+ "formatted_address": "Newton Aycliffe, County Durham DL5 4RT, UK",
412
+ "address_components": [ {
413
+ "long_name": "DL5 4RT",
414
+ "short_name": "DL5 4RT",
415
+ "types": [ "postal_code" ]
416
+ }, {
417
+ "long_name": "Newton Aycliffe",
418
+ "short_name": "Newton Aycliffe",
419
+ "types": [ "locality", "political" ]
420
+ }, {
421
+ "long_name": "Great Aycliffe",
422
+ "short_name": "Great Aycliffe",
423
+ "types": [ "locality", "political" ]
424
+ }, {
425
+ "long_name": "Durham",
426
+ "short_name": "Dur",
427
+ "types": [ "administrative_area_level_2", "political" ]
428
+ }, {
429
+ "long_name": "United Kingdom",
430
+ "short_name": "GB",
431
+ "types": [ "country", "political" ]
432
+ }, {
433
+ "long_name": "DL5",
434
+ "short_name": "DL5",
435
+ "types": [ "postal_code_prefix", "postal_code" ]
436
+ } ],
437
+ "geometry": {
438
+ "location": {
439
+ "lat": 54.6323273,
440
+ "lng": -1.5704658
441
+ },
442
+ "location_type": "APPROXIMATE",
443
+ "viewport": {
444
+ "southwest": {
445
+ "lat": 54.6291797,
446
+ "lng": -1.5736134
447
+ },
448
+ "northeast": {
449
+ "lat": 54.6354749,
450
+ "lng": -1.5673182
451
+ }
452
+ }
453
+ },
454
+ "partial_match": true
455
+ } ]
456
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "status": "OK",
3
+ "results": [ {
4
+ "types": [ "street_address" ],
5
+ "formatted_address": "4 Penn Plaza, New York, NY 10001, USA",
6
+ "address_components": [ {
7
+ "long_name": "4",
8
+ "short_name": "4",
9
+ "types": [ "street_number" ]
10
+ }, {
11
+ "long_name": "Penn Plaza",
12
+ "short_name": "Penn Plaza",
13
+ "types": [ "route" ]
14
+ }, {
15
+ "long_name": "Manhattan",
16
+ "short_name": "Manhattan",
17
+ "types": [ "sublocality", "political" ]
18
+ }, {
19
+ "long_name": "New York",
20
+ "short_name": "New York",
21
+ "types": [ "locality", "political" ]
22
+ }, {
23
+ "long_name": "New York",
24
+ "short_name": "New York",
25
+ "types": [ "administrative_area_level_2", "political" ]
26
+ }, {
27
+ "long_name": "New York",
28
+ "short_name": "NY",
29
+ "types": [ "administrative_area_level_1", "political" ]
30
+ }, {
31
+ "long_name": "United States",
32
+ "short_name": "US",
33
+ "types": [ "country", "political" ]
34
+ }, {
35
+ "long_name": "10001",
36
+ "short_name": "10001",
37
+ "types": [ "postal_code" ]
38
+ } ],
39
+ "geometry": {
40
+ "location": {
41
+ "lat": 40.7503540,
42
+ "lng": -73.9933710
43
+ },
44
+ "location_type": "ROOFTOP",
45
+ "viewport": {
46
+ "southwest": {
47
+ "lat": 40.7473324,
48
+ "lng": -73.9965316
49
+ },
50
+ "northeast": {
51
+ "lat": 40.7536276,
52
+ "lng": -73.9902364
53
+ }
54
+ }
55
+ }
56
+ } ]
57
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "status": "OK",
3
+ "results": [ {
4
+ "types": [ "postal_code" ],
5
+ "formatted_address": "55100, Turkey",
6
+ "address_components": [{
7
+ "long_name": "55100",
8
+ "short_name": "55100",
9
+ "types": ["postal_code"]
10
+ },
11
+ {
12
+ "long_name": "Turkey",
13
+ "short_name": "TR",
14
+ "types": ["country", "political"]
15
+ }],
16
+ "geometry": {
17
+ "location": {
18
+ "lat": 41.3112221,
19
+ "lng": 36.3322118
20
+ },
21
+ "location_type": "APPROXIMATE",
22
+ "viewport": {
23
+ "southwest": {
24
+ "lat": 41.2933411,
25
+ "lng": 36.3066331
26
+ },
27
+ "northeast": {
28
+ "lat": 41.3291031,
29
+ "lng": 36.3577906
30
+ }
31
+ },
32
+ "bounds": {
33
+ "southwest": {
34
+ "lat": 41.2933411,
35
+ "lng": 36.3066331
36
+ },
37
+ "northeast": {
38
+ "lat": 41.3291031,
39
+ "lng": 36.3577906
40
+ }
41
+ }
42
+ }
43
+ } ]
44
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "status": "OK",
3
+ "results": [ {
4
+ "types": [ "route" ],
5
+ "formatted_address": "Al Ahram, Haram, Giza, Egypt",
6
+ "address_components": [ {
7
+ "long_name": "Al Ahram",
8
+ "short_name": "Al Ahram",
9
+ "types": [ "route" ]
10
+ }, {
11
+ "long_name": "Haram",
12
+ "short_name": "Haram",
13
+ "types": [ "administrative_area_level_2", "political" ]
14
+ }, {
15
+ "long_name": "Al Jizah",
16
+ "short_name": "Al Jizah",
17
+ "types": [ "administrative_area_level_1", "political" ]
18
+ }, {
19
+ "long_name": "Egypt",
20
+ "short_name": "EG",
21
+ "types": [ "country", "political" ]
22
+ } ],
23
+ "geometry": {
24
+ "location": {
25
+ "lat": 29.9803527,
26
+ "lng": 31.1330307
27
+ },
28
+ "location_type": "APPROXIMATE",
29
+ "viewport": {
30
+ "southwest": {
31
+ "lat": 29.9768276,
32
+ "lng": 31.1302189
33
+ },
34
+ "northeast": {
35
+ "lat": 29.9831228,
36
+ "lng": 31.1365141
37
+ }
38
+ },
39
+ "bounds": {
40
+ "southwest": {
41
+ "lat": 29.9775337,
42
+ "lng": 31.1327483
43
+ },
44
+ "northeast": {
45
+ "lat": 29.9824167,
46
+ "lng": 31.1339847
47
+ }
48
+ }
49
+ }
50
+ } ]
51
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "status": "ZERO_RESULTS",
3
+ "results": [ ]
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "status": "OVER_QUERY_LIMIT",
3
+ "results": [ ]
4
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "results": [
3
+ {
4
+ "locations": []
5
+ }
6
+ ],
7
+ "info": {
8
+ "copyright": {
9
+ "text": "© 2012 MapQuest, Inc.",
10
+ "imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
11
+ "imageAltText": "© 2012 MapQuest, Inc."
12
+ },
13
+ "statuscode": 500,
14
+ "messages": ["Error processing request: ..."]
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "results": [
3
+ {
4
+ "locations": []
5
+ }
6
+ ],
7
+ "info": {
8
+ "copyright": {
9
+ "text": "© 2012 MapQuest, Inc.",
10
+ "imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
11
+ "imageAltText": "© 2012 MapQuest, Inc."
12
+ },
13
+ "statuscode": 403,
14
+ "messages": ["..."]
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "results": [
3
+ {
4
+ "locations": []
5
+ }
6
+ ],
7
+ "info": {
8
+ "copyright": {
9
+ "text": "© 2012 MapQuest, Inc.",
10
+ "imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
11
+ "imageAltText": "© 2012 MapQuest, Inc."
12
+ },
13
+ "statuscode": 400,
14
+ "messages": ["Illegal argument from request: ..."]
15
+ }
16
+ }