spatial_features 0.0.1 → 0.0.2
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 +5 -5
- data/lib/spatial_features/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebe5139b0ac443b8695418ee063bc4159d77fd90
|
4
|
+
data.tar.gz: 359c137fe020fafd1bd1c3305c7cf9d2411e18ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ae9db0d8dffdf9957e839dceb75c627ce815b79866f1bfe127ecdb9329c02159606378bf33b4da68bd96557b34c6bfd475e6dc7ed111acf7de02f490d3fa0fa
|
7
|
+
data.tar.gz: b0a6f1f503188e9b71304792b00ad1e82a58c0b824a4b49784a07f487cee34bc7072f1cbd649b744109270ed8e28148bd0a68b417bbab5852fc2f36c99fddcf5
|
@@ -9,7 +9,7 @@ module SpatialFeatures
|
|
9
9
|
|
10
10
|
extend SpatialFeatures::ClassMethods
|
11
11
|
include SpatialFeatures::InstanceMethods
|
12
|
-
end
|
12
|
+
end
|
13
13
|
end
|
14
14
|
|
15
15
|
module ClassMethods
|
@@ -37,9 +37,9 @@ module SpatialFeatures
|
|
37
37
|
.select("#{table_name}.*")
|
38
38
|
.group("#{table_name}.#{primary_key}")
|
39
39
|
|
40
|
-
scope = scope.where('ST_DWithin(features_for.
|
41
|
-
scope = scope.select("MIN(ST_Distance(features_for.
|
42
|
-
scope = scope.select("SUM(ST_Area(ST_Intersection(features_for.
|
40
|
+
scope = scope.where('ST_DWithin(features_for.geog, features_for_other.geog, ?)', buffer_in_meters) if buffer_in_meters
|
41
|
+
scope = scope.select("MIN(ST_Distance(features_for.geog, features_for_other.geog)) AS distance_in_meters") if options[:distance]
|
42
|
+
scope = scope.select("SUM(ST_Area(ST_Intersection(features_for.geog, features_for_other.geog))) AS intersection_area_in_square_meters") if options[:intersection_area]
|
43
43
|
end
|
44
44
|
|
45
45
|
return scope
|
@@ -155,4 +155,4 @@ module SpatialFeatures
|
|
155
155
|
end
|
156
156
|
end
|
157
157
|
end
|
158
|
-
end
|
158
|
+
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: 0.0.
|
4
|
+
version: 0.0.2
|
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: 2014-
|
12
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|