spatial_features 2.10.5 → 2.10.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spatial_features/has_spatial_features.rb +2 -5
- data/lib/spatial_features/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcb19db9366e628655a5197f84d4274271013822121071a820941237eeb86fa0
|
4
|
+
data.tar.gz: ac12926f535a66226a8297f13e65dd7a2e5ef72315ecf816d4fe17d177a13b28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a130a20a293bfa1f9fd79ba33bfb2f270b51bcdb612cefb054d2c48a390f66b55072a5e2a797d054b266800f2943b98cd93f6263b44fecc153e879c06b1e3d48
|
7
|
+
data.tar.gz: 02cd94b02d8ae93a39f238e9ec66cd259d663943815677673c2c446621af8ccc9a0121d887445e1b8cf625c1a9d19b04eb80bc31863d350bfed860cde49f11d9
|
@@ -141,13 +141,10 @@ module SpatialFeatures
|
|
141
141
|
def spatial_join(other, buffer = 0, table_alias = 'features', other_alias = 'other_features', geom = 'geom_lowres')
|
142
142
|
scope = features_scope(self).select("#{geom} AS geom").select(:spatial_model_id)
|
143
143
|
|
144
|
-
other_scope = features_scope(other)
|
145
|
-
other_scope_select_sql = "ST_Union(#{geom})"
|
146
|
-
other_scope_select_sql = "ST_Buffer(#{other_scope_select_sql}, #{buffer})" if buffer&.positive?
|
147
|
-
other_scope = other_scope.select("ST_Union(#{geom}) AS geom").select("#{other_scope_select_sql} AS buffered_geom")
|
144
|
+
other_scope = features_scope(other).select("ST_Union(#{geom}) AS geom")
|
148
145
|
|
149
146
|
return joins(%Q(INNER JOIN (#{scope.to_sql}) AS #{table_alias} ON #{table_alias}.spatial_model_id = #{table_name}.id))
|
150
|
-
.joins(%Q(INNER JOIN (#{other_scope.to_sql}) AS #{other_alias} ON
|
147
|
+
.joins(%Q(INNER JOIN (#{other_scope.to_sql}) AS #{other_alias} ON ST_DWithin(#{table_alias}.geom, #{other_alias}.geom, #{buffer})))
|
151
148
|
end
|
152
149
|
|
153
150
|
def features_scope(other)
|