proximityhash 0.1.0 → 0.1.1
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 +5 -5
- data/VERSION +1 -1
- data/proximityhash.gemspec +1 -1
- data/spec/proximityhash_spec.rb +21 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5e5daa846445b2a7d64af9bb432229ac729653e0267f7882a17b00d0bdf075f7
|
4
|
+
data.tar.gz: 2b938bf962f90db65e65881a3904891bfca32230506f282a31024d1cff4f3f43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a3ac7d9cc3572eaab83eaa0bd2fbf79ba4889c8afb0eeb555eacde7d2db01d7b34f3297af1f7029262d8ec20cf9c2bdd94a3269706e8086b5b10636c1b09136
|
7
|
+
data.tar.gz: 790cf919a8a4bc04f139aaba39d55b1425e5ee202150b393434ef1bf6e16041863a88c6073b6a614bb3cb895ef64925f7d1c0887adf630921210086fbb607b66
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/proximityhash.gemspec
CHANGED
data/spec/proximityhash_spec.rb
CHANGED
@@ -2,9 +2,14 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Proximity Hash' do
|
4
4
|
|
5
|
+
latitude = 12.0
|
6
|
+
longitude = 77.0
|
7
|
+
distance = 20.0
|
8
|
+
precision = 8
|
9
|
+
|
5
10
|
it 'calculates expected geohashes in distance order' do
|
6
11
|
|
7
|
-
ph = ProximityHash.new(
|
12
|
+
ph = ProximityHash.new(latitude, longitude, distance, precision)
|
8
13
|
hashes = ph.calculate
|
9
14
|
|
10
15
|
expected = [
|
@@ -18,4 +23,18 @@ describe 'Proximity Hash' do
|
|
18
23
|
expect(hashes.keys).to eq(expected)
|
19
24
|
end
|
20
25
|
|
21
|
-
|
26
|
+
it 'includes source point' do
|
27
|
+
source = GeoHash.encode(latitude, longitude, precision)
|
28
|
+
expected = [
|
29
|
+
'tdnu20tc', 'tdnu20t9',
|
30
|
+
'tdnu20tb', 'tdnu20t8',
|
31
|
+
'tdnu20tf', 'tdnu20td',
|
32
|
+
'tdnu20mz', 'tdnu20mx',
|
33
|
+
'tdnu20t3', 'tdnu20t2',
|
34
|
+
source
|
35
|
+
]
|
36
|
+
|
37
|
+
expect(hashes.keys).to eq(expected)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proximityhash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lloyd Watkin
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.7.6
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Calculates geohashes within a radius from a point
|