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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb9c8e3383260110361e8adee25be15e7811937c7422a26c1559854de9577470
4
- data.tar.gz: 99306279256c88e034af0dfbe32035a1283d0604fc75634c4dbf6f78213295b6
3
+ metadata.gz: 033d463978aa207a802ab2ecb1f295f33cd1c4f857905aba42c4266ada83383a
4
+ data.tar.gz: 6306307bbf18320d1767ad9c73ae855edafbc2549b089db4afb4a86948492532
5
5
  SHA512:
6
- metadata.gz: d6ec6a878142aa3dacf50f9df6d579d91cfa723e9e2206776157551cf4c2a2eb7de9ada41b2c734d5e371aa18b4f4ac9ac61cd08ace25b3da5b88b3c9bd0dc96
7
- data.tar.gz: bdbe282b14d9d57b35208d40c43bf987e29961febcf30d864beb1e43876cba178c96c74e5a4c895d48af7b6b9306e299f2e62ad9a2e6fcb2c495e07184fddb92
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(IndeterminateProjection, 'Could not determine shapefile projection. Check that `gdalsrsinfo` is installed.')
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
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "2.10.3"
2
+ VERSION = "2.10.4"
3
3
  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.3
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-06 00:00:00.000000000 Z
12
+ date: 2020-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails