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 +4 -4
- data/lib/spatial_features/venn_polygons.rb +3 -2
- data/lib/spatial_features/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c5c3df04e153958e386e890dbcf7e86915bf705
|
4
|
+
data.tar.gz: b849fe76a613db9e7a9daf97db26fd631a3fdd22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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"
|