rgeo-shapefile 1.2.0 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a42cd096d3c0e6c58fa79c248c2de90c1e911910d9f798c8b14254ae44667c9c
4
- data.tar.gz: ea81602df1862fb59824749648883a03d61547a4aa55ec8ec08c0fa45599c39a
3
+ metadata.gz: 5c4295f7f72cac7f64005b487f7afc5c9d09d3af8ce90a7a55d4f5455a97fa53
4
+ data.tar.gz: 588d82486bc992ab3f0b0cd497dd395de4d32e47ce05678451540674e8d908dc
5
5
  SHA512:
6
- metadata.gz: fa18b8185a2a6dcdba4d0aaf2957a55c7ee47cbff735aa2bb0d40922ee039e48640670dee15d0f9f194e93a211b5915bac3854caa764a103a349112feda8f1ce
7
- data.tar.gz: 9d4dd628de16180cba325a3fb907b9cce1133ea3bb3a53cc310f759128c96eb9cd70b42e51eba3d155088eba75b853a2cce9d514d094eed3467d5564d421f84f
6
+ metadata.gz: d3ab411058b49876b8e85ef15731682d8f214059912135c0bca833c40fd3933cb856e6386dcaa90e6b1cabdea6ac3b100adfca7bd954a098b12391efea27fa6b
7
+ data.tar.gz: 4470d988aca01690d234b6a61f2afcd1c3e1ec1ace22779080e909c7f13eb944b8e96fafcc505ce29ccbe89850b2e551763c802b64ded22c36e9d6f7bd97e341
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 2.0.0 / 2019-02-23
2
+
3
+ * Use .cpg file to specify the DBF encoding (#32, rywall)
4
+ * Remove :dbf_encoding option introduced in 1.2.0
5
+
6
+
1
7
  ### 1.2.0 / 2019-02-21
2
8
 
3
9
  * Add ability to specify the DBF encoding (#30, rywall)
@@ -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", nil, opts_[:dbf_encoding])
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RGeo
4
4
  module Shapefile
5
- VERSION = "1.2.0"
5
+ VERSION = "2.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.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-22 00:00:00.000000000 Z
12
+ date: 2019-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rgeo