rgeo 0.2.9 → 0.3.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.
Files changed (67) hide show
  1. data/History.rdoc +11 -0
  2. data/README.rdoc +3 -3
  3. data/Spatial_Programming_With_RGeo.rdoc +19 -8
  4. data/Version +1 -1
  5. data/ext/geos_c_impl/factory.c +1 -0
  6. data/ext/geos_c_impl/factory.h +1 -0
  7. data/ext/geos_c_impl/geometry.c +4 -5
  8. data/ext/geos_c_impl/geometry_collection.c +15 -0
  9. data/ext/geos_c_impl/line_string.c +10 -0
  10. data/ext/geos_c_impl/point.c +2 -0
  11. data/ext/geos_c_impl/polygon.c +4 -0
  12. data/lib/rgeo/cartesian/feature_classes.rb +23 -17
  13. data/lib/rgeo/cartesian/feature_methods.rb +20 -1
  14. data/lib/rgeo/feature.rb +1 -0
  15. data/lib/rgeo/feature/curve.rb +1 -2
  16. data/lib/rgeo/feature/geometry_collection.rb +1 -1
  17. data/lib/rgeo/feature/line.rb +1 -1
  18. data/lib/rgeo/feature/line_string.rb +1 -2
  19. data/lib/rgeo/feature/linear_ring.rb +1 -2
  20. data/lib/rgeo/feature/mixins.rb +198 -0
  21. data/lib/rgeo/feature/multi_curve.rb +1 -2
  22. data/lib/rgeo/feature/multi_line_string.rb +1 -2
  23. data/lib/rgeo/feature/multi_point.rb +1 -2
  24. data/lib/rgeo/feature/multi_polygon.rb +1 -2
  25. data/lib/rgeo/feature/multi_surface.rb +1 -2
  26. data/lib/rgeo/feature/point.rb +1 -2
  27. data/lib/rgeo/feature/polygon.rb +1 -3
  28. data/lib/rgeo/feature/surface.rb +1 -2
  29. data/lib/rgeo/feature/types.rb +27 -0
  30. data/lib/rgeo/geographic/projected_feature_classes.rb +31 -4
  31. data/lib/rgeo/geographic/projected_feature_methods.rb +2 -1
  32. data/lib/rgeo/geographic/spherical_feature_classes.rb +30 -3
  33. data/lib/rgeo/geos.rb +22 -0
  34. data/lib/rgeo/geos/factory.rb +11 -5
  35. data/lib/rgeo/geos/ffi_classes.rb +655 -0
  36. data/lib/rgeo/geos/ffi_factory.rb +503 -0
  37. data/lib/rgeo/geos/impl_additions.rb +1 -1
  38. data/lib/rgeo/geos/interface.rb +63 -8
  39. data/lib/rgeo/geos/zm_factory.rb +10 -4
  40. data/test/common/geometry_collection_tests.rb +1 -3
  41. data/test/coord_sys/tc_ogc_cs.rb +13 -2
  42. data/test/coord_sys/tc_proj4_srs_data.rb +1 -1
  43. data/test/{geos → geos_capi}/tc_factory.rb +2 -2
  44. data/test/{geos → geos_capi}/tc_geometry_collection.rb +2 -2
  45. data/test/{geos → geos_capi}/tc_line_string.rb +2 -2
  46. data/test/{geos → geos_capi}/tc_misc.rb +6 -2
  47. data/test/{geos → geos_capi}/tc_multi_line_string.rb +2 -2
  48. data/test/{geos → geos_capi}/tc_multi_point.rb +2 -2
  49. data/test/{geos → geos_capi}/tc_multi_polygon.rb +2 -2
  50. data/test/{geos → geos_capi}/tc_parsing_unparsing.rb +2 -2
  51. data/test/{geos → geos_capi}/tc_point.rb +2 -2
  52. data/test/{geos → geos_capi}/tc_polygon.rb +2 -2
  53. data/test/{geos → geos_capi}/tc_zmfactory.rb +2 -2
  54. data/test/geos_ffi/tc_factory.rb +91 -0
  55. data/test/geos_ffi/tc_geometry_collection.rb +62 -0
  56. data/test/geos_ffi/tc_line_string.rb +62 -0
  57. data/test/geos_ffi/tc_misc.rb +69 -0
  58. data/test/geos_ffi/tc_multi_line_string.rb +62 -0
  59. data/test/geos_ffi/tc_multi_point.rb +62 -0
  60. data/test/geos_ffi/tc_multi_polygon.rb +64 -0
  61. data/test/geos_ffi/tc_parsing_unparsing.rb +81 -0
  62. data/test/geos_ffi/tc_point.rb +87 -0
  63. data/test/geos_ffi/tc_polygon.rb +86 -0
  64. data/test/geos_ffi/tc_zmfactory.rb +86 -0
  65. data/test/tc_mixins.rb +188 -0
  66. data/test/tc_types.rb +77 -0
  67. metadata +54 -25
data/test/tc_types.rb ADDED
@@ -0,0 +1,77 @@
1
+ # -----------------------------------------------------------------------------
2
+ #
3
+ # Tests for type properties
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'
39
+
40
+
41
+ module RGeo
42
+ module Tests # :nodoc:
43
+
44
+ class TestTypes < ::Test::Unit::TestCase # :nodoc:
45
+
46
+
47
+ def test_geometry
48
+ assert_equal('Geometry', ::RGeo::Feature::Geometry.type_name)
49
+ assert_nil(::RGeo::Feature::Geometry.supertype)
50
+ assert(::RGeo::Feature::Geometry.subtype_of?(::RGeo::Feature::Geometry))
51
+ assert(!::RGeo::Feature::Geometry.subtype_of?(::RGeo::Feature::Point))
52
+ end
53
+
54
+
55
+ def test_point
56
+ assert_equal('Point', ::RGeo::Feature::Point.type_name)
57
+ assert_equal(::RGeo::Feature::Geometry, ::RGeo::Feature::Point.supertype)
58
+ assert(::RGeo::Feature::Point.subtype_of?(::RGeo::Feature::Point))
59
+ assert(::RGeo::Feature::Point.subtype_of?(::RGeo::Feature::Geometry))
60
+ assert(!::RGeo::Feature::Point.subtype_of?(::RGeo::Feature::LineString))
61
+ end
62
+
63
+
64
+ def test_line_string
65
+ assert_equal('LineString', ::RGeo::Feature::LineString.type_name)
66
+ assert_equal(::RGeo::Feature::Curve, ::RGeo::Feature::LineString.supertype)
67
+ assert(::RGeo::Feature::LineString.subtype_of?(::RGeo::Feature::LineString))
68
+ assert(::RGeo::Feature::LineString.subtype_of?(::RGeo::Feature::Curve))
69
+ assert(::RGeo::Feature::LineString.subtype_of?(::RGeo::Feature::Geometry))
70
+ assert(!::RGeo::Feature::LineString.subtype_of?(::RGeo::Feature::Line))
71
+ end
72
+
73
+
74
+ end
75
+
76
+ end
77
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rgeo
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.9
5
+ version: 0.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel Azuma
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-25 00:00:00 Z
13
+ date: 2011-05-23 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: RGeo is a geospatial data library for Ruby. It provides an implementation of the Open Geospatial Consortium's Simple Features Specification, used by most standard spatial/geographic data storage systems such as PostGIS. A number of add-on modules are also available to help with writing location-based applications using Ruby-based frameworks such as Ruby On Rails.
@@ -52,6 +52,7 @@ files:
52
52
  - lib/rgeo/feature/line.rb
53
53
  - lib/rgeo/feature/line_string.rb
54
54
  - lib/rgeo/feature/linear_ring.rb
55
+ - lib/rgeo/feature/mixins.rb
55
56
  - lib/rgeo/feature/multi_curve.rb
56
57
  - lib/rgeo/feature/multi_line_string.rb
57
58
  - lib/rgeo/feature/multi_point.rb
@@ -74,6 +75,8 @@ files:
74
75
  - lib/rgeo/geographic/spherical_math.rb
75
76
  - lib/rgeo/geographic.rb
76
77
  - lib/rgeo/geos/factory.rb
78
+ - lib/rgeo/geos/ffi_classes.rb
79
+ - lib/rgeo/geos/ffi_factory.rb
77
80
  - lib/rgeo/geos/impl_additions.rb
78
81
  - lib/rgeo/geos/interface.rb
79
82
  - lib/rgeo/geos/zm_factory.rb
@@ -123,17 +126,28 @@ files:
123
126
  - test/coord_sys/tc_proj4_srs_data.rb
124
127
  - test/coord_sys/tc_sr_org.rb
125
128
  - test/coord_sys/tc_url_reader.rb
126
- - test/geos/tc_factory.rb
127
- - test/geos/tc_geometry_collection.rb
128
- - test/geos/tc_line_string.rb
129
- - test/geos/tc_misc.rb
130
- - test/geos/tc_multi_line_string.rb
131
- - test/geos/tc_multi_point.rb
132
- - test/geos/tc_multi_polygon.rb
133
- - test/geos/tc_parsing_unparsing.rb
134
- - test/geos/tc_point.rb
135
- - test/geos/tc_polygon.rb
136
- - test/geos/tc_zmfactory.rb
129
+ - test/geos_capi/tc_factory.rb
130
+ - test/geos_capi/tc_geometry_collection.rb
131
+ - test/geos_capi/tc_line_string.rb
132
+ - test/geos_capi/tc_misc.rb
133
+ - test/geos_capi/tc_multi_line_string.rb
134
+ - test/geos_capi/tc_multi_point.rb
135
+ - test/geos_capi/tc_multi_polygon.rb
136
+ - test/geos_capi/tc_parsing_unparsing.rb
137
+ - test/geos_capi/tc_point.rb
138
+ - test/geos_capi/tc_polygon.rb
139
+ - test/geos_capi/tc_zmfactory.rb
140
+ - test/geos_ffi/tc_factory.rb
141
+ - test/geos_ffi/tc_geometry_collection.rb
142
+ - test/geos_ffi/tc_line_string.rb
143
+ - test/geos_ffi/tc_misc.rb
144
+ - test/geos_ffi/tc_multi_line_string.rb
145
+ - test/geos_ffi/tc_multi_point.rb
146
+ - test/geos_ffi/tc_multi_polygon.rb
147
+ - test/geos_ffi/tc_parsing_unparsing.rb
148
+ - test/geos_ffi/tc_point.rb
149
+ - test/geos_ffi/tc_polygon.rb
150
+ - test/geos_ffi/tc_zmfactory.rb
137
151
  - test/projected_geographic/tc_geometry_collection.rb
138
152
  - test/projected_geographic/tc_line_string.rb
139
153
  - test/projected_geographic/tc_multi_line_string.rb
@@ -166,7 +180,9 @@ files:
166
180
  - test/spherical_geographic/tc_point.rb
167
181
  - test/spherical_geographic/tc_polygon.rb
168
182
  - test/tc_cartesian_analysis.rb
183
+ - test/tc_mixins.rb
169
184
  - test/tc_oneoff.rb
185
+ - test/tc_types.rb
170
186
  - test/wkrep/tc_wkb_generator.rb
171
187
  - test/wkrep/tc_wkb_parser.rb
172
188
  - test/wkrep/tc_wkt_generator.rb
@@ -198,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
214
  requirements: []
199
215
 
200
216
  rubyforge_project: virtuoso
201
- rubygems_version: 1.7.2
217
+ rubygems_version: 1.8.2
202
218
  signing_key:
203
219
  specification_version: 3
204
220
  summary: RGeo is a geospatial data library for Ruby.
@@ -209,17 +225,28 @@ test_files:
209
225
  - test/coord_sys/tc_proj4_srs_data.rb
210
226
  - test/coord_sys/tc_sr_org.rb
211
227
  - test/coord_sys/tc_url_reader.rb
212
- - test/geos/tc_factory.rb
213
- - test/geos/tc_geometry_collection.rb
214
- - test/geos/tc_line_string.rb
215
- - test/geos/tc_misc.rb
216
- - test/geos/tc_multi_line_string.rb
217
- - test/geos/tc_multi_point.rb
218
- - test/geos/tc_multi_polygon.rb
219
- - test/geos/tc_parsing_unparsing.rb
220
- - test/geos/tc_point.rb
221
- - test/geos/tc_polygon.rb
222
- - test/geos/tc_zmfactory.rb
228
+ - test/geos_capi/tc_factory.rb
229
+ - test/geos_capi/tc_geometry_collection.rb
230
+ - test/geos_capi/tc_line_string.rb
231
+ - test/geos_capi/tc_misc.rb
232
+ - test/geos_capi/tc_multi_line_string.rb
233
+ - test/geos_capi/tc_multi_point.rb
234
+ - test/geos_capi/tc_multi_polygon.rb
235
+ - test/geos_capi/tc_parsing_unparsing.rb
236
+ - test/geos_capi/tc_point.rb
237
+ - test/geos_capi/tc_polygon.rb
238
+ - test/geos_capi/tc_zmfactory.rb
239
+ - test/geos_ffi/tc_factory.rb
240
+ - test/geos_ffi/tc_geometry_collection.rb
241
+ - test/geos_ffi/tc_line_string.rb
242
+ - test/geos_ffi/tc_misc.rb
243
+ - test/geos_ffi/tc_multi_line_string.rb
244
+ - test/geos_ffi/tc_multi_point.rb
245
+ - test/geos_ffi/tc_multi_polygon.rb
246
+ - test/geos_ffi/tc_parsing_unparsing.rb
247
+ - test/geos_ffi/tc_point.rb
248
+ - test/geos_ffi/tc_polygon.rb
249
+ - test/geos_ffi/tc_zmfactory.rb
223
250
  - test/projected_geographic/tc_geometry_collection.rb
224
251
  - test/projected_geographic/tc_line_string.rb
225
252
  - test/projected_geographic/tc_multi_line_string.rb
@@ -252,7 +279,9 @@ test_files:
252
279
  - test/spherical_geographic/tc_point.rb
253
280
  - test/spherical_geographic/tc_polygon.rb
254
281
  - test/tc_cartesian_analysis.rb
282
+ - test/tc_mixins.rb
255
283
  - test/tc_oneoff.rb
284
+ - test/tc_types.rb
256
285
  - test/wkrep/tc_wkb_generator.rb
257
286
  - test/wkrep/tc_wkb_parser.rb
258
287
  - test/wkrep/tc_wkt_generator.rb