spatial_features 2.10.7 → 2.10.8
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e304bd5be296e4094c384df03f72117452bce5bafc5364dd3277c9826c374f28
|
4
|
+
data.tar.gz: d0bddea53fc9210bbc192160c490b7ba8b85dcafc8ee6dc238f8f8f8d4ea6a43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bef25168be8628a563a5aff4026c3dd3de26ba5cbcd82ed6b3de155bfed59d6e8ac72af4f05b8a12f3755125772732fe14238f5ea9daccc6d62bfb8fc9739311
|
7
|
+
data.tar.gz: 9f0969a84cd00fca613384cbf8dfdd5989421de2b63c56db600729f94dc5c65a6333ba96dd99377b9339823bca8657fd7eaa51e1aff91abb8bfcd34bb3db9cb0
|
@@ -14,10 +14,8 @@ class AggregateFeature < AbstractFeature
|
|
14
14
|
SQL
|
15
15
|
|
16
16
|
# Remove empty features so ST_COLLECT doesn't choke. This seems to be a difference between PostGIS 2.x and 3.x
|
17
|
-
# NOTE: ST_CollectionHomogenize is used to normalize geometry representation in order to avoid a segmentation fault
|
18
|
-
# we were seeing when intersecting complex geometry.
|
19
17
|
self.geog = ActiveRecord::Base.connection.select_value <<~SQL
|
20
|
-
SELECT COALESCE(
|
18
|
+
SELECT COALESCE(ST_Collect(unnest)::geography, ST_GeogFromText('MULTIPOLYGON EMPTY'))
|
21
19
|
FROM (SELECT unnest(#{feature_array_sql})) AS features
|
22
20
|
WHERE NOT ST_IsEmpty(unnest)
|
23
21
|
SQL
|
@@ -131,7 +131,7 @@ module SpatialFeatures
|
|
131
131
|
scope = scope.select(options[:columns])
|
132
132
|
|
133
133
|
scope = scope.select("ST_Distance(features.geom, other_features.geom) AS distance_in_meters") if options[:distance]
|
134
|
-
scope = scope.select("ST_Area(ST_Intersection(features.geom, other_features.geom)) AS intersection_area_in_square_meters") if options[:intersection_area]
|
134
|
+
scope = scope.select("ST_Area(ST_Intersection(ST_CollectionExtract(features.geom, 3), ST_CollectionExtract(other_features.geom, 3))) AS intersection_area_in_square_meters") if options[:intersection_area] # Use ST_CollectionExtract to avoid a segfault we've been seeing when intersecting certain geometry
|
135
135
|
|
136
136
|
return scope
|
137
137
|
end
|
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: 2.10.
|
4
|
+
version: 2.10.8
|
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: 2020-05-
|
12
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|