rgeo 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/History.rdoc +11 -0
  2. data/Version +1 -1
  3. data/ext/geos_c_impl/factory.c +134 -3
  4. data/ext/geos_c_impl/factory.h +5 -0
  5. data/ext/geos_c_impl/geometry_collection.c +18 -12
  6. data/lib/rgeo/cartesian/factory.rb +40 -33
  7. data/lib/rgeo/cartesian/interface.rb +6 -0
  8. data/lib/rgeo/coord_sys/cs/entities.rb +4 -4
  9. data/lib/rgeo/coord_sys/proj4.rb +5 -5
  10. data/lib/rgeo/coord_sys/srs_database/active_record_table.rb +5 -3
  11. data/lib/rgeo/feature/geometry.rb +8 -1
  12. data/lib/rgeo/geographic/factory.rb +124 -1
  13. data/lib/rgeo/geographic/interface.rb +6 -0
  14. data/lib/rgeo/geographic/proj4_projector.rb +6 -0
  15. data/lib/rgeo/geographic/simple_mercator_projector.rb +6 -0
  16. data/lib/rgeo/geos/factory.rb +119 -18
  17. data/lib/rgeo/geos/ffi_classes.rb +10 -5
  18. data/lib/rgeo/geos/ffi_factory.rb +106 -5
  19. data/lib/rgeo/geos/interface.rb +0 -2
  20. data/lib/rgeo/geos/zm_factory.rb +106 -2
  21. data/lib/rgeo/geos/zm_impl.rb +3 -2
  22. data/lib/rgeo/impl_helper.rb +1 -0
  23. data/lib/rgeo/impl_helper/basic_line_string_methods.rb +1 -1
  24. data/lib/rgeo/impl_helper/utils.rb +67 -0
  25. data/lib/rgeo/wkrep/wkb_generator.rb +4 -4
  26. data/lib/rgeo/wkrep/wkb_parser.rb +4 -4
  27. data/lib/rgeo/wkrep/wkt_generator.rb +4 -4
  28. data/lib/rgeo/wkrep/wkt_parser.rb +5 -5
  29. data/test/common/factory_tests.rb +117 -0
  30. data/test/common/geometry_collection_tests.rb +25 -0
  31. data/test/coord_sys/tc_active_record_table.rb +4 -5
  32. data/test/coord_sys/tc_ogc_cs.rb +0 -6
  33. data/test/coord_sys/tc_proj4.rb +4 -6
  34. data/test/geos_capi/tc_factory.rb +5 -33
  35. data/test/geos_capi/tc_zmfactory.rb +6 -0
  36. data/test/geos_ffi/tc_factory.rb +5 -33
  37. data/test/geos_ffi/tc_zmfactory.rb +6 -0
  38. data/test/projected_geographic/tc_factory.rb +63 -0
  39. data/test/simple_cartesian/tc_factory.rb +66 -0
  40. data/test/simple_mercator/tc_factory.rb +63 -0
  41. data/test/spherical_geographic/tc_factory.rb +66 -0
  42. data/test/tc_types.rb +4 -0
  43. metadata +12 -2
@@ -0,0 +1,66 @@
1
+ # -----------------------------------------------------------------------------
2
+ #
3
+ # Tests for the GEOS factory
4
+ #
5
+ # -----------------------------------------------------------------------------
6
+ # Copyright 2010-2012 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
+ require ::File.expand_path('../common/factory_tests.rb', ::File.dirname(__FILE__))
41
+
42
+
43
+ module RGeo
44
+ module Tests # :nodoc:
45
+ module SphericalGeographic # :nodoc:
46
+
47
+ class TestFactory < ::Test::Unit::TestCase # :nodoc:
48
+
49
+
50
+ def setup
51
+ @factory = ::RGeo::Geographic.spherical_factory
52
+ @srid = 4055
53
+ end
54
+
55
+
56
+ include ::RGeo::Tests::Common::FactoryTests
57
+
58
+
59
+ undef_method :test_srid_preserved_through_geom_operations
60
+
61
+
62
+ end
63
+
64
+ end
65
+ end
66
+ end
data/test/tc_types.rb CHANGED
@@ -75,3 +75,7 @@ module RGeo
75
75
 
76
76
  end
77
77
  end
78
+
79
+ unless ::RGeo.yaml_supported?
80
+ puts "WARNING: Psych not installed. Skipping YAML tests."
81
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgeo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-27 00:00:00.000000000 Z
12
+ date: 2012-03-06 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: RGeo is a geospatial data library for Ruby. It provides an implementation
15
15
  of the Open Geospatial Consortium's Simple Features Specification, used by most
@@ -89,6 +89,7 @@ files:
89
89
  - lib/rgeo/impl_helper/basic_point_methods.rb
90
90
  - lib/rgeo/impl_helper/basic_polygon_methods.rb
91
91
  - lib/rgeo/impl_helper/math.rb
92
+ - lib/rgeo/impl_helper/utils.rb
92
93
  - lib/rgeo/impl_helper.rb
93
94
  - lib/rgeo/version.rb
94
95
  - lib/rgeo/wkrep/wkb_generator.rb
@@ -115,6 +116,7 @@ files:
115
116
  - ext/geos_c_impl/point.h
116
117
  - ext/geos_c_impl/polygon.h
117
118
  - ext/geos_c_impl/preface.h
119
+ - test/common/factory_tests.rb
118
120
  - test/common/geometry_collection_tests.rb
119
121
  - test/common/line_string_tests.rb
120
122
  - test/common/multi_line_string_tests.rb
@@ -150,6 +152,7 @@ files:
150
152
  - test/geos_ffi/tc_point.rb
151
153
  - test/geos_ffi/tc_polygon.rb
152
154
  - test/geos_ffi/tc_zmfactory.rb
155
+ - test/projected_geographic/tc_factory.rb
153
156
  - test/projected_geographic/tc_geometry_collection.rb
154
157
  - test/projected_geographic/tc_line_string.rb
155
158
  - test/projected_geographic/tc_multi_line_string.rb
@@ -158,6 +161,7 @@ files:
158
161
  - test/projected_geographic/tc_point.rb
159
162
  - test/projected_geographic/tc_polygon.rb
160
163
  - test/simple_cartesian/tc_calculations.rb
164
+ - test/simple_cartesian/tc_factory.rb
161
165
  - test/simple_cartesian/tc_geometry_collection.rb
162
166
  - test/simple_cartesian/tc_line_string.rb
163
167
  - test/simple_cartesian/tc_multi_line_string.rb
@@ -165,6 +169,7 @@ files:
165
169
  - test/simple_cartesian/tc_multi_polygon.rb
166
170
  - test/simple_cartesian/tc_point.rb
167
171
  - test/simple_cartesian/tc_polygon.rb
172
+ - test/simple_mercator/tc_factory.rb
168
173
  - test/simple_mercator/tc_geometry_collection.rb
169
174
  - test/simple_mercator/tc_line_string.rb
170
175
  - test/simple_mercator/tc_multi_line_string.rb
@@ -174,6 +179,7 @@ files:
174
179
  - test/simple_mercator/tc_polygon.rb
175
180
  - test/simple_mercator/tc_window.rb
176
181
  - test/spherical_geographic/tc_calculations.rb
182
+ - test/spherical_geographic/tc_factory.rb
177
183
  - test/spherical_geographic/tc_geometry_collection.rb
178
184
  - test/spherical_geographic/tc_line_string.rb
179
185
  - test/spherical_geographic/tc_multi_line_string.rb
@@ -246,6 +252,7 @@ test_files:
246
252
  - test/geos_ffi/tc_point.rb
247
253
  - test/geos_ffi/tc_polygon.rb
248
254
  - test/geos_ffi/tc_zmfactory.rb
255
+ - test/projected_geographic/tc_factory.rb
249
256
  - test/projected_geographic/tc_geometry_collection.rb
250
257
  - test/projected_geographic/tc_line_string.rb
251
258
  - test/projected_geographic/tc_multi_line_string.rb
@@ -254,6 +261,7 @@ test_files:
254
261
  - test/projected_geographic/tc_point.rb
255
262
  - test/projected_geographic/tc_polygon.rb
256
263
  - test/simple_cartesian/tc_calculations.rb
264
+ - test/simple_cartesian/tc_factory.rb
257
265
  - test/simple_cartesian/tc_geometry_collection.rb
258
266
  - test/simple_cartesian/tc_line_string.rb
259
267
  - test/simple_cartesian/tc_multi_line_string.rb
@@ -261,6 +269,7 @@ test_files:
261
269
  - test/simple_cartesian/tc_multi_polygon.rb
262
270
  - test/simple_cartesian/tc_point.rb
263
271
  - test/simple_cartesian/tc_polygon.rb
272
+ - test/simple_mercator/tc_factory.rb
264
273
  - test/simple_mercator/tc_geometry_collection.rb
265
274
  - test/simple_mercator/tc_line_string.rb
266
275
  - test/simple_mercator/tc_multi_line_string.rb
@@ -270,6 +279,7 @@ test_files:
270
279
  - test/simple_mercator/tc_polygon.rb
271
280
  - test/simple_mercator/tc_window.rb
272
281
  - test/spherical_geographic/tc_calculations.rb
282
+ - test/spherical_geographic/tc_factory.rb
273
283
  - test/spherical_geographic/tc_geometry_collection.rb
274
284
  - test/spherical_geographic/tc_line_string.rb
275
285
  - test/spherical_geographic/tc_multi_line_string.rb