spatial_features 0.0.7 → 1.0.0
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 +3 -3
- 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: 1b7d8a174ca399c1f6609b5cb21ed454c0038bb9
|
4
|
+
data.tar.gz: 678d452463acc1f5e1b1bf06f1e86ef4bf7a46f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f85cd32f2aeb37e9e0f2bc0fa1b36772c5999eb15d0c4356d634c42f2f50ce0d4f05d8fe47a57ca6bb8dbe669d3d3543181d40eb66d046eae5cd2aa100b8ad00
|
7
|
+
data.tar.gz: 5cd74f006fb05a63268a9f837d3d667d3ab393ebbee7c4293a37de4e006d4bd97f4ab896e89b59e109daf91f7b01880e251d5a827b55ade2055e87cdccca572e
|
@@ -41,9 +41,9 @@ module SpatialFeatures
|
|
41
41
|
.select("#{table_name}.*")
|
42
42
|
.group("#{table_name}.#{primary_key}")
|
43
43
|
|
44
|
-
scope = scope.where('ST_DWithin(features_for.
|
45
|
-
scope = scope.select("MIN(ST_Distance(features_for.
|
46
|
-
scope = scope.select("SUM(ST_Area(ST_Intersection(features_for.
|
44
|
+
scope = scope.where('ST_DWithin(features_for.geom, features_for_other.geom, ?)', buffer_in_meters) if buffer_in_meters
|
45
|
+
scope = scope.select("MIN(ST_Distance(features_for.geom, features_for_other.geom)) AS distance_in_meters") if options[:distance]
|
46
|
+
scope = scope.select("SUM(ST_Area(ST_Intersection(features_for.geom, features_for_other.geom))) AS intersection_area_in_square_meters") if options[:intersection_area]
|
47
47
|
end
|
48
48
|
|
49
49
|
return scope
|