rgeo-shapefile 1.0.0 → 3.0.0

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: 9512fb719b3dbba3c3091ab9bffce6875379845c20b75730b8e3f037b48cc5af
4
- data.tar.gz: 8390a9d14c38cee0c620b1e38a03550c25c9da15c123049814ddbb91ea9b9bfb
3
+ metadata.gz: b6e5256b3e85525a1eaf405a0d77df1e4f5e607a36164cad539b07f0f8008ad2
4
+ data.tar.gz: 69c7b87747813c5ae3bbb76a8dd9b635b8c3d6c96dcf86a3a6b50b311e126038
5
5
  SHA512:
6
- metadata.gz: 87942c272ed29bf6ba113116a56adf108143fa9a1dc4814f0c1727b24bddc24c6700bb978d07c13ebabf8be251f99027f398e629de6ad091432efc415324fbfd
7
- data.tar.gz: 4d39372c04b67837fd9db6176c4e2cc48ea15c9d63c40ab5d4d14efceb0c82aacaf7daa0dd80d32f0818eb1e93c78c396faac9c1ad0af4163ef8666cb962cb6c
6
+ metadata.gz: 302a221acc3cac6842143dedaff74380d5dce58959b8b7381c00cce52401fa0e4343b31a999340f40ba08947c4245b15f2f1962e66f2422bab937b71de5bdd3e
7
+ data.tar.gz: 56c09783ed155a8fcb95ad9596bae125a4b0a54cedd655fff07cfb4d1786c1011738c1a4768dff4e023b025ce75bee788c22f368a1b5c6ea4d5d3f1237fe1bd1
data/History.md CHANGED
@@ -1,7 +1,40 @@
1
+ ### 3.0.0 / 2020-08-02
2
+
3
+ * Handle invalid DBF file (#37, rywall)
4
+ * Update DBF gem to version 4.x, bump minimum Ruby version to 2.4 (#38, alvir)
5
+
6
+ ### 2.0.1 / 2019-04-01
7
+
8
+ * Check dbf record attributes / allow DBF file to have fewer records than SHX (#34, womanonrails / #28, marcisv)
9
+
10
+
11
+ ### 2.0.0 / 2019-02-23
12
+
13
+ * Use .cpg file to specify the DBF encoding (#32, rywall)
14
+ * Remove :dbf_encoding option introduced in 1.2.0
15
+
16
+
17
+ ### 1.2.0 / 2019-02-21
18
+
19
+ * Add ability to specify the DBF encoding (#30, rywall)
20
+
21
+
22
+ ### 1.1.0 / 2018-11-30
23
+
24
+ * Allow rgeo 2.0 (#29, sunpoet)
25
+ * Require ruby 2.3+
26
+
27
+
28
+ ### 1.0.0 / 2018-3-6
29
+
30
+ * Require rgeo 1.0 (#27)
31
+ * Freeze strings
32
+
33
+
1
34
  ### 0.4.2 / 2017-1-31
2
35
 
3
- * Require ruby 2.1
4
- * Handle non-string path objects in Reader #20
36
+ * Require ruby 2.1+
37
+ * Handle non-string path objects in Reader (#20, msimonborg)
5
38
 
6
39
  ### 0.4.1 / 2015-2-8
7
40
 
data/README.md CHANGED
@@ -42,9 +42,11 @@ end
42
42
 
43
43
  `RGeo::Shapefile` has the following requirements:
44
44
 
45
- * Ruby 2.1.0 or later
45
+ * Ruby 2.4.0 or later
46
46
  * rgeo 1.0.0 or later.
47
- * dbf 3.0 or later.
47
+ * dbf 4.0 or later.
48
+
49
+ If you need support for older Rubies, please use 2.x version
48
50
 
49
51
  Include in your bundle:
50
52
 
@@ -58,15 +60,21 @@ Install `RGeo::Shapefile` as a gem:
58
60
  gem install rgeo-shapefile
59
61
  ```
60
62
 
61
- See the README for the "rgeo" gem, a required dependency, for further installation information.
63
+ See the [`rgeo`](https://github.com/rgeo/rgeo) gem, a required dependency,
64
+ for further installation information.
62
65
 
63
- If you are using Ruby 1.8, use version `0.2.x` of this gem.
66
+ If you are using Ruby 2.3, use version `2.0.x` of this gem.
67
+
68
+ If you are using Ruby 2.0-2.2, use version `1.0.x` of this gem.
64
69
 
65
70
  If you are using Ruby 1.9, use version `0.3.x` of this gem.
66
71
 
72
+ If you are using Ruby 1.8, use version `0.2.x` of this gem.
73
+
74
+
67
75
  ## Development and support
68
76
 
69
- Documentation is available at http://rdoc.info/gems/rgeo-shapefile
77
+ Documentation is available at https://www.rubydoc.info/gems/rgeo-shapefile
70
78
 
71
79
  Source code is hosted on Github at https://github.com/rgeo/rgeo-shapefile
72
80
 
@@ -180,9 +180,14 @@ module RGeo
180
180
  @opened = true
181
181
  @main_file = ::File.open(path_ + ".shp", "rb:ascii-8bit")
182
182
  @index_file = ::File.open(path_ + ".shx", "rb:ascii-8bit")
183
- @attr_dbf = if ::File.file?(path_ + ".dbf") && ::File.readable?(path_ + ".dbf")
184
- ::DBF::Table.new(path_ + ".dbf")
185
- end
183
+ @attr_dbf =
184
+ if ::File.file?(path_ + ".dbf") && ::File.readable?(path_ + ".dbf")
185
+ if ::File.file?(path_ + ".cpg") && ::File.readable?(path_ + ".cpg")
186
+ dbf_encoding_ = ::File.read(path_ + ".cpg")
187
+ end
188
+
189
+ ::DBF::Table.new(path_ + ".dbf", nil, dbf_encoding_)
190
+ end
186
191
  @main_length, @shape_type_code, @xmin, @ymin, @xmax, @ymax, @zmin, @zmax, @mmin, @mmax = @main_file.read(100).unpack("x24Nx4VE8")
187
192
  @main_length *= 2
188
193
  index_length_ = @index_file.read(100).unpack("x24Nx72").first
@@ -393,7 +398,7 @@ module RGeo
393
398
  when 31 then _read_multipatch(data_)
394
399
  end
395
400
  attrs_ = {}
396
- if @attr_dbf
401
+ if @attr_dbf && !@attr_dbf.columns.empty? && @attr_dbf.record(@cur_record_index)
397
402
  dbf_record_attrs_ = @attr_dbf.record(@cur_record_index).attributes
398
403
  @attr_dbf.columns.each do |col_|
399
404
  name_ = col_.name
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RGeo
4
4
  module Shapefile
5
- VERSION = "1.0.0"
5
+ VERSION = "3.0.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgeo-shapefile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
@@ -9,20 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-06 00:00:00.000000000 Z
12
+ date: 2020-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rgeo
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.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
27
  version: '1.0'
28
28
  - !ruby/object:Gem::Dependency
@@ -31,28 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '3.0'
34
+ version: '4.0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '3.0'
42
- - !ruby/object:Gem::Dependency
43
- name: bundler
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '1.6'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: '1.6'
41
+ version: '4.0'
56
42
  - !ruby/object:Gem::Dependency
57
43
  name: minitest
58
44
  requirement: !ruby/object:Gem::Requirement
@@ -110,15 +96,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
96
  requirements:
111
97
  - - ">="
112
98
  - !ruby/object:Gem::Version
113
- version: 2.1.0
99
+ version: 2.4.0
114
100
  required_rubygems_version: !ruby/object:Gem::Requirement
115
101
  requirements:
116
102
  - - ">="
117
103
  - !ruby/object:Gem::Version
118
104
  version: '0'
119
105
  requirements: []
120
- rubyforge_project:
121
- rubygems_version: 2.7.6
106
+ rubygems_version: 3.0.3
122
107
  signing_key:
123
108
  specification_version: 4
124
109
  summary: An RGeo module for reading ESRI shapefiles.