spatial_features 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10fa0bff76bebbb1e6bbf5d8ac7bf122e6391991
|
4
|
+
data.tar.gz: 4e6659a9e0d6b97027cd5b2b8ee3d13ac86273c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 961114c59850e022b0401d3a9e8d276e75882eac8c4d0e5db11d0003e625cabeefa7a549bce9099bf21c48bf28db48c8df6358e96696ffe07d4cecd956c37ca9
|
7
|
+
data.tar.gz: 8c95c131992d11849aa2ae5b4af9b300eff5b735de0a015b64b6cc9b3dfd025db3f919f2bed64561e8185ff059b1610eb2df79d461c89c4fbee6ee35a2b97c71
|
@@ -62,7 +62,7 @@ module ArcGISKmzFeatures
|
|
62
62
|
# Use ST_Force_2D to discard z-coordinates that cause failures later in the process
|
63
63
|
def build_geom(feature)
|
64
64
|
if make_valid?
|
65
|
-
geom = ActiveRecord::Base.connection.select_value("SELECT ST_CollectionExtract(ST_MakeValid(ST_Force_2D(ST_GeomFromKML('#{feature}'))),3
|
65
|
+
geom = ActiveRecord::Base.connection.select_value("SELECT ST_CollectionExtract(ST_MakeValid(ST_Force_2D(ST_GeomFromKML('#{feature}'))),3)")
|
66
66
|
else
|
67
67
|
geom = ActiveRecord::Base.connection.select_value("SELECT ST_Force_2D(ST_GeomFromKML('#{feature}'))")
|
68
68
|
end
|
@@ -35,7 +35,11 @@ class Feature < ActiveRecord::Base
|
|
35
35
|
|
36
36
|
def envelope(buffer_in_meters = 0)
|
37
37
|
envelope_json = JSON.parse(self.class.select("ST_AsGeoJSON(ST_Envelope(ST_Buffer(features.geog, #{buffer_in_meters})::geometry)) AS result").where(:id => id).first.result)
|
38
|
-
envelope_json["coordinates"].first
|
38
|
+
envelope_json = envelope_json["coordinates"].first
|
39
|
+
|
40
|
+
raise "Can't calculate envelope for Feature #{self.id}" if envelope_json.blank?
|
41
|
+
|
42
|
+
return envelope_json.values_at(0,2)
|
39
43
|
end
|
40
44
|
|
41
45
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spatial_features
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Wallace
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|