spatial_features 1.3.8 → 1.3.9

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
  SHA1:
3
- metadata.gz: 1a7122350d682567036a4ced4d0f02fa1e24f6fe
4
- data.tar.gz: 3a30f1f18b42f0aa5d76dcd695a985ed38ab7eb8
3
+ metadata.gz: 7c5c3df04e153958e386e890dbcf7e86915bf705
4
+ data.tar.gz: b849fe76a613db9e7a9daf97db26fd631a3fdd22
5
5
  SHA512:
6
- metadata.gz: fdc7be6e44faccb577d56ba0a15b3bb85061b6166e2108f95e98815ed7b0cda516c973ececc0894bb533a92f6458ca584c4692777e0df873a22af33b351c4054
7
- data.tar.gz: 82076004699c948c14209121a93fd4b5131da27438e9369fa40e02b7dfebfa5783304365bc87f6cfde9f53298fd9ea0803560c27a8619bc2d4b49c1a14141df6
6
+ metadata.gz: 7b3cdc03291c86cfd144a7184b90bda8aadec8fb75444b88f847a66dad032a4a56fa1bb5528b612f2f9ea1d888272793081f9713c45cac1ae9475bffd5ea8bab
7
+ data.tar.gz: bd4cf7d8f493cb60bd84df99cb25c3f18422936c9e574b517b807d0ca57612b1680357405c85ce091c3e4e59b4f048d2e8e40ab63ff618ba681abca181297471
@@ -5,7 +5,7 @@ module SpatialFeatures
5
5
  options = scopes.extract_options!
6
6
  scope = scopes.collect do |scope|
7
7
  scope.joins(:features).where('features.feature_type = ?', 'polygon').except(:select).select("features.geom AS the_geom").to_sql
8
- end.join(' UNION ')
8
+ end.reject(&:blank?).join(' UNION ') # NullRelation.to_sql returns empty string, so reject it
9
9
 
10
10
  sql = "
11
11
  SELECT scope.id, scope.type, ST_AsKML(venn_polygons.geom) AS kml FROM ST_Dump((
@@ -35,7 +35,8 @@ module SpatialFeatures
35
35
  # Join with the original polygons so we can determine which original polygons each venn polygon came from
36
36
  scope = scopes.collect do |scope|
37
37
  scope.joins(:features).where('features.feature_type = ?', 'polygon').except(:select).select("#{scope.klass.table_name}.id, features.spatial_model_type AS type, features.geom").to_sql
38
- end.join(' UNION ')
38
+ end.reject(&:blank?).join(' UNION ') # NullRelation.to_sql returns empty string, so reject it
39
+
39
40
  sql <<
40
41
  "INNER JOIN (#{scope}) AS scope
41
42
  ON ST_Covers(scope.geom, ST_PointOnSurface(venn_polygons.geom)) -- Shrink the venn polygons so they don't share edges with the original polygons which could cause varying results due to tiny inaccuracy"
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "1.3.8"
2
+ VERSION = "1.3.9"
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: 1.3.8
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Wallace