geohashr 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.travis.yml +2 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile.ci +6 -0
- data/Manifest.txt +1 -0
- data/README.md +1 -0
- data/geohashr.gemspec +7 -8
- data/lib/geohashr/geohash.rb +2 -2
- data/lib/geohashr/version.rb +1 -1
- data/test/helper.rb +0 -1
- data/test/test_geohashr.rb +43 -0
- metadata +20 -19
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NDI5YmY3Yjg1YTlkY2M2MmMwZjVlOWQxYmRkNjYxZTkxNzEyZDE2Yw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c33c4aef0a581de54764ca0e1ffe3faa26007224
|
4
|
+
data.tar.gz: 2b24273afc4923d3e761ce43352618527866de80
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZjJlNmU2YTgyYmNjZmM5NDRkYWM1ZWVjYjYyOWUxMDQwZDM2YzEwMmFkNjgy
|
11
|
-
ZWIxMmExMGMyMzU0ZmY5ZmFhMjdmMTU1MzgzYmU4YzEwMTBjYjY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MjkxYTAwNTNjYmEwNDQ5MmUwMTJkNjRjNjg3ZTk5MmFhMDYzNDdjYWZlNjZh
|
14
|
-
YjI2MGM5MDE3YzMxZTljMDQ2NTE3ZjYxMjczYzQ4NTViZWI4YmY1MzEzNTQ0
|
15
|
-
YTcxODEwZWI5MDdhM2ZkNjY0MWM3NDc5NWNmODg0N2VhYWQ1NGU=
|
6
|
+
metadata.gz: ba972d4b877bb934bb0e386637d3ab827cff7d12a5713ae01e3f41e994d1d78606a1964216b5f85b7976d3e2d1be003a7c63c536a8df5825efdfa3b0020e7461
|
7
|
+
data.tar.gz: 8ae51afa357ac619b36d267cf5ff94b1bcd3209659f580db68ac5c71921495e90f15f4855e78ebd9b0c9ecac37a10da69148a1f7e53289bce48599d74ed484a6
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.ci
ADDED
data/Manifest.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Geohashr
|
2
2
|
[![Version][Version image]][Version]
|
3
3
|
[![Build][Build image]][Build]
|
4
|
+
[![Coverage][Coverage image]][Coverage]
|
4
5
|
|
5
6
|
Geohash is a latitude/longitude geocoding system. It is a hierarchical
|
6
7
|
spatial data structure which subdivides space into buckets of grid shape.
|
data/geohashr.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: geohashr 0.
|
2
|
+
# stub: geohashr 0.2.0.20141108200404 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "geohashr"
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.2.0.20141108200404"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["JohnnyT"]
|
11
|
-
s.date = "2014-
|
11
|
+
s.date = "2014-11-09"
|
12
12
|
s.description = "GeoHash - encode, decode, neighbors"
|
13
13
|
s.email = ["ubergeek3141@gmail.com"]
|
14
14
|
s.extra_rdoc_files = ["CHANGELOG.md", "CONTRIBUTING.md", "LICENSE.txt", "Manifest.txt", "README.md"]
|
@@ -16,8 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.homepage = "https://github.com/johnnyt/geohashr"
|
17
17
|
s.licenses = ["MIT"]
|
18
18
|
s.rdoc_options = ["--main", "README.md"]
|
19
|
-
s.
|
20
|
-
s.rubygems_version = "2.2.1"
|
19
|
+
s.rubygems_version = "2.4.0"
|
21
20
|
s.summary = "GeoHash - encode, decode, neighbors"
|
22
21
|
s.test_files = ["test/test_geohashr.rb"]
|
23
22
|
|
@@ -27,15 +26,15 @@ Gem::Specification.new do |s|
|
|
27
26
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
28
27
|
s.add_development_dependency(%q<minitest>, ["~> 5.2"])
|
29
28
|
s.add_development_dependency(%q<coveralls>, ["~> 1.0"])
|
30
|
-
s.add_development_dependency(%q<hoe>, ["~> 3.
|
29
|
+
s.add_development_dependency(%q<hoe>, ["~> 3.12"])
|
31
30
|
else
|
32
31
|
s.add_dependency(%q<minitest>, ["~> 5.2"])
|
33
32
|
s.add_dependency(%q<coveralls>, ["~> 1.0"])
|
34
|
-
s.add_dependency(%q<hoe>, ["~> 3.
|
33
|
+
s.add_dependency(%q<hoe>, ["~> 3.12"])
|
35
34
|
end
|
36
35
|
else
|
37
36
|
s.add_dependency(%q<minitest>, ["~> 5.2"])
|
38
37
|
s.add_dependency(%q<coveralls>, ["~> 1.0"])
|
39
|
-
s.add_dependency(%q<hoe>, ["~> 3.
|
38
|
+
s.add_dependency(%q<hoe>, ["~> 3.12"])
|
40
39
|
end
|
41
40
|
end
|
data/lib/geohashr/geohash.rb
CHANGED
data/lib/geohashr/version.rb
CHANGED
data/test/helper.rb
CHANGED
data/test/test_geohashr.rb
CHANGED
@@ -16,6 +16,49 @@ class TestGeohashr < Minitest::Test
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
# bcfguvyz prxz
|
20
|
+
# 89destwx nqwy
|
21
|
+
# 2367kmqr jmtv
|
22
|
+
# 0145hjnp hksu
|
23
|
+
# 57eg
|
24
|
+
# 46df
|
25
|
+
# 139c
|
26
|
+
# 028b
|
27
|
+
|
28
|
+
def test_x_y
|
29
|
+
{
|
30
|
+
'0' => [0,0],
|
31
|
+
'1' => [1,0],
|
32
|
+
'2' => [0,1],
|
33
|
+
'x' => [7,2],
|
34
|
+
'y' => [6,3],
|
35
|
+
'z' => [7,3],
|
36
|
+
|
37
|
+
'00' => [0,0],
|
38
|
+
'01' => [0,1],
|
39
|
+
'02' => [1,0],
|
40
|
+
'0x' => [2,7],
|
41
|
+
'0y' => [3,6],
|
42
|
+
'0z' => [3,7],
|
43
|
+
|
44
|
+
'zz' => [31,31],
|
45
|
+
'zzz' => [255, 127],
|
46
|
+
'zzzz' => [1023,1023],
|
47
|
+
'zzzzz' => [8191,4095],
|
48
|
+
'zzzzzz' => [32767,32767],
|
49
|
+
'zzzzzzz' => [262143,131071],
|
50
|
+
'zzzzzzzz' => [1048575,1048575],
|
51
|
+
'zzzzzzzzz' => [8388607,4194303],
|
52
|
+
'zzzzzzzzzz' => [33554431,33554431],
|
53
|
+
'zzzzzzzzzzz' => [268435455,134217727],
|
54
|
+
'zzzzzzzzzzzz' => [1073741823,1073741823]
|
55
|
+
|
56
|
+
}.each do |hash, coord|
|
57
|
+
gh = GeoHashr::GeoHash.new(hash)
|
58
|
+
assert_equal [gh.x, gh.y], coord
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
19
62
|
#def test_encode
|
20
63
|
# {
|
21
64
|
# [ 45.37, -121.7 ] => 'c216ne',
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geohashr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JohnnyT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: coveralls
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hoe
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.12'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.12'
|
55
55
|
description: GeoHash - encode, decode, neighbors
|
56
56
|
email:
|
57
57
|
- ubergeek3141@gmail.com
|
@@ -64,12 +64,13 @@ extra_rdoc_files:
|
|
64
64
|
- Manifest.txt
|
65
65
|
- README.md
|
66
66
|
files:
|
67
|
-
- .coveralls.yml
|
68
|
-
- .gemtest
|
69
|
-
- .gitignore
|
70
|
-
- .travis.yml
|
67
|
+
- ".coveralls.yml"
|
68
|
+
- ".gemtest"
|
69
|
+
- ".gitignore"
|
70
|
+
- ".travis.yml"
|
71
71
|
- CHANGELOG.md
|
72
72
|
- CONTRIBUTING.md
|
73
|
+
- Gemfile.ci
|
73
74
|
- LICENSE.txt
|
74
75
|
- Manifest.txt
|
75
76
|
- README.md
|
@@ -87,23 +88,23 @@ licenses:
|
|
87
88
|
metadata: {}
|
88
89
|
post_install_message:
|
89
90
|
rdoc_options:
|
90
|
-
- --main
|
91
|
+
- "--main"
|
91
92
|
- README.md
|
92
93
|
require_paths:
|
93
94
|
- lib
|
94
95
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
96
|
requirements:
|
96
|
-
- -
|
97
|
+
- - ">="
|
97
98
|
- !ruby/object:Gem::Version
|
98
99
|
version: '0'
|
99
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
|
-
- -
|
102
|
+
- - ">="
|
102
103
|
- !ruby/object:Gem::Version
|
103
104
|
version: '0'
|
104
105
|
requirements: []
|
105
|
-
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.4.0
|
107
108
|
signing_key:
|
108
109
|
specification_version: 4
|
109
110
|
summary: GeoHash - encode, decode, neighbors
|