spatial_features 2.10.3 → 2.10.4
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/importers/shapefile.rb +12 -6
- 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: 033d463978aa207a802ab2ecb1f295f33cd1c4f857905aba42c4266ada83383a
|
4
|
+
data.tar.gz: 6306307bbf18320d1767ad9c73ae855edafbc2549b089db4afb4a86948492532
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 104856341f7d7807012a9f2372682f78eebd867adea536fc98f9f97f62029b50d5176c09394e634d9837fd819923f2061e627d8f3ef0c60f91c2fe153d7a53f0
|
7
|
+
data.tar.gz: 64411a07521f62d1c83213bd2c76cf7636d6321aa524c17a00a510be3fc8b003f66be0b43da9b38ae8d87e838ef0ef2a654b24037993c57cb4b1bed27cce426f
|
@@ -23,10 +23,17 @@ module SpatialFeatures
|
|
23
23
|
yield OpenStruct.new data_from_wkt(record.geometry.as_text, proj4_projection).merge(:metadata => record.attributes) if record.geometry.present?
|
24
24
|
end
|
25
25
|
end
|
26
|
+
rescue Errno::ENOENT => e
|
27
|
+
case e.message
|
28
|
+
when /No such file or directory @ rb_sysopen - (.+)/
|
29
|
+
raise IncompleteShapefileArchive, "Shapefile archive was missing a required file: #{::File.basename($1)}"
|
30
|
+
else
|
31
|
+
raise e
|
32
|
+
end
|
26
33
|
end
|
27
34
|
|
28
35
|
def proj4_projection
|
29
|
-
@proj4 ||= proj4_from_file || default_proj4_projection || raise(
|
36
|
+
@proj4 ||= proj4_from_file || default_proj4_projection || raise(IndeterminateShapefileProjection, 'Could not determine shapefile projection. Check that `gdalsrsinfo` is installed.')
|
30
37
|
end
|
31
38
|
|
32
39
|
def proj4_from_file
|
@@ -45,11 +52,10 @@ module SpatialFeatures
|
|
45
52
|
def file
|
46
53
|
@file ||= Download.open(@data, unzip: /\.shp$/, downcase: true)
|
47
54
|
end
|
48
|
-
|
49
|
-
|
50
|
-
# ERRORS
|
51
|
-
|
52
|
-
class IndeterminateProjection < StandardError; end
|
53
55
|
end
|
56
|
+
|
57
|
+
# ERRORS
|
58
|
+
class IndeterminateShapefileProjection < SpatialFeatures::ImportError; end
|
59
|
+
class IncompleteShapefileArchive < SpatialFeatures::ImportError; end
|
54
60
|
end
|
55
61
|
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: 2.10.
|
4
|
+
version: 2.10.4
|
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: 2020-05-
|
12
|
+
date: 2020-05-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|