terraformer 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ext/big_decimal.rb +4 -1
- data/lib/terraformer/bounds.rb +1 -5
- data/lib/terraformer/coordinate.rb +1 -1
- data/lib/terraformer/geometry.rb +4 -2
- data/lib/terraformer/version.rb +1 -1
- data/lib/terraformer.rb +4 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 133b3a2bf058e3848e2d20d733d6e3874a518073
|
4
|
+
data.tar.gz: aea180ce419297a6dac946bb2a34696fa4e8d9b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b92245ec569ec1c43d3a7f9db1e3d743749c4c2f48ec7d200298df745d856350ade2f1155530d9ace206214a2e4c5e016e160b61c8fbaefe5074e40f9a3da6d
|
7
|
+
data.tar.gz: d1adfba18548b2f91b3594b6d7a660e1f4516dc06a40d39ddbaecd09ca7872b73e7bd3d9d08a6038673c50c560cb6e84ae190658b1a4d249b09bf6e206fd92e8
|
data/lib/ext/big_decimal.rb
CHANGED
data/lib/terraformer/bounds.rb
CHANGED
@@ -33,8 +33,6 @@ module Terraformer
|
|
33
33
|
|
34
34
|
case format
|
35
35
|
when :bbox
|
36
|
-
# yikes!
|
37
|
-
bbox.extend BBox
|
38
36
|
bbox
|
39
37
|
when :polygon
|
40
38
|
Polygon.new [[bbox[0], bbox[1]],
|
@@ -55,15 +53,13 @@ module Terraformer
|
|
55
53
|
else
|
56
54
|
bbox = array.reduce box do |b, lonlat|
|
57
55
|
lon, lat = *lonlat
|
58
|
-
set = ->(d, i, t){ b[i] = d if b[i].nil? or d.send(t, b[i])
|
56
|
+
set = ->(d, i, t){ b[i] = d if b[i].nil? or d.send(t, b[i])}
|
59
57
|
set[lon, X1, :<]
|
60
58
|
set[lon, X2, :>]
|
61
59
|
set[lat, Y1, :<]
|
62
60
|
set[lat, Y2, :>]
|
63
61
|
b
|
64
62
|
end
|
65
|
-
# yikes!
|
66
|
-
bbox.extend BBox
|
67
63
|
bbox
|
68
64
|
end
|
69
65
|
end
|
data/lib/terraformer/geometry.rb
CHANGED
data/lib/terraformer/version.rb
CHANGED
data/lib/terraformer.rb
CHANGED
@@ -70,22 +70,13 @@ module Terraformer
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def to_json *args
|
73
|
-
h = self.to_hash
|
74
|
-
|
73
|
+
h = self.to_hash *args
|
74
|
+
args.pop if Hash === args.last
|
75
75
|
h.to_json *args
|
76
76
|
end
|
77
77
|
|
78
78
|
end
|
79
79
|
|
80
|
-
# yikes!
|
81
|
-
module BBox
|
82
|
-
|
83
|
-
def to_json *args
|
84
|
-
map {|e| e.to_f if e}.to_json *args
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
80
|
end
|
90
81
|
|
91
82
|
require 'terraformer/coordinate'
|
@@ -101,3 +92,5 @@ require 'terraformer/polygon'
|
|
101
92
|
require 'terraformer/multi_polygon'
|
102
93
|
require 'terraformer/convex_hull'
|
103
94
|
require 'terraformer/circle'
|
95
|
+
|
96
|
+
require 'terraformer/version'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terraformer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenichi Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email:
|