rgeo 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. data/History.rdoc +9 -7
  2. data/README.rdoc +7 -5
  3. data/Version +1 -1
  4. data/ext/geos_c_impl/factory.c +12 -19
  5. data/ext/geos_c_impl/factory.h +15 -21
  6. data/ext/geos_c_impl/geometry.c +19 -36
  7. data/ext/geos_c_impl/geometry.h +2 -12
  8. data/ext/geos_c_impl/geometry_collection.c +38 -157
  9. data/ext/geos_c_impl/geometry_collection.h +2 -12
  10. data/ext/geos_c_impl/line_string.c +83 -80
  11. data/ext/geos_c_impl/line_string.h +2 -12
  12. data/ext/geos_c_impl/main.c +5 -0
  13. data/ext/geos_c_impl/point.c +2 -12
  14. data/ext/geos_c_impl/point.h +2 -12
  15. data/ext/geos_c_impl/polygon.c +5 -14
  16. data/ext/geos_c_impl/polygon.h +2 -12
  17. data/ext/geos_c_impl/preface.h +8 -0
  18. data/lib/rgeo.rb +34 -16
  19. data/lib/rgeo/{geography/simple_spherical/geometry_collection_impl.rb → cartesian.rb} +19 -26
  20. data/lib/rgeo/cartesian/calculations.rb +129 -0
  21. data/lib/rgeo/cartesian/interface.rb +85 -0
  22. data/lib/rgeo/cartesian/simple_factory.rb +159 -0
  23. data/lib/rgeo/cartesian/simple_feature_classes.rb +187 -0
  24. data/lib/rgeo/cartesian/simple_feature_methods.rb +97 -0
  25. data/lib/rgeo/features.rb +1 -0
  26. data/lib/rgeo/features/curve.rb +3 -2
  27. data/lib/rgeo/features/factory.rb +62 -37
  28. data/lib/rgeo/features/geometry.rb +10 -32
  29. data/lib/rgeo/features/geometry_collection.rb +3 -2
  30. data/lib/rgeo/features/line.rb +3 -2
  31. data/lib/rgeo/features/line_string.rb +3 -2
  32. data/lib/rgeo/features/linear_ring.rb +3 -2
  33. data/lib/rgeo/features/multi_curve.rb +3 -2
  34. data/lib/rgeo/features/multi_line_string.rb +3 -2
  35. data/lib/rgeo/features/multi_point.rb +3 -2
  36. data/lib/rgeo/features/multi_polygon.rb +3 -2
  37. data/lib/rgeo/features/multi_surface.rb +3 -2
  38. data/lib/rgeo/features/point.rb +3 -2
  39. data/lib/rgeo/features/polygon.rb +3 -2
  40. data/lib/rgeo/features/surface.rb +3 -2
  41. data/lib/rgeo/features/types.rb +198 -0
  42. data/lib/rgeo/geography.rb +4 -14
  43. data/lib/rgeo/geography/factory.rb +7 -64
  44. data/lib/rgeo/geography/{simple_spherical/geometry_methods.rb → helper.rb} +4 -13
  45. data/lib/rgeo/geography/simple_mercator/feature_classes.rb +35 -89
  46. data/lib/rgeo/geography/simple_mercator/feature_methods.rb +22 -31
  47. data/lib/rgeo/geography/simple_mercator/projector.rb +4 -8
  48. data/lib/rgeo/geography/simple_spherical/calculations.rb +11 -9
  49. data/lib/rgeo/geography/simple_spherical/feature_classes.rb +189 -0
  50. data/lib/rgeo/geography/simple_spherical/{line_string_impl.rb → feature_methods.rb} +16 -64
  51. data/lib/rgeo/geos/factory.rb +26 -40
  52. data/lib/rgeo/geos/impl_additions.rb +3 -5
  53. data/lib/rgeo/{geography/simple_spherical/polygon_impl.rb → impl_helpers.rb} +16 -26
  54. data/lib/rgeo/impl_helpers/basic_geometry_collection_methods.rb +186 -0
  55. data/lib/rgeo/impl_helpers/basic_geometry_methods.rb +90 -0
  56. data/lib/rgeo/impl_helpers/basic_line_string_methods.rb +188 -0
  57. data/lib/rgeo/impl_helpers/basic_point_methods.rb +149 -0
  58. data/lib/rgeo/{geography/common/helper.rb → impl_helpers/basic_polygon_methods.rb} +62 -53
  59. data/lib/rgeo/{geography/common/polygon_methods.rb → impl_helpers/serialization.rb} +50 -42
  60. data/tests/common/geometry_collection_tests.rb +9 -7
  61. data/tests/common/multi_line_string_tests.rb +16 -13
  62. data/tests/common/multi_point_tests.rb +16 -13
  63. data/tests/common/multi_polygon_tests.rb +8 -6
  64. data/tests/common/point_tests.rb +1 -2
  65. data/tests/common/polygon_tests.rb +9 -9
  66. data/tests/geos/tc_multi_line_string.rb +2 -2
  67. data/tests/simple_cartesian/tc_calculations.rb +138 -0
  68. data/tests/simple_cartesian/tc_geometry_collection.rb +68 -0
  69. data/tests/simple_cartesian/tc_line_string.rb +70 -0
  70. data/{lib/rgeo/geography/simple_spherical/multi_line_string_impl.rb → tests/simple_cartesian/tc_multi_line_string.rb} +19 -19
  71. data/{lib/rgeo/geography/simple_spherical/multi_polygon_impl.rb → tests/simple_cartesian/tc_multi_point.rb} +19 -19
  72. data/{lib/rgeo/geography/common/geometry_methods.rb → tests/simple_cartesian/tc_multi_polygon.rb} +19 -41
  73. data/{lib/rgeo/geography/simple_spherical/point_impl.rb → tests/simple_cartesian/tc_point.rb} +33 -35
  74. data/tests/simple_cartesian/tc_polygon.rb +67 -0
  75. data/tests/simple_spherical/tc_geometry_collection.rb +68 -0
  76. data/tests/simple_spherical/tc_line_string.rb +10 -171
  77. data/tests/simple_spherical/tc_multi_line_string.rb +67 -0
  78. data/{lib/rgeo/geography/simple_spherical/multi_point_impl.rb → tests/simple_spherical/tc_multi_point.rb} +19 -19
  79. data/tests/simple_spherical/tc_multi_polygon.rb +70 -0
  80. data/tests/simple_spherical/tc_point.rb +17 -115
  81. data/tests/simple_spherical/tc_polygon.rb +67 -0
  82. metadata +46 -18
  83. data/ext/geos_c_impl/globals.h +0 -58
  84. data/lib/rgeo/geography/common/geometry_collection_methods.rb +0 -217
  85. data/lib/rgeo/geography/common/line_string_methods.rb +0 -201
  86. data/lib/rgeo/geography/common/point_methods.rb +0 -153
@@ -1,6 +1,6 @@
1
1
  # -----------------------------------------------------------------------------
2
2
  #
3
- # Common methods for Polygon geography features
3
+ # Basic methods used by geometry objects
4
4
  #
5
5
  # -----------------------------------------------------------------------------
6
6
  # Copyright 2010 Daniel Azuma
@@ -36,87 +36,95 @@
36
36
 
37
37
  module RGeo
38
38
 
39
- module Geography
39
+ module ImplHelpers # :nodoc:
40
40
 
41
- module Common
41
+
42
+ module Serialization # :nodoc:
42
43
 
44
+ @helper_factory = false
43
45
 
44
- module PolygonMethods
46
+ class << self
45
47
 
46
48
 
47
- def _setup(exterior_ring_, interior_rings_)
48
- @exterior_ring = factory.cast(exterior_ring_)
49
- @interior_rings = (interior_rings_ || []).map{ |elem_| factory.cast(elem_) }
50
- unless Features::LinearRing.check_type(@exterior_ring)
51
- raise Errors::InvalidGeometry, 'Exterior ring must be a LinearRing'
52
- end
53
- @interior_rings.each do |ring_|
54
- unless Features::LinearRing.check_type(ring_)
55
- raise Errors::InvalidGeometry, 'Interior ring must be a LinearRing'
49
+ def _helper_factory
50
+ if @helper_factory == false
51
+ if Geos.supported?
52
+ @helper_factory = Geos.factory(:srid => 0)
53
+ else
54
+ @helper_factory = nil
56
55
  end
57
56
  end
58
- _validate_geometry
57
+ @helper_factory
59
58
  end
60
59
 
61
60
 
62
- def cast(type_)
63
- case type_
64
- when Features::Polygon
65
- self
66
- when Features::LinearRing
67
- @exterior_ring
68
- when Features::LineString
69
- @exterior_ring.cast(type_)
70
- when Features::GeometryCollection
71
- factory.collection([self]) rescue nil
72
- when Features::MultiPolygon
73
- factory.multi_polygon([self]) rescue nil
61
+ def parse_wkt(str_, factory_)
62
+ helper_factory_ = _helper_factory
63
+ if helper_factory_
64
+ obj_ = helper_factory_.parse_wkt(str_)
65
+ obj_ ? Features.cast(obj_, factory_) : nil
74
66
  else
75
- super
67
+ default_parse_wkt(str_, factory_)
76
68
  end
77
69
  end
78
70
 
79
71
 
80
- def exterior_ring
81
- @exterior_ring
72
+ def parse_wkb(str_, factory_)
73
+ helper_factory_ = _helper_factory
74
+ if helper_factory_
75
+ obj_ = helper_factory_.parse_wkb(str_)
76
+ obj_ ? Features.cast(obj_, factory_) : nil
77
+ else
78
+ default_parse_wkb(str_, factory_)
79
+ end
82
80
  end
83
81
 
84
82
 
85
- def num_interior_rings
86
- @interior_rings.size
83
+ def unparse_wkt(obj_)
84
+ helper_factory_ = _helper_factory
85
+ if helper_factory_
86
+ Features.cast(obj_, helper_factory_).as_text
87
+ else
88
+ default_unparse_wkt(obj_)
89
+ end
87
90
  end
88
91
 
89
92
 
90
- def interior_ring_n(n_)
91
- @interior_rings[n_]
93
+ def unparse_wkb(obj_)
94
+ helper_factory_ = _helper_factory
95
+ if helper_factory_
96
+ Features.cast(obj_, helper_factory_).as_binary
97
+ else
98
+ default_unparse_wkb(obj_)
99
+ end
92
100
  end
93
101
 
94
102
 
95
- def interior_rings
96
- @interior_rings.dup
103
+ def default_parse_wkt(str_, factory_)
104
+ nil # TODO
97
105
  end
98
106
 
99
107
 
100
- def dimension
101
- 2
108
+ def default_parse_wkb(str_, factory_)
109
+ nil # TODO
102
110
  end
103
111
 
104
112
 
105
- def geometry_type
106
- Features::Polygon
113
+ def default_unparse_wkt(obj_)
114
+ nil # TODO
107
115
  end
108
116
 
109
117
 
110
- def is_empty?
111
- @exterior_ring.is_empty?
118
+ def default_unparse_wkb(obj_)
119
+ nil # TODO
112
120
  end
113
121
 
114
122
 
115
123
  end
116
124
 
117
-
118
125
  end
119
126
 
127
+
120
128
  end
121
129
 
122
130
  end
@@ -62,7 +62,8 @@ module RGeo
62
62
  assert(::RGeo::Features::GeometryCollection === geom_)
63
63
  assert_equal(::RGeo::Features::GeometryCollection, geom_.geometry_type)
64
64
  assert_equal(2, geom_.num_geometries)
65
- assert_equal([@point1, @line1], geom_.to_a)
65
+ assert(@point1.eql?(geom_[0]))
66
+ assert(@line1.eql?(geom_[1]))
66
67
  end
67
68
 
68
69
 
@@ -105,7 +106,7 @@ module RGeo
105
106
  assert(::RGeo::Features::GeometryCollection === geom2_)
106
107
  assert_equal(::RGeo::Features::GeometryCollection, geom2_.geometry_type)
107
108
  assert_equal(2, geom2_.num_geometries)
108
- assert(::RGeo::Features::Line === geom2_[1][1])
109
+ assert_equal(::RGeo::Features::Line, geom2_[1][1].geometry_type)
109
110
  end
110
111
 
111
112
 
@@ -144,7 +145,7 @@ module RGeo
144
145
  def test_wkt_creation_simple
145
146
  parsed_geom_ = @factory.parse_wkt('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(-4 2, -5 3))')
146
147
  built_geom_ = @factory.collection([@point1, @line1])
147
- assert_equal(built_geom_, parsed_geom_)
148
+ assert(built_geom_.eql?(parsed_geom_))
148
149
  end
149
150
 
150
151
 
@@ -158,10 +159,11 @@ module RGeo
158
159
  def test_clone
159
160
  geom1_ = @factory.collection([@point1, @line1])
160
161
  geom2_ = geom1_.clone
161
- assert_equal(geom1_, geom2_)
162
+ assert(geom1_.eql?(geom2_))
162
163
  assert_equal(::RGeo::Features::GeometryCollection, geom2_.geometry_type)
163
164
  assert_equal(2, geom2_.num_geometries)
164
- assert_equal([@point1, @line1], geom2_.to_a)
165
+ assert(@point1.eql?(geom2_[0]))
166
+ assert(@line1.eql?(geom2_[1]))
165
167
  end
166
168
 
167
169
 
@@ -183,7 +185,7 @@ module RGeo
183
185
  geom1_ = @factory.collection([@point1, @line1])
184
186
  text_ = geom1_.as_text
185
187
  geom2_ = @factory.parse_wkt(text_)
186
- assert_equal(geom1_, geom2_)
188
+ assert(geom1_.eql?(geom2_))
187
189
  end
188
190
 
189
191
 
@@ -191,7 +193,7 @@ module RGeo
191
193
  geom1_ = @factory.collection([@point1, @line1])
192
194
  binary_ = geom1_.as_binary
193
195
  geom2_ = @factory.parse_wkb(binary_)
194
- assert_equal(geom1_, geom2_)
196
+ assert(geom1_.eql?(geom2_))
195
197
  end
196
198
 
197
199
 
@@ -64,7 +64,8 @@ module RGeo
64
64
  assert(::RGeo::Features::MultiLineString === geom_)
65
65
  assert_equal(::RGeo::Features::MultiLineString, geom_.geometry_type)
66
66
  assert_equal(2, geom_.num_geometries)
67
- assert_equal([@linestring1, @linestring2], geom_.to_a)
67
+ assert(@linestring1.eql?(geom_[0]))
68
+ assert(@linestring2.eql?(geom_[1]))
68
69
  end
69
70
 
70
71
 
@@ -89,16 +90,17 @@ module RGeo
89
90
  end
90
91
 
91
92
 
92
- def test_creation_compound
93
- mls1_ = @factory.multi_line_string([@linestring1, @linestring2])
94
- mls2_ = @factory.collection([@line1])
95
- mls3_ = @factory.collection([mls1_])
96
- geom_ = @factory.multi_line_string([mls3_, mls2_, @linearring1])
93
+ def test_creation_casting
94
+ mls1_ = @factory.collection([@line1])
95
+ mls2_ = @factory.multi_line_string([@linearring1])
96
+ geom_ = @factory.multi_line_string([@linestring1, @linestring2, mls1_, mls2_])
97
97
  assert_not_nil(geom_)
98
- assert(::RGeo::Features::MultiLineString === geom_)
99
98
  assert_equal(::RGeo::Features::MultiLineString, geom_.geometry_type)
100
99
  assert_equal(4, geom_.num_geometries)
101
- assert(geom_.to_a.eql?([@linestring1, @linestring2, @line1, @linearring1]))
100
+ assert(@linestring1.eql?(geom_[0]))
101
+ assert(@linestring2.eql?(geom_[1]))
102
+ assert(@line1.eql?(geom_[2]))
103
+ assert(@linearring1.eql?(geom_[3]))
102
104
  end
103
105
 
104
106
 
@@ -129,7 +131,7 @@ module RGeo
129
131
  def test_wkt_creation_simple
130
132
  parsed_geom_ = @factory.parse_wkt('MULTILINESTRING((0 0, 1 0), (-4 2, -5 3, -3 5))')
131
133
  built_geom_ = @factory.multi_line_string([@linestring1, @linestring2])
132
- assert_equal(built_geom_, parsed_geom_)
134
+ assert(built_geom_.eql?(parsed_geom_))
133
135
  end
134
136
 
135
137
 
@@ -144,10 +146,11 @@ module RGeo
144
146
  def test_clone
145
147
  geom1_ = @factory.multi_line_string([@linestring1, @linestring2])
146
148
  geom2_ = geom1_.clone
147
- assert_equal(geom1_, geom2_)
149
+ assert(geom1_.eql?(geom2_))
148
150
  assert_equal(::RGeo::Features::MultiLineString, geom2_.geometry_type)
149
151
  assert_equal(2, geom2_.num_geometries)
150
- assert_equal([@linestring1, @linestring2], geom2_.to_a)
152
+ assert(@linestring1.eql?(geom2_[0]))
153
+ assert(@linestring2.eql?(geom2_[1]))
151
154
  end
152
155
 
153
156
 
@@ -171,7 +174,7 @@ module RGeo
171
174
  geom1_ = @factory.multi_line_string([@linestring1, @linestring2])
172
175
  text_ = geom1_.as_text
173
176
  geom2_ = @factory.parse_wkt(text_)
174
- assert_equal(geom1_, geom2_)
177
+ assert(geom1_.eql?(geom2_))
175
178
  end
176
179
 
177
180
 
@@ -179,7 +182,7 @@ module RGeo
179
182
  geom1_ = @factory.multi_line_string([@linestring1, @linestring2])
180
183
  binary_ = geom1_.as_binary
181
184
  geom2_ = @factory.parse_wkb(binary_)
182
- assert_equal(geom1_, geom2_)
185
+ assert(geom1_.eql?(geom2_))
183
186
  end
184
187
 
185
188
 
@@ -60,7 +60,8 @@ module RGeo
60
60
  assert(::RGeo::Features::MultiPoint === geom_)
61
61
  assert_equal(::RGeo::Features::MultiPoint, geom_.geometry_type)
62
62
  assert_equal(2, geom_.num_geometries)
63
- assert_equal([@point1, @point2], geom_.to_a)
63
+ assert(@point1.eql?(geom_[0]))
64
+ assert(@point2.eql?(geom_[1]))
64
65
  end
65
66
 
66
67
 
@@ -74,16 +75,17 @@ module RGeo
74
75
  end
75
76
 
76
77
 
77
- def test_creation_compound
78
- mp1_ = @factory.multi_point([@point1, @point2])
79
- mp2_ = @factory.collection([@point3])
80
- mp3_ = @factory.collection([mp1_])
81
- geom_ = @factory.multi_point([mp3_, mp2_, @point4])
78
+ def test_creation_casting
79
+ mp1_ = @factory.collection([@point3])
80
+ mp2_ = @factory.multi_point([@point4])
81
+ geom_ = @factory.multi_point([@point1, @point2, mp1_, mp2_])
82
82
  assert_not_nil(geom_)
83
- assert(::RGeo::Features::MultiPoint === geom_)
84
83
  assert_equal(::RGeo::Features::MultiPoint, geom_.geometry_type)
85
84
  assert_equal(4, geom_.num_geometries)
86
- assert_equal([@point1, @point2, @point3, @point4], geom_.to_a)
85
+ assert(@point1.eql?(geom_[0]))
86
+ assert(@point2.eql?(geom_[1]))
87
+ assert(@point3.eql?(geom_[2]))
88
+ assert(@point4.eql?(geom_[3]))
87
89
  end
88
90
 
89
91
 
@@ -121,7 +123,7 @@ module RGeo
121
123
  def test_wkt_creation_simple
122
124
  parsed_geom_ = @factory.parse_wkt('MULTIPOINT((0 0), (-4 2), (-5 3))')
123
125
  built_geom_ = @factory.multi_point([@point1, @point3, @point4])
124
- assert_equal(built_geom_, parsed_geom_)
126
+ assert(built_geom_.eql?(parsed_geom_))
125
127
  end
126
128
 
127
129
 
@@ -136,10 +138,11 @@ module RGeo
136
138
  def test_clone
137
139
  geom1_ = @factory.multi_point([@point1, @point2])
138
140
  geom2_ = geom1_.clone
139
- assert_equal(geom1_, geom2_)
141
+ assert(geom1_.eql?(geom2_))
140
142
  assert_equal(::RGeo::Features::MultiPoint, geom2_.geometry_type)
141
143
  assert_equal(2, geom2_.num_geometries)
142
- assert_equal([@point1, @point2], geom2_.to_a)
144
+ assert(@point1.eql?(geom2_[0]))
145
+ assert(@point2.eql?(geom2_[1]))
143
146
  end
144
147
 
145
148
 
@@ -163,7 +166,7 @@ module RGeo
163
166
  geom1_ = @factory.multi_point([@point1, @point2])
164
167
  text_ = geom1_.as_text
165
168
  geom2_ = @factory.parse_wkt(text_)
166
- assert_equal(geom1_, geom2_)
169
+ assert(geom1_.eql?(geom2_))
167
170
  end
168
171
 
169
172
 
@@ -171,7 +174,7 @@ module RGeo
171
174
  geom1_ = @factory.multi_point([@point1, @point2])
172
175
  binary_ = geom1_.as_binary
173
176
  geom2_ = @factory.parse_wkb(binary_)
174
- assert_equal(geom1_, geom2_)
177
+ assert(geom1_.eql?(geom2_))
175
178
  end
176
179
 
177
180
 
@@ -74,7 +74,8 @@ module RGeo
74
74
  assert(::RGeo::Features::MultiPolygon === geom_)
75
75
  assert_equal(::RGeo::Features::MultiPolygon, geom_.geometry_type)
76
76
  assert_equal(2, geom_.num_geometries)
77
- assert_equal([@poly1, @poly2], geom_.to_a)
77
+ assert(@poly1.eql?(geom_[0]))
78
+ assert(@poly2.eql?(geom_[1]))
78
79
  end
79
80
 
80
81
 
@@ -129,7 +130,7 @@ module RGeo
129
130
  def test_wkt_creation_simple
130
131
  parsed_geom_ = @factory.parse_wkt('MULTIPOLYGON(((0 0, 0 -10, -10 0, 0 0)), ((0 0, 0 10, 10 10, 10 0, 0 0), (4 4, 5 6, 6 4, 4 4)))')
131
132
  built_geom_ = @factory.multi_polygon([@poly1, @poly2])
132
- assert_equal(built_geom_, parsed_geom_)
133
+ assert(built_geom_.eql?(parsed_geom_))
133
134
  end
134
135
 
135
136
 
@@ -144,10 +145,11 @@ module RGeo
144
145
  def test_clone
145
146
  geom1_ = @factory.multi_polygon([@poly1, @poly2])
146
147
  geom2_ = geom1_.clone
147
- assert_equal(geom1_, geom2_)
148
+ assert(geom1_.eql?(geom2_))
148
149
  assert_equal(::RGeo::Features::MultiPolygon, geom2_.geometry_type)
149
150
  assert_equal(2, geom2_.num_geometries)
150
- assert_equal([@poly1, @poly2], geom2_.to_a)
151
+ assert(@poly1.eql?(geom2_[0]))
152
+ assert(@poly2.eql?(geom2_[1]))
151
153
  end
152
154
 
153
155
 
@@ -171,7 +173,7 @@ module RGeo
171
173
  geom1_ = @factory.multi_polygon([@poly1, @poly2])
172
174
  text_ = geom1_.as_text
173
175
  geom2_ = @factory.parse_wkt(text_)
174
- assert_equal(geom1_, geom2_)
176
+ assert(geom1_.eql?(geom2_))
175
177
  end
176
178
 
177
179
 
@@ -179,7 +181,7 @@ module RGeo
179
181
  geom1_ = @factory.multi_polygon([@poly1, @poly2])
180
182
  binary_ = geom1_.as_binary
181
183
  geom2_ = @factory.parse_wkb(binary_)
182
- assert_equal(geom1_, geom2_)
184
+ assert(geom1_.eql?(geom2_))
183
185
  end
184
186
 
185
187
 
@@ -219,8 +219,7 @@ module RGeo
219
219
 
220
220
  def test_convex_hull
221
221
  point_ = @factory.point(11, 12)
222
- hull_ = point_.convex_hull
223
- assert_close_enough(point_, hull_)
222
+ assert_close_enough(point_, point_.convex_hull)
224
223
  end
225
224
 
226
225
 
@@ -53,7 +53,7 @@ module RGeo
53
53
  assert_not_nil(polygon_)
54
54
  assert(::RGeo::Features::Polygon === polygon_)
55
55
  assert_equal(::RGeo::Features::Polygon, polygon_.geometry_type)
56
- assert_equal(exterior_, polygon_.exterior_ring)
56
+ assert(exterior_.eql?(polygon_.exterior_ring))
57
57
  assert_equal(0, polygon_.num_interior_rings)
58
58
  end
59
59
 
@@ -72,9 +72,9 @@ module RGeo
72
72
  assert_not_nil(polygon_)
73
73
  assert(::RGeo::Features::Polygon === polygon_)
74
74
  assert_equal(::RGeo::Features::Polygon, polygon_.geometry_type)
75
- assert_equal(exterior_, polygon_.exterior_ring)
75
+ assert(exterior_.eql?(polygon_.exterior_ring))
76
76
  assert_equal(1, polygon_.num_interior_rings)
77
- assert_equal([interior_], polygon_.interior_rings)
77
+ assert(interior_.eql?(polygon_.interior_ring_n(0)))
78
78
  end
79
79
 
80
80
 
@@ -127,7 +127,7 @@ module RGeo
127
127
  point3_ = @factory.point(1, 0)
128
128
  exterior_ = @factory.linear_ring([point1_, point2_, point3_, point1_])
129
129
  built_poly_ = @factory.polygon(exterior_)
130
- assert_equal(built_poly_, parsed_poly_)
130
+ assert(built_poly_.eql?(parsed_poly_))
131
131
  end
132
132
 
133
133
 
@@ -143,7 +143,7 @@ module RGeo
143
143
  exterior_ = @factory.linear_ring([point1_, point2_, point3_, point4_, point1_])
144
144
  interior_ = @factory.linear_ring([point5_, point6_, point7_, point5_])
145
145
  built_poly_ = @factory.polygon(exterior_, [interior_])
146
- assert_equal(built_poly_, parsed_poly_)
146
+ assert(built_poly_.eql?(parsed_poly_))
147
147
  end
148
148
 
149
149
 
@@ -154,8 +154,8 @@ module RGeo
154
154
  exterior_ = @factory.linear_ring([point1_, point2_, point3_, point1_])
155
155
  poly1_ = @factory.polygon(exterior_)
156
156
  poly2_ = poly1_.clone
157
- assert_equal(poly1_, poly2_)
158
- assert_equal(exterior_, poly2_.exterior_ring)
157
+ assert(poly1_.eql?(poly2_))
158
+ assert(exterior_.eql?(poly2_.exterior_ring))
159
159
  assert_equal(0, poly2_.num_interior_rings)
160
160
  end
161
161
 
@@ -182,7 +182,7 @@ module RGeo
182
182
  poly1_ = @factory.polygon(exterior_)
183
183
  text_ = poly1_.as_text
184
184
  poly2_ = @factory.parse_wkt(text_)
185
- assert_equal(poly1_, poly2_)
185
+ assert(poly1_.eql?(poly2_))
186
186
  end
187
187
 
188
188
 
@@ -194,7 +194,7 @@ module RGeo
194
194
  poly1_ = @factory.polygon(exterior_)
195
195
  binary_ = poly1_.as_binary
196
196
  poly2_ = @factory.parse_wkb(binary_)
197
- assert_equal(poly1_, poly2_)
197
+ assert(poly1_.eql?(poly2_))
198
198
  end
199
199
 
200
200