rgeo-shapefile 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.2.1 / 2011-03-31
2
+
3
+ * The gem version is now accessible via an api.
4
+ * Attributes were each listed twice under slightly different names. Fixed. (Reported by spara.)
5
+
1
6
  === 0.2.0 / 2010-12-07
2
7
 
3
8
  * Initial public alpha release. Spun rgeo-shapefile off from the core rgeo gem.
data/README.rdoc CHANGED
@@ -38,7 +38,7 @@ Example:
38
38
  RGeo::Shapefile has the following requirements:
39
39
 
40
40
  * Ruby 1.8.7 or later. Ruby 1.9.2 or later preferred.
41
- * \RGeo 0.2.0 or later.
41
+ * \RGeo 0.2.6 or later.
42
42
  * The "dbf" gem, version 1.5.2 or later, is recommended. This gem is
43
43
  needed to read the attributes file. If it is not present, shapefiles
44
44
  can still be read, but attributes will not be available.
@@ -79,7 +79,7 @@ ESRI shapefiles, we did borrow a bunch of their test cases.
79
79
 
80
80
  === License
81
81
 
82
- Copyright 2010 Daniel Azuma
82
+ Copyright 2011 Daniel Azuma
83
83
 
84
84
  All rights reserved.
85
85
 
data/Version CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -59,4 +59,5 @@ end
59
59
 
60
60
 
61
61
  # Implementation files
62
+ require 'rgeo/shapefile/version'
62
63
  require 'rgeo/shapefile/reader'
@@ -160,7 +160,7 @@ module RGeo
160
160
  #
161
161
  # Options include:
162
162
  #
163
- # <tt>:factory_generator</tt>::
163
+ # [<tt>:factory_generator</tt>]
164
164
  # A RGeo::Feature::FactoryGenerator that should return a factory
165
165
  # based on the dimension settings in the input. It should
166
166
  # understand the configuration options <tt>:has_z_coordinate</tt>
@@ -168,10 +168,10 @@ module RGeo
168
168
  # RGeo::Feature::Factory. If no factory generator is provided,
169
169
  # the default Cartesian factory generator is used. This option
170
170
  # can also be specified using the <tt>:factory</tt> key.
171
- # <tt>:srid</tt>::
171
+ # [<tt>:srid</tt>]
172
172
  # If provided, this option is passed to the factory generator.
173
173
  # This is useful because shapefiles do not contain a SRID.
174
- # <tt>:assume_inner_follows_outer</tt>::
174
+ # [<tt>:assume_inner_follows_outer</tt>]
175
175
  # If set to true, some assumptions are made about ring ordering
176
176
  # in a polygon shapefile. See below for details. Default is false.
177
177
  #
@@ -463,9 +463,13 @@ module RGeo
463
463
  when 31 then _read_multipatch(data_)
464
464
  else nil
465
465
  end
466
- dbf_record_ = @attr_dbf ? @attr_dbf.record(@cur_record_index) : nil
467
466
  attrs_ = {}
468
- attrs_.merge!(dbf_record_.attributes) if dbf_record_
467
+ if @attr_dbf
468
+ dbf_record_ = @attr_dbf.record(@cur_record_index)
469
+ @attr_dbf.columns.each do |col_|
470
+ attrs_[col_.name] = dbf_record_.send(col_.underscored_name)
471
+ end
472
+ end
469
473
  result_ = Record.new(@cur_record_index, geometry_, attrs_)
470
474
  @cur_record_index += 1
471
475
  result_
@@ -0,0 +1,56 @@
1
+ # -----------------------------------------------------------------------------
2
+ #
3
+ # Version of rgeo-shapefile
4
+ #
5
+ # -----------------------------------------------------------------------------
6
+ # Copyright 2010 Daniel Azuma
7
+ #
8
+ # All rights reserved.
9
+ #
10
+ # Redistribution and use in source and binary forms, with or without
11
+ # modification, are permitted provided that the following conditions are met:
12
+ #
13
+ # * Redistributions of source code must retain the above copyright notice,
14
+ # this list of conditions and the following disclaimer.
15
+ # * Redistributions in binary form must reproduce the above copyright notice,
16
+ # this list of conditions and the following disclaimer in the documentation
17
+ # and/or other materials provided with the distribution.
18
+ # * Neither the name of the copyright holder, nor the names of any other
19
+ # contributors to this software, may be used to endorse or promote products
20
+ # derived from this software without specific prior written permission.
21
+ #
22
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ # POSSIBILITY OF SUCH DAMAGE.
33
+ # -----------------------------------------------------------------------------
34
+ ;
35
+
36
+
37
+ begin
38
+ require 'versionomy'
39
+ rescue ::LoadError
40
+ end
41
+
42
+
43
+ module RGeo
44
+
45
+ module Shapefile
46
+
47
+ # Current version of RGeo::Shapefile as a frozen string
48
+ VERSION_STRING = ::File.read(::File.dirname(__FILE__)+'/../../../Version').strip.freeze
49
+
50
+ # Current version of RGeo::Shapefile as a Versionomy object, if the
51
+ # Versionomy gem is available; otherwise equal to VERSION_STRING.
52
+ VERSION = defined?(::Versionomy) ? ::Versionomy.parse(VERSION_STRING) : VERSION_STRING
53
+
54
+ end
55
+
56
+ end
data/test/tc_basic.rb ADDED
@@ -0,0 +1,57 @@
1
+ # -----------------------------------------------------------------------------
2
+ #
3
+ # Some shapefile reading test cases borrowed from shapelib
4
+ #
5
+ # -----------------------------------------------------------------------------
6
+ # Copyright 2010 Daniel Azuma
7
+ #
8
+ # All rights reserved.
9
+ #
10
+ # Redistribution and use in source and binary forms, with or without
11
+ # modification, are permitted provided that the following conditions are met:
12
+ #
13
+ # * Redistributions of source code must retain the above copyright notice,
14
+ # this list of conditions and the following disclaimer.
15
+ # * Redistributions in binary form must reproduce the above copyright notice,
16
+ # this list of conditions and the following disclaimer in the documentation
17
+ # and/or other materials provided with the distribution.
18
+ # * Neither the name of the copyright holder, nor the names of any other
19
+ # contributors to this software, may be used to endorse or promote products
20
+ # derived from this software without specific prior written permission.
21
+ #
22
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ # POSSIBILITY OF SUCH DAMAGE.
33
+ # -----------------------------------------------------------------------------
34
+ ;
35
+
36
+
37
+ require 'test/unit'
38
+ require 'rgeo/shapefile'
39
+
40
+
41
+ module RGeo
42
+ module Shapefile
43
+ module Tests # :nodoc:
44
+
45
+ class TestBasic < ::Test::Unit::TestCase # :nodoc:
46
+
47
+
48
+ def test_has_version
49
+ assert_not_nil(::RGeo::Shapefile::VERSION)
50
+ end
51
+
52
+
53
+ end
54
+
55
+ end
56
+ end
57
+ end
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgeo-shapefile
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 0
9
- version: 0.2.0
4
+ prerelease:
5
+ version: 0.2.1
10
6
  platform: ruby
11
7
  authors:
12
8
  - Daniel Azuma
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-12-07 00:00:00 -08:00
13
+ date: 2011-03-31 00:00:00 -07:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,11 +21,7 @@ dependencies:
25
21
  requirements:
26
22
  - - ">="
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 2
31
- - 0
32
- version: 0.2.0
24
+ version: 0.2.6
33
25
  type: :runtime
34
26
  version_requirements: *id001
35
27
  - !ruby/object:Gem::Dependency
@@ -40,10 +32,6 @@ dependencies:
40
32
  requirements:
41
33
  - - ">="
42
34
  - !ruby/object:Gem::Version
43
- segments:
44
- - 1
45
- - 5
46
- - 2
47
35
  version: 1.5.2
48
36
  type: :development
49
37
  version_requirements: *id002
@@ -58,9 +46,11 @@ extra_rdoc_files:
58
46
  - README.rdoc
59
47
  files:
60
48
  - lib/rgeo/shapefile/reader.rb
49
+ - lib/rgeo/shapefile/version.rb
61
50
  - lib/rgeo/shapefile.rb
62
51
  - History.rdoc
63
52
  - README.rdoc
53
+ - test/tc_basic.rb
64
54
  - test/tc_shapelib_tests.rb
65
55
  - test/shapelib_testcases/readme.txt
66
56
  - test/shapelib_testcases/test.shp
@@ -109,25 +99,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
99
  requirements:
110
100
  - - ">="
111
101
  - !ruby/object:Gem::Version
112
- segments:
113
- - 1
114
- - 8
115
- - 7
116
102
  version: 1.8.7
117
103
  required_rubygems_version: !ruby/object:Gem::Requirement
118
104
  none: false
119
105
  requirements:
120
106
  - - ">="
121
107
  - !ruby/object:Gem::Version
122
- segments:
123
- - 0
124
108
  version: "0"
125
109
  requirements: []
126
110
 
127
111
  rubyforge_project: virtuoso
128
- rubygems_version: 1.3.7
112
+ rubygems_version: 1.6.2
129
113
  signing_key:
130
114
  specification_version: 3
131
- summary: RGeo::Shapefile is an RGeo module for reading ESRI shapefiles.
115
+ summary: An RGeo module for reading ESRI shapefiles.
132
116
  test_files:
117
+ - test/tc_basic.rb
133
118
  - test/tc_shapelib_tests.rb