spatial_features 0.0.5 → 0.0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af68b48e3b3e9a8141a2aba05ade111f69a2c0ee
|
4
|
+
data.tar.gz: 91ee214bcc4527e478f3121d5e9b33446e5e8922
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6cbf3132038552ce0b4d14decd5f7959de83adba1efde3edee49cb72db2995306c77aa577616c344654dffacb3afb6819524246105c47e5797be7583a79a743
|
7
|
+
data.tar.gz: c25c82d4cba0537267b34e5abf179254c28179e782884863dec957dd5b412682fc09b2476bc0265956778e89f46d27f9a8d998f566ac101f8f7fe321272620a9
|
data/lib/spatial_features.rb
CHANGED
@@ -29,7 +29,9 @@ module SpatialFeatures
|
|
29
29
|
def within_buffer(other, buffer_in_meters = 0, options = {})
|
30
30
|
raise "Can't intersect with #{other} because it does not implement has_features" unless other.has_spatial_features?
|
31
31
|
|
32
|
-
if
|
32
|
+
if options[:cache] != false # CACHED
|
33
|
+
return all.extending(UncachedRelation) unless other.spatial_cache_for?(self, buffer_in_meters) # Don't use the cache if it doesn't exist
|
34
|
+
|
33
35
|
scope = cached_spatial_join(other)
|
34
36
|
.select("#{table_name}.*, spatial_proximities.distance_in_meters, spatial_proximities.intersection_area_in_square_meters")
|
35
37
|
|
@@ -42,6 +42,7 @@ class Feature < ActiveRecord::Base
|
|
42
42
|
|
43
43
|
def cache_derivatives
|
44
44
|
self.class.connection.execute "UPDATE features SET geog_lowres = ST_SimplifyPreserveTopology(geog::geometry, 0.0001) WHERE id = #{self.id}"
|
45
|
+
self.class.connection.execute "UPDATE features SET geom = ST_Transform(geog::geometry, 26910) WHERE id = #{self.id}"
|
45
46
|
self.class.connection.execute "UPDATE features SET kml = ST_AsKML(geog_lowres::geometry, 5) WHERE id = #{self.id}"
|
46
47
|
end
|
47
48
|
|
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.6
|
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-11-
|
12
|
+
date: 2014-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|