geohex-v3 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69d42df0ee03c5697e44ab0755ee8e992bc008d1
4
- data.tar.gz: bf82d530fe1d72e4cd30c0afa97917b0b4bcf77b
3
+ metadata.gz: fb6401405b3c6af7eb0d0fd3d1d5ac378e0c51ba
4
+ data.tar.gz: ef320cf628c0854f33350660c4a23623a2e62824
5
5
  SHA512:
6
- metadata.gz: e81269a49d87a3b87715fbc9b89e15118080c6edd93767b1cbe2ad0e38678692eba21c2cc02adee6e6bf400b5db29b144cbfe5ed4ca0701e9bc6ec92d83ee426
7
- data.tar.gz: 534e3e5073b9fe8457f2273b846f9b980d99ade76199cab2811c58b70f5e08f49b2b594c83484a676b8ebda428c0bd9f95375ea63dcb43c8378b6586cfa936a5
6
+ metadata.gz: 9adeb0a4b86469a7397244cd9e0d29fc09fef1c0f8f7ccfb3e9ba4fc5e3d5bd719beb7c15bdca4185f40adfccefd0868c931de7507b6a38b1a354c01d5abfdc5
7
+ data.tar.gz: 358c503993459d7f2c7f3a9159c4763360b3e557a6f6ece113630d0a8a52d92fa9a40d903859344ca21ec2252f8aaf4890a6df827e0203024e6a6a51c1494b61
data/README.md CHANGED
@@ -12,3 +12,7 @@ require 'geohex/v3' # or require 'geohex'
12
12
  Geohex::V3::Zone.encode 35.360556, 138.727778, 7 # => "XM5633055"
13
13
  ```
14
14
 
15
+ ### document
16
+
17
+ [GeoHex doc](https://sites.google.com/site/geohexdocs/)
18
+
@@ -2,15 +2,5 @@ require "geohex/version"
2
2
  require "geohex/v3"
3
3
 
4
4
  module Geohex
5
- def encode(latitude, longitude, level)
6
- Geohex::V3::Zone.encode(latitude, longitude, level)
7
- end
8
-
9
- def decode(code)
10
- Geohex::V3::Zone.decode(code)
11
- end
12
-
13
- def getZoneByXY(x, y, level)
14
- Geohex::V3::Zone.getZoneByXY(x, y, level)
15
- end
5
+ # Your code goes here...
16
6
  end
@@ -28,16 +28,12 @@ module Geohex
28
28
 
29
29
  instance
30
30
  end
31
-
32
- def getZoneByXY x, y, level
33
- instance = self.new
34
- instance.getZoneByXY x, y, level
35
- end
36
31
  end
37
32
 
38
33
  def calcHexSize level
39
34
  H_BASE / (3.0 ** (level + 3))
40
35
  end
36
+ private :calcHexSize
41
37
 
42
38
  def loc2xy lon, lat
43
39
  x = lon * H_BASE / 180
@@ -46,6 +42,7 @@ module Geohex
46
42
 
47
43
  OpenStruct.new :x =>x, :y => y
48
44
  end
45
+ private :loc2xy
49
46
 
50
47
  def xy2loc x, y
51
48
  lon = (x / H_BASE) * 180
@@ -54,6 +51,7 @@ module Geohex
54
51
 
55
52
  OpenStruct.new :lon => lon, :lat => lat
56
53
  end
54
+ private :xy2loc
57
55
 
58
56
  def encode latitude, longitude, level = 7
59
57
  raise ArgumentError, "latitude must be between -90 and 90" unless (-90..90).include? latitude
@@ -308,6 +306,7 @@ module Geohex
308
306
 
309
307
  [ z_loc_y, z_loc_x, h_x, h_y, code ]
310
308
  end
309
+ private :getZoneByXY
311
310
 
312
311
  def adjust_xy x, y, level
313
312
  rev = 0
@@ -1,3 +1,3 @@
1
1
  module Geohex
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geohex-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - toshiwo