spatial_features 2.15.1 → 2.16.0
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/app/models/abstract_feature.rb +9 -2
- data/lib/spatial_features/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0bc8fc084675d82dfe1414f599b32d22b3b4435525246580c7cd2af1f5e3afc
|
|
4
|
+
data.tar.gz: 78b7e7fa4b2e3fe9f46931c4b5a0bcf14c3f518a9e813e48fcb3985ac1bd171f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fe304ec107f4d9ca8537a4a665c118bb20a1365b2bee3a58d88bd2ccc65758a4906a812a09632ad779e2df60b715c100967e62bfb97e23c012e96a7d031f958
|
|
7
|
+
data.tar.gz: ab611750f2a507937f0f3a62b120c619b7e2b3a9fda837657eeb844bd0e02911d3fd5419a779f60ed0d20bdee6b387e4fb2b9b51e814216b1a0a82bce11852b5
|
|
@@ -123,8 +123,15 @@ class AbstractFeature < ActiveRecord::Base
|
|
|
123
123
|
SQL
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
-
def self.geojson(lowres: false, precision: 6, properties: true, srid: 4326) # default srid is 4326 so output is Google Maps compatible
|
|
127
|
-
|
|
126
|
+
def self.geojson(lowres: false, precision: 6, properties: true, srid: 4326, centroids: false) # default srid is 4326 so output is Google Maps compatible
|
|
127
|
+
if centroids
|
|
128
|
+
column = 'centroid'
|
|
129
|
+
elsif lowres
|
|
130
|
+
column = "ST_Transform(geom_lowres, #{srid})"
|
|
131
|
+
else
|
|
132
|
+
column = 'geog'
|
|
133
|
+
end
|
|
134
|
+
|
|
128
135
|
properties_sql = <<~SQL if properties
|
|
129
136
|
, 'properties', hstore_to_json(metadata)
|
|
130
137
|
SQL
|
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: 2.
|
|
4
|
+
version: 2.16.0
|
|
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: 2021-07-
|
|
12
|
+
date: 2021-07-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|