spatial_features 2.10.6 → 2.10.7
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e62668e5118907b61af7d07274b1e136086f9aa920b8bcbc3a415fd7ce1d7846
|
4
|
+
data.tar.gz: '090b0a6b28286e52c57079b4e51250c10280b9a185c938b055696607f7ac61be'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0293f1342cf5dd4f23c311d4efe555b74e2e0805ce31c35f8e5f711613415a065a23a3105622204358201ef5dac8f60a98bd66de66aebc3da1ed29954f4cca9d'
|
7
|
+
data.tar.gz: 357e67c32a156fa8fd3ed6d67edfaddde398346babc4f384c3e7ec41b77a5b28cdb215b49021bebe948c27f57ea1f95ac9889caa9f0ba6bce5cf5556b62f4e6a
|
@@ -14,8 +14,10 @@ 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.
|
17
19
|
self.geog = ActiveRecord::Base.connection.select_value <<~SQL
|
18
|
-
SELECT COALESCE(ST_Collect(unnest)::geography, ST_GeogFromText('MULTIPOLYGON EMPTY'))
|
20
|
+
SELECT COALESCE(ST_CollectionHomogenize(ST_Collect(unnest))::geography, ST_GeogFromText('MULTIPOLYGON EMPTY'))
|
19
21
|
FROM (SELECT unnest(#{feature_array_sql})) AS features
|
20
22
|
WHERE NOT ST_IsEmpty(unnest)
|
21
23
|
SQL
|
@@ -142,9 +142,11 @@ module SpatialFeatures
|
|
142
142
|
scope = features_scope(self).select("#{geom} AS geom").select(:spatial_model_id)
|
143
143
|
|
144
144
|
other_scope = features_scope(other).select("ST_Union(#{geom}) AS geom")
|
145
|
-
|
146
145
|
return joins(%Q(INNER JOIN (#{scope.to_sql}) AS #{table_alias} ON #{table_alias}.spatial_model_id = #{table_name}.id))
|
147
|
-
.joins(%Q(INNER JOIN (#{other_scope.to_sql}) AS #{other_alias}
|
146
|
+
.joins(%Q(INNER JOIN (#{other_scope.to_sql}) AS #{other_alias}
|
147
|
+
ON NOT ST_IsEmpty(#{table_alias}.geom) -- Can't ST_DWithin empty geometry
|
148
|
+
AND NOT ST_IsEmpty(#{other_alias}.geom) -- Can't ST_DWithin empty geometry
|
149
|
+
AND ST_DWithin(#{table_alias}.geom, #{other_alias}.geom, #{buffer})))
|
148
150
|
end
|
149
151
|
|
150
152
|
def features_scope(other)
|
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.7
|
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-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|