spatial_features 2.7.5 → 2.7.6
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 +4 -4
- data/lib/spatial_features/has_spatial_features.rb +4 -2
- data/lib/spatial_features/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5212c402e92554dacf5a96e9b0c37d7be41ae0d6e5a37f7979dec43fc2051c24
|
|
4
|
+
data.tar.gz: 3e74ccd3a3030d99063a1ab0b7e503c75c6c8f129b60d1f4259d116142094b18
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19a54d24e4c472889d16fa92bdffd5d7f03d06f09d32e3484a0ce7bd558a80832b985fbfc6e1cfa7cc2ec861d31b7c7efdbbe923e12ae9df2122ccd69ac581c8
|
|
7
|
+
data.tar.gz: 4e4df3297bd72eb1694820f52b53ca13ba6a64a977dd5f43062c47f03e14d9c7c580bafadb1d3ab069d029eb9331ad113cdf8f1e6857a49e580b45a365a369ad
|
|
@@ -146,7 +146,9 @@ module SpatialFeatures
|
|
|
146
146
|
scope = features_scope(self).select("#{geom} AS geom").select(:spatial_model_id)
|
|
147
147
|
|
|
148
148
|
other_scope = features_scope(other)
|
|
149
|
-
|
|
149
|
+
other_scope_select_sql = "ST_Union(#{geom})"
|
|
150
|
+
other_scope_select_sql = "ST_Buffer(#{other_scope_select_sql}, #{buffer})" if buffer&.positive?
|
|
151
|
+
other_scope = other_scope.select("ST_Union(#{geom}) AS geom").select("#{other_scope_select_sql} AS buffered_geom")
|
|
150
152
|
|
|
151
153
|
return joins(%Q(INNER JOIN (#{scope.to_sql}) AS #{table_alias} ON #{table_alias}.spatial_model_id = #{table_name}.id))
|
|
152
154
|
.joins(%Q(INNER JOIN (#{other_scope.to_sql}) AS #{other_alias} ON ST_Intersects(#{table_alias}.geom, #{other_alias}.buffered_geom)))
|
|
@@ -154,7 +156,7 @@ module SpatialFeatures
|
|
|
154
156
|
|
|
155
157
|
def features_scope(other)
|
|
156
158
|
scope = Feature
|
|
157
|
-
scope = scope.where(:spatial_model_type => Utils.base_class_of(other))
|
|
159
|
+
scope = scope.where(:spatial_model_type => Utils.base_class_of(other).to_s)
|
|
158
160
|
scope = scope.where(:spatial_model_id => other) unless Utils.class_of(other) == other
|
|
159
161
|
return scope
|
|
160
162
|
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.7.
|
|
4
|
+
version: 2.7.6
|
|
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: 2019-07-
|
|
12
|
+
date: 2019-07-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
218
218
|
version: '0'
|
|
219
219
|
requirements: []
|
|
220
220
|
rubyforge_project:
|
|
221
|
-
rubygems_version: 2.7.
|
|
221
|
+
rubygems_version: 2.7.5
|
|
222
222
|
signing_key:
|
|
223
223
|
specification_version: 4
|
|
224
224
|
summary: Adds spatial methods to a model.
|