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 +4 -4
- data/lib/geospatial/histogram.rb +6 -0
- data/lib/geospatial/location.rb +5 -5
- data/lib/geospatial/version.rb +1 -1
- data/spec/geospatial/location_spec.rb +5 -0
- 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: 93f2203f7a1b83d37a2baa63f70ef67cddb542c734c7ce75a0a4d23be7484df3
|
4
|
+
data.tar.gz: 5238f1ccbd55623cc06571926b7483c4b2b2ca10df0ce8c8acffc99c9008356e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2a9c85d10e38208311bf0cd006ff368dcbb2e882446c0763547725f87c401d117626bca439c93058f9c9ce620ae91987dea246cc82758e4e5e27fee0d508c30
|
7
|
+
data.tar.gz: 69e0a11e4af435879ebe579c0523dd2911c9cf380817068c07b18baea3d76fb2f49f4124d32eea4f98fe24bc602ab07a49812e6ddc21ce7f66cacc4890d08bce
|
data/lib/geospatial/histogram.rb
CHANGED
data/lib/geospatial/location.rb
CHANGED
@@ -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 =
|
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 =
|
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)
|
data/lib/geospatial/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2018-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|