spatial_features 2.5.2 → 2.5.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f766538c6eab3f16deabfc99c389ac980c269369
|
4
|
+
data.tar.gz: c067ba772247abae57fd42b67543dfc6d0eae7f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4787b48b20386bc4c7e1116a54a9a9aa22ba7132dd48c6286fea12f0ab3e77819ea0449fbf4be970415e6d5f6c04491ac54ac2f966b4b0de934e11ff5708a3a3
|
7
|
+
data.tar.gz: 20863a80c4cd3d674d0bf58e3f83bd062836635d3ecc7c86f121aa34189303394d784419c902555f4331b64c84df588a7ab35d36d033041896a4673d8d9497b3
|
@@ -6,12 +6,11 @@ module SpatialFeatures
|
|
6
6
|
def initialize(data, *args)
|
7
7
|
file = Download.open(data, unzip: %w(.kml .shp))
|
8
8
|
|
9
|
-
|
9
|
+
case ::File.extname(file.path.downcase)
|
10
|
+
when '.kml'
|
10
11
|
__setobj__(KMLFile.new(file, *args))
|
11
|
-
|
12
|
-
elsif file.path.end_with? '.shp'
|
12
|
+
when '.shp'
|
13
13
|
__setobj__(Shapefile.new(file, *args))
|
14
|
-
|
15
14
|
else
|
16
15
|
raise ImportError, "Could not import file. Supported formats are KMZ, KML, and zipped ArcGIS shapefiles"
|
17
16
|
end
|
@@ -21,8 +21,10 @@ module SpatialFeatures
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def proj4_from_file(file)
|
24
|
-
# Sanitize "'+proj=utm +zone=11 +datum=NAD83 +units=m +no_defs '\n"
|
25
|
-
|
24
|
+
# Sanitize: "'+proj=utm +zone=11 +datum=NAD83 +units=m +no_defs '\n" and lately
|
25
|
+
# "+proj=utm +zone=11 +datum=NAD83 +units=m +no_defs \n" to
|
26
|
+
# "+proj=utm +zone=11 +datum=NAD83 +units=m +no_defs"
|
27
|
+
`gdalsrsinfo "#{file.path}" -o proj4`.strip.remove(/^'|'$/).presence || raise('Could not determine shapefile projection. Check that `gdalsrsinfo` is installed.')
|
26
28
|
end
|
27
29
|
|
28
30
|
def data_from_wkt(wkt, proj4)
|
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.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Wallace
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 4.2.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 4.2.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: delayed_job_active_record
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|