spatial_features 2.10.5 → 2.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9bf780dcb26228b6b90cb184045b0321cbc4ba30d081317fa804663070f3d35
4
- data.tar.gz: d481db709804be2eede27c8454b142693d052eb58a16431b2b0dfe5aec8594e6
3
+ metadata.gz: bcb19db9366e628655a5197f84d4274271013822121071a820941237eeb86fa0
4
+ data.tar.gz: ac12926f535a66226a8297f13e65dd7a2e5ef72315ecf816d4fe17d177a13b28
5
5
  SHA512:
6
- metadata.gz: 36ef374d045bf479fc82d03cba5591fa12697f6631be9007a0eb4834aedc6dfb23d5f49ea5ea64635cd16e3cd360d081e5c8ec72e8b9d801eaa4ebe5463e3b78
7
- data.tar.gz: 8dc564d1d76a136d452cc21205fdd6b8119a37f6cd5c7d85ca192e805da27b18fede7987e617a827a4c2166b37ada0ed9116e0b2dc1df0ae3b52ffca86f3fe2e
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 ST_Intersects(#{table_alias}.geom, #{other_alias}.buffered_geom)))
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)
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "2.10.5"
2
+ VERSION = "2.10.6"
3
3
  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.5
4
+ version: 2.10.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Wallace