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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gps_tools/geometry.rb +28 -0
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab1aed7260c6af3b0c702d324ac9f5f2b1def10dca3c0b1f9e8365e575360a8b
4
- data.tar.gz: 3b0fd3d99b8a363afddcf289f6b2b1bd8f3a8396271c176060c37d043400f879
3
+ metadata.gz: 20a5a7c3db5394c3e76b92f6da638982519d088beffd691e88ed2f85bf119fe6
4
+ data.tar.gz: 16269d2c415e67a027c1e6accb113843f784e9b36f7ecb0378389047473e74c4
5
5
  SHA512:
6
- metadata.gz: 11813f0d7162599d79b9a304a26844560f5becd4959ad4ffc4ff5f443102636f7ade3eaa0cac716220858707582e44a6ec0d3ea60ac53edaaf0fe728d82d089b
7
- data.tar.gz: ec6395e448fd121fa1ada673c678a814663feacc2f215c140f950fb7df37f53b67310698913064e7945c90a1eab2366750c66ae8c50df19b3f6ccd7e0ee88f77
6
+ metadata.gz: 07a61bce7603d0dfcda9ec1c07d27284d22cfffe813f46cf174f48bbdc8dc10975074d883b42b1a92d704506601e5f635726b38bbd1b9571e6b601265b0f3d55
7
+ data.tar.gz: 8a59aeea040d467abe360e47c1314a5abdf946f534079e459146ba26732841b2d499a60a0cbc581efaacc5a6362fd98e8d11cd3b8ecb4b0ea66aa37f10aa682b
@@ -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.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-08-05 00:00:00.000000000 Z
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://rubygems.org/gems/gps_tools
37
+ homepage: https://github.com/davevanfleet/ruby_gps_tools
38
38
  licenses:
39
39
  - MIT
40
40
  metadata: {}