s2geometry-jar 0.0.1-java → 0.0.2-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/s2geometry.rb +9 -3
- data/lib/s2geometry/s2_cell.rb +28 -0
- data/lib/s2geometry/vendor/s2-geometry-java.jar +0 -0
- data/lib/s2geometry/version.rb +1 -1
- metadata +47 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32616484c5a4e9cc36778384f0f8fa65f16d55cd
|
4
|
+
data.tar.gz: 50cbfa91b1f5a11b7109258f03ad1e417d52d21b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6abb4e49373aa2323321e2f7e72c48c93e6985e8fcde343eb44ec930cb92fec8827b6e87a67d4ca8cbc8eff27d5f8dcae8233a7bb2ae4b69dc6336b501fab821
|
7
|
+
data.tar.gz: e2a35fdf98791f36f9742af4f2bd2d9de80cbd638c2398b7ac8d0140031814d4bb9947c5a297b8db5a18d9b657889deafef3e9158beb749b8d8140efc606a41a
|
data/lib/s2geometry.rb
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
require 's2geometry/
|
2
|
-
require 's2geometry/vendor/guava-r09.jar'
|
1
|
+
require 's2geometry/vendor/s2-geometry-java.jar'
|
3
2
|
require 's2geometry/vendor/jsr305.jar'
|
4
|
-
require 's2geometry/vendor/
|
3
|
+
require 's2geometry/vendor/guava-r09.jar'
|
4
|
+
|
5
|
+
module S2Geometry
|
6
|
+
import 'com.google.common.geometry'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 's2geometry/version'
|
10
|
+
require 's2geometry/s2_cell'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module S2Geometry #:nodoc:
|
2
|
+
S2Cell.class_eval do
|
3
|
+
# Build a S2Cell instance at leaf node level (30)
|
4
|
+
# from a decimal latitude and longitude pair
|
5
|
+
def self.build_from_lat_long(latitude, longitude)
|
6
|
+
self.new(
|
7
|
+
com.google.common.geometry.S2CellId.from_lat_lng(
|
8
|
+
com.google.common.geometry.S2LatLng.from_degrees(latitude, longitude)
|
9
|
+
)
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Build a S2Cell instance from a 64 bit long
|
14
|
+
def self.build_from_long_id(long_id)
|
15
|
+
self.new(com.google.common.geometry.S2CellId.new(long_id))
|
16
|
+
end
|
17
|
+
|
18
|
+
# 64bit S2Id as a long
|
19
|
+
def long_id
|
20
|
+
self.id.id
|
21
|
+
end
|
22
|
+
|
23
|
+
def parent(level = nil)
|
24
|
+
parent_id = level ? self.id.parent(level) : self.id.parent
|
25
|
+
self.class.new(parent_id)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
Binary file
|
data/lib/s2geometry/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,58 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s2geometry-jar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sidu Ponnappa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
12
|
-
dependencies:
|
13
|
-
|
11
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '1.8'
|
19
|
+
name: bundler
|
20
|
+
prerelease: false
|
21
|
+
type: :development
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
name: rake
|
34
|
+
prerelease: false
|
35
|
+
type: :development
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '3'
|
47
|
+
name: rspec
|
48
|
+
prerelease: false
|
49
|
+
type: :development
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3'
|
55
|
+
description: Gem package of Google's S2 Geometry Java Library for JRuby
|
14
56
|
email:
|
15
57
|
- ckponnappa@gmail.com
|
16
58
|
executables: []
|
@@ -18,6 +60,7 @@ extensions: []
|
|
18
60
|
extra_rdoc_files: []
|
19
61
|
files:
|
20
62
|
- lib/s2geometry.rb
|
63
|
+
- lib/s2geometry/s2_cell.rb
|
21
64
|
- lib/s2geometry/vendor/guava-r09.jar
|
22
65
|
- lib/s2geometry/vendor/jsr305.jar
|
23
66
|
- lib/s2geometry/vendor/s2-geometry-java.jar
|