uk_county_locator 0.1.3 → 0.1.4
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2fb8e6a5181df9742a4a7a1acbfa5bd120af1a6b07ffa2927fdfe9faaf76944e
|
|
4
|
+
data.tar.gz: cb046d44f777d5e2fa3a173a2414cc8f4bd78ce8a7b423f5817dd04abac474b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71456f516ad63de88470e08b26f58cef9b2dcaa08efeb0cbadb96f5e2674bf1da54cdb3b4c940b48b4368a1612e63d332365dbd7370caccbc508b8faf50e8013
|
|
7
|
+
data.tar.gz: 2a2d198c745702f1ee0fdef73e8c5548f95d9fda3fe6473b889544483a335632471d2016e64d3733a89b67075e5a372cabb8d29f1ac95caa4e327f4c01dc61d1
|
|
@@ -15,12 +15,12 @@ class PolylinesService
|
|
|
15
15
|
Polylines::Decoder.decode_polyline(polygon).map { |lng, lat| Geokit::LatLng.new(lat, lng) }
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def
|
|
18
|
+
def located_county(polygons)
|
|
19
19
|
return nil if @point.nil?
|
|
20
20
|
|
|
21
21
|
polygons.detect do |name, polygon|
|
|
22
22
|
geo_polygon = Geokit::Polygon.new(polygon_to_array(polygon: polygon))
|
|
23
23
|
geo_polygon.contains?(@point) ? name : nil
|
|
24
|
-
end
|
|
24
|
+
end&.first
|
|
25
25
|
end
|
|
26
26
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: uk_county_locator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Edward Beesley
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: geokit
|
|
@@ -50,7 +49,6 @@ dependencies:
|
|
|
50
49
|
- - "<"
|
|
51
50
|
- !ruby/object:Gem::Version
|
|
52
51
|
version: '1.0'
|
|
53
|
-
description:
|
|
54
52
|
email:
|
|
55
53
|
- ed@homeflow.co.uk
|
|
56
54
|
executables: []
|
|
@@ -89,7 +87,6 @@ metadata:
|
|
|
89
87
|
homepage_uri: https://github.com/EdBeese/uk_county_locator
|
|
90
88
|
source_code_uri: https://github.com/EdBeese/uk_county_locator
|
|
91
89
|
changelog_uri: https://github.com/EdBeese/uk_county_locator/blob/main/CHANGELOG.md
|
|
92
|
-
post_install_message:
|
|
93
90
|
rdoc_options: []
|
|
94
91
|
require_paths:
|
|
95
92
|
- lib
|
|
@@ -104,8 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
104
101
|
- !ruby/object:Gem::Version
|
|
105
102
|
version: '0'
|
|
106
103
|
requirements: []
|
|
107
|
-
rubygems_version: 3.
|
|
108
|
-
signing_key:
|
|
104
|
+
rubygems_version: 3.7.0
|
|
109
105
|
specification_version: 4
|
|
110
106
|
summary: A Ruby gem that stores encoded polygon data for UK counties, with the ability
|
|
111
107
|
to return county information for given coordinates.
|