geospatial 1.11.0 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a15f884e8fc62ca572350c690792482e3101b397666448b40ef593d2232a7b91
4
- data.tar.gz: 4b0496f1e95f31815e6b2ae1a7bcc32b84d27f811dc7a8415644677ce3c86900
3
+ metadata.gz: 93f2203f7a1b83d37a2baa63f70ef67cddb542c734c7ce75a0a4d23be7484df3
4
+ data.tar.gz: 5238f1ccbd55623cc06571926b7483c4b2b2ca10df0ce8c8acffc99c9008356e
5
5
  SHA512:
6
- metadata.gz: 3b44013f4d1d7b0dbf17f72d4a5b38b9d28bd5121418474136ca88f1eae31e3d7cf830175132916e763e402d913143ece97a3a4dff89bfe952ff44c03097f16f
7
- data.tar.gz: f8f6d5273690dbfbe921b6d79e32cc4ee4b607f43ef25c894ec45427ca0eb08d90b4936cd426dc75685dfed54f27f231eca91f5fd31e049ebb2cd43e41e72056
6
+ metadata.gz: c2a9c85d10e38208311bf0cd006ff368dcbb2e882446c0763547725f87c401d117626bca439c93058f9c9ce620ae91987dea246cc82758e4e5e27fee0d508c30
7
+ data.tar.gz: 69e0a11e4af435879ebe579c0523dd2911c9cf380817068c07b18baea3d76fb2f49f4124d32eea4f98fe24bc602ab07a49812e6ddc21ce7f66cacc4890d08bce
@@ -32,6 +32,12 @@ module Geospatial
32
32
  attr :offset
33
33
  attr :scale
34
34
 
35
+ def bins= bins
36
+ raise ArgumentError, "Incorrect length" unless bins.size == @size
37
+
38
+ @bins = bins
39
+ end
40
+
35
41
  def [] index
36
42
  @bins[index]
37
43
  end
@@ -38,13 +38,13 @@ module Geospatial
38
38
  R2D = (180.0 / Math::PI)
39
39
  D2R = (Math::PI / 180.0)
40
40
 
41
- MIN_LONGITUDE = -180 * D2R
42
- MAX_LONGITUDE = 180 * D2R
43
- VALID_LONGITUDE = MIN_LONGITUDE...MAX_LONGITUDE
41
+ MIN_LONGITUDE = -180.0 * D2R
42
+ MAX_LONGITUDE = 180.0 * D2R
43
+ VALID_LONGITUDE = -180.0...180.0
44
44
 
45
45
  MIN_LATITUDE = -90.0 * D2R
46
- MAX_LATITUDE = 90 * D2R
47
- VALID_LATITUDE = MIN_LATITUDE...MAX_LATITUDE
46
+ MAX_LATITUDE = 90.0 * D2R
47
+ VALID_LATITUDE = -90.0...90.0
48
48
 
49
49
  class << self
50
50
  def from_ecef(x, y, z)
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Geospatial
22
- VERSION = "1.11.0"
22
+ VERSION = "1.11.1"
23
23
  end
@@ -25,6 +25,11 @@ RSpec.describe Geospatial::Location do
25
25
  let(:lake_tekapo) {Geospatial::Location.new(170.53, -43.89)}
26
26
  let(:lake_alex) {Geospatial::Location.new(170.45, -43.94)}
27
27
 
28
+ it "should be valid" do
29
+ expect(lake_tekapo).to be_valid
30
+ expect(lake_alex).to be_valid
31
+ end
32
+
28
33
  it "should compute the correct distance between two points" do
29
34
  expect(lake_alex.distance_from(lake_tekapo)).to be_within(100).of(8_500)
30
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geospatial
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-23 00:00:00.000000000 Z
11
+ date: 2018-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec