opencage-geocoder 3.2.3 → 3.3.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.
- checksums.yaml +4 -4
- data/lib/opencage/geocoder.rb +8 -2
- data/lib/opencage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45e3aaf792a2656cbc247597b8e27c3bffb8e331bd248c98be68750b20d67652
|
4
|
+
data.tar.gz: 3268bd32f449039f56e1c238921bbd4a393a89044b169be076ea7f6d5f58c9a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e71c5fb262ff2c074446c67321312bc2765286ad944aa87de1c64d72944a1c8be12868b89ad6a9d2e1ea54fa0e171342c3bd53637d3ee9b3c724f6024c38109a
|
7
|
+
data.tar.gz: f5eaa954287623edb411a2ab96610859e8e29c104e6daf2710ad6b0d308bd8d172786f48d65b3ffabd2ebf6998a8ad11f38101dcd34ded5770f5e48088c6b1ce
|
data/lib/opencage/geocoder.rb
CHANGED
@@ -13,6 +13,8 @@ module OpenCage
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def geocode(location, options = {})
|
16
|
+
raise_error("400 Not a valid location: `#{location.inspect}`") unless location.is_a?(String)
|
17
|
+
|
16
18
|
request = Request.new(@api_key, location, options)
|
17
19
|
|
18
20
|
begin
|
@@ -32,8 +34,12 @@ module OpenCage
|
|
32
34
|
end
|
33
35
|
|
34
36
|
def reverse_geocode(lat, lng, options = {})
|
35
|
-
|
36
|
-
|
37
|
+
begin
|
38
|
+
lat = to_float(lat)
|
39
|
+
lng = to_float(lng)
|
40
|
+
rescue TypeError
|
41
|
+
raise_error("400 Not valid numeric coordinates: #{lat.inspect}, #{lng.inspect}")
|
42
|
+
end
|
37
43
|
|
38
44
|
if [lat, lng].any? { |coord| !coord.is_a?(Numeric) }
|
39
45
|
raise_error("400 Not valid numeric coordinates: #{lat.inspect}, #{lng.inspect}")
|
data/lib/opencage/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opencage-geocoder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Scully
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-10-06 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A client for the OpenCage geocoding API - https://opencagedata.com/
|
15
15
|
email: support@opencagedata.com
|