geocoder 1.6.2 → 1.6.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/bin/console +6 -0
- data/lib/geocoder/ip_address.rb +2 -1
- data/lib/geocoder/lookups/esri.rb +2 -0
- data/lib/geocoder/lookups/latlon.rb +1 -2
- data/lib/geocoder/lookups/smarty_streets.rb +6 -1
- data/lib/geocoder/lookups/telize.rb +1 -1
- data/lib/geocoder/lookups/yandex.rb +1 -2
- data/lib/geocoder/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8ab5b6c482a72aa85d0594577eb88c912ae9304254f006b9f7a37818318c94b
|
4
|
+
data.tar.gz: d2a71cc1cd294237c006ade75db89a99a2a01e31515eefc825aa833cb136acaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1badbbf1f2633044d3f9a3ce56cf89f1573538795128c945102c02141f76304dc6c3ef98fef8befe0b9865871beec1cd98109290f05c28cbc042162d084af3a9
|
7
|
+
data.tar.gz: 3edf26f306e5a72a764a0def55a74eeff0652e90956b3cba26d44e7c51a5746df01a6ae09639ea61773768b0ffd58be888bca687a3427f2e1e5cec202c12aa02
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@ Changelog
|
|
3
3
|
|
4
4
|
Major changes to Geocoder for each release. Please see the Git log for complete list of changes.
|
5
5
|
|
6
|
+
1.6.3 (2020 Apr 30)
|
7
|
+
-------------------
|
8
|
+
* Update URL for :telize lookup (thanks github.com/alexwalling).
|
9
|
+
* Fix bug parsing IPv6 with port (thanks github.com/gdomingu).
|
10
|
+
|
6
11
|
1.6.2 (2020 Mar 16)
|
7
12
|
-------------------
|
8
13
|
* Add support for :nationaal_georegister_nl lookup (thanks github.com/opensourceame).
|
data/bin/console
CHANGED
data/lib/geocoder/ip_address.rb
CHANGED
@@ -47,6 +47,8 @@ module Geocoder::Lookup
|
|
47
47
|
params[:forStorage] = for_storage_value
|
48
48
|
end
|
49
49
|
params[:sourceCountry] = configuration[:source_country] if configuration[:source_country]
|
50
|
+
params[:preferredLabelValues] = configuration[:preferred_label_values] if configuration[:preferred_label_values]
|
51
|
+
|
50
52
|
params.merge(super)
|
51
53
|
end
|
52
54
|
|
@@ -25,8 +25,7 @@ module Geocoder::Lookup
|
|
25
25
|
# The API returned a 404 response, which indicates no results found
|
26
26
|
elsif doc['error']['type'] == 'api_error'
|
27
27
|
[]
|
28
|
-
elsif
|
29
|
-
doc['error']['type'] == 'authentication_error'
|
28
|
+
elsif doc['error']['type'] == 'authentication_error'
|
30
29
|
raise_error(Geocoder::InvalidApiKey) ||
|
31
30
|
Geocoder.log(:warn, "LatLon.io service error: invalid API key.")
|
32
31
|
else
|
@@ -57,7 +57,12 @@ module Geocoder::Lookup
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def results(query)
|
60
|
-
fetch_data(query) || []
|
60
|
+
doc = fetch_data(query) || []
|
61
|
+
if doc.is_a?(Hash) and doc.key?('status') # implies there's an error
|
62
|
+
return []
|
63
|
+
else
|
64
|
+
return doc
|
65
|
+
end
|
61
66
|
end
|
62
67
|
end
|
63
68
|
end
|
@@ -16,7 +16,7 @@ module Geocoder::Lookup
|
|
16
16
|
if configuration[:host]
|
17
17
|
"#{protocol}://#{configuration[:host]}/location/#{query.sanitized_text}"
|
18
18
|
else
|
19
|
-
"#{protocol}://telize-v1.p.
|
19
|
+
"#{protocol}://telize-v1.p.rapidapi.com/location/#{query.sanitized_text}?rapidapi-key=#{api_key}"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -33,8 +33,7 @@ module Geocoder::Lookup
|
|
33
33
|
return []
|
34
34
|
end
|
35
35
|
if doc = doc['response']['GeoObjectCollection']
|
36
|
-
|
37
|
-
return meta['found'].to_i > 0 ? doc['featureMember'] : []
|
36
|
+
return doc['featureMember'].to_a
|
38
37
|
else
|
39
38
|
Geocoder.log(:warn, "Yandex Geocoding API error: unexpected response format.")
|
40
39
|
return []
|
data/lib/geocoder/version.rb
CHANGED
metadata
CHANGED
@@ -1,19 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geocoder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Reisner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
|
15
|
-
|
16
|
-
frameworks too.
|
13
|
+
description: Object geocoding (by street or IP address), reverse geocoding (coordinates
|
14
|
+
to street address), distance queries for ActiveRecord and Mongoid, result caching,
|
15
|
+
and more. Designed for Rails but works with Sinatra and other Rack frameworks too.
|
17
16
|
email:
|
18
17
|
- alex@alexreisner.com
|
19
18
|
executables:
|
@@ -186,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
185
|
- !ruby/object:Gem::Version
|
187
186
|
version: '0'
|
188
187
|
requirements: []
|
189
|
-
rubygems_version: 3.
|
188
|
+
rubygems_version: 3.1.2
|
190
189
|
signing_key:
|
191
190
|
specification_version: 4
|
192
191
|
summary: Complete geocoding solution for Ruby.
|