gps_tools 0.1.1 → 0.1.2
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/gps_tools/geometry.rb +28 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20a5a7c3db5394c3e76b92f6da638982519d088beffd691e88ed2f85bf119fe6
|
4
|
+
data.tar.gz: 16269d2c415e67a027c1e6accb113843f784e9b36f7ecb0378389047473e74c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07a61bce7603d0dfcda9ec1c07d27284d22cfffe813f46cf174f48bbdc8dc10975074d883b42b1a92d704506601e5f635726b38bbd1b9571e6b601265b0f3d55
|
7
|
+
data.tar.gz: 8a59aeea040d467abe360e47c1314a5abdf946f534079e459146ba26732841b2d499a60a0cbc581efaacc5a6362fd98e8d11cd3b8ecb4b0ea66aa37f10aa682b
|
data/lib/gps_tools/geometry.rb
CHANGED
@@ -59,6 +59,34 @@ class GPSTools::Geometry
|
|
59
59
|
coords.select{ |coord| in_radius?(radius, center, coord) }
|
60
60
|
end
|
61
61
|
|
62
|
+
##
|
63
|
+
# Accepts polygon (array of [lat, lng]) and returns greatest lat
|
64
|
+
def max_lat(polygon)
|
65
|
+
lats = polygon.map { |coord| coord[0]}
|
66
|
+
lats.max
|
67
|
+
end
|
68
|
+
|
69
|
+
##
|
70
|
+
# Accepts polygon (array of [lat, lng]) and returns greatest lng
|
71
|
+
def max_lng(polygon)
|
72
|
+
lngs = polygon.map { |coord| coord[1]}
|
73
|
+
lngs.max
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Accepts polygon (array of [lat, lng]) and returns smallest lat
|
78
|
+
def min_lat(polygon)
|
79
|
+
lats = polygon.map { |coord| coord[0]}
|
80
|
+
lats.min
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Accepts polygon (array of [lat, lng]) and returns greatest lat
|
85
|
+
def min_lng(polygon)
|
86
|
+
lngs = polygon.map { |coord| coord[1]}
|
87
|
+
lngs.min
|
88
|
+
end
|
89
|
+
|
62
90
|
private
|
63
91
|
def max(a, b)
|
64
92
|
a > b ? a : b
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gps_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Van Fleet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -34,7 +34,7 @@ files:
|
|
34
34
|
- lib/gps_tools.rb
|
35
35
|
- lib/gps_tools/distance.rb
|
36
36
|
- lib/gps_tools/geometry.rb
|
37
|
-
homepage: https://
|
37
|
+
homepage: https://github.com/davevanfleet/ruby_gps_tools
|
38
38
|
licenses:
|
39
39
|
- MIT
|
40
40
|
metadata: {}
|