rgeo 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +29 -0
- data/ext/geos_c_impl/Makefile_2.2.3 +260 -0
- data/ext/geos_c_impl/coordinates.c +65 -0
- data/ext/geos_c_impl/coordinates.h +2 -0
- data/ext/geos_c_impl/extconf.rb +19 -43
- data/ext/geos_c_impl/geometry.c +24 -0
- data/ext/geos_c_impl/geometry_collection.c +99 -1
- data/ext/geos_c_impl/geos_c_impl_2.2.3.bundle +0 -0
- data/ext/geos_c_impl/line_string.c +38 -0
- data/ext/geos_c_impl/mkmf.log +123 -0
- data/ext/geos_c_impl/point.c +27 -0
- data/ext/geos_c_impl/polygon.c +26 -0
- data/ext/proj4_c_impl/Makefile_2.2.3 +260 -0
- data/ext/proj4_c_impl/extconf.rb +32 -32
- data/ext/proj4_c_impl/mkmf.log +47 -0
- data/ext/proj4_c_impl/proj4_c_impl_2.2.3.bundle +0 -0
- data/lib/rgeo.rb +10 -11
- data/lib/rgeo/cartesian.rb +7 -12
- data/lib/rgeo/cartesian/analysis.rb +13 -26
- data/lib/rgeo/cartesian/bounding_box.rb +45 -114
- data/lib/rgeo/cartesian/calculations.rb +3 -21
- data/lib/rgeo/cartesian/factory.rb +101 -122
- data/lib/rgeo/cartesian/feature_classes.rb +9 -59
- data/lib/rgeo/cartesian/feature_methods.rb +15 -45
- data/lib/rgeo/cartesian/interface.rb +6 -17
- data/lib/rgeo/coord_sys.rb +9 -15
- data/lib/rgeo/coord_sys/cs/entities.rb +84 -330
- data/lib/rgeo/coord_sys/cs/factories.rb +2 -32
- data/lib/rgeo/coord_sys/cs/wkt_parser.rb +52 -80
- data/lib/rgeo/coord_sys/proj4.rb +28 -67
- data/lib/rgeo/coord_sys/proj4_c_impl.bundle +0 -0
- data/lib/rgeo/coord_sys/srs_database/interface.rb +4 -24
- data/lib/rgeo/coord_sys/srs_database/proj4_data.rb +20 -38
- data/lib/rgeo/coord_sys/srs_database/sr_org.rb +6 -22
- data/lib/rgeo/coord_sys/srs_database/url_reader.rb +6 -21
- data/lib/rgeo/error.rb +0 -6
- data/lib/rgeo/feature.rb +18 -23
- data/lib/rgeo/feature/curve.rb +0 -14
- data/lib/rgeo/feature/factory.rb +13 -38
- data/lib/rgeo/feature/factory_generator.rb +4 -16
- data/lib/rgeo/feature/geometry.rb +18 -60
- data/lib/rgeo/feature/geometry_collection.rb +3 -17
- data/lib/rgeo/feature/line.rb +0 -10
- data/lib/rgeo/feature/line_string.rb +1 -13
- data/lib/rgeo/feature/linear_ring.rb +0 -9
- data/lib/rgeo/feature/mixins.rb +11 -36
- data/lib/rgeo/feature/multi_curve.rb +0 -11
- data/lib/rgeo/feature/multi_line_string.rb +0 -9
- data/lib/rgeo/feature/multi_point.rb +0 -9
- data/lib/rgeo/feature/multi_polygon.rb +0 -9
- data/lib/rgeo/feature/multi_surface.rb +0 -12
- data/lib/rgeo/feature/point.rb +0 -13
- data/lib/rgeo/feature/polygon.rb +1 -14
- data/lib/rgeo/feature/surface.rb +0 -12
- data/lib/rgeo/feature/types.rb +19 -61
- data/lib/rgeo/geographic.rb +10 -15
- data/lib/rgeo/geographic/factory.rb +126 -147
- data/lib/rgeo/geographic/interface.rb +67 -81
- data/lib/rgeo/geographic/proj4_projector.rb +13 -37
- data/lib/rgeo/geographic/projected_feature_classes.rb +7 -66
- data/lib/rgeo/geographic/projected_feature_methods.rb +15 -80
- data/lib/rgeo/geographic/projected_window.rb +15 -67
- data/lib/rgeo/geographic/simple_mercator_projector.rb +32 -56
- data/lib/rgeo/geographic/spherical_feature_classes.rb +9 -68
- data/lib/rgeo/geographic/spherical_feature_methods.rb +18 -51
- data/lib/rgeo/geographic/spherical_math.rb +26 -51
- data/lib/rgeo/geos.rb +23 -20
- data/lib/rgeo/geos/capi_factory.rb +125 -131
- data/lib/rgeo/geos/capi_feature_classes.rb +21 -88
- data/lib/rgeo/geos/ffi_factory.rb +90 -143
- data/lib/rgeo/geos/ffi_feature_classes.rb +8 -63
- data/lib/rgeo/geos/ffi_feature_methods.rb +46 -162
- data/lib/rgeo/geos/geos_c_impl.bundle +0 -0
- data/lib/rgeo/geos/interface.rb +4 -23
- data/lib/rgeo/geos/utils.rb +4 -19
- data/lib/rgeo/geos/zm_factory.rb +82 -131
- data/lib/rgeo/geos/zm_feature_classes.rb +8 -63
- data/lib/rgeo/geos/zm_feature_methods.rb +34 -107
- data/lib/rgeo/impl_helper.rb +8 -13
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +27 -71
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +10 -28
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +21 -57
- data/lib/rgeo/impl_helper/basic_point_methods.rb +12 -30
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +9 -28
- data/lib/rgeo/impl_helper/math.rb +4 -10
- data/lib/rgeo/impl_helper/utils.rb +2 -10
- data/lib/rgeo/version.rb +1 -1
- data/lib/rgeo/wkrep.rb +4 -9
- data/lib/rgeo/wkrep/wkb_generator.rb +22 -46
- data/lib/rgeo/wkrep/wkb_parser.rb +25 -52
- data/lib/rgeo/wkrep/wkt_generator.rb +39 -69
- data/lib/rgeo/wkrep/wkt_parser.rb +52 -89
- data/lib/rgeo/yaml.rb +1 -7
- data/test/common/factory_tests.rb +4 -19
- data/test/common/geometry_collection_tests.rb +6 -39
- data/test/common/line_string_tests.rb +10 -39
- data/test/common/multi_line_string_tests.rb +10 -30
- data/test/common/multi_point_tests.rb +15 -34
- data/test/common/multi_polygon_tests.rb +26 -28
- data/test/common/point_tests.rb +37 -59
- data/test/common/polygon_tests.rb +16 -25
- data/test/coord_sys/tc_ogc_cs.rb +151 -186
- data/test/coord_sys/tc_proj4.rb +35 -60
- data/test/coord_sys/tc_proj4_srs_data.rb +15 -24
- data/test/coord_sys/tc_sr_org.rb +11 -19
- data/test/coord_sys/tc_url_reader.rb +13 -23
- data/test/geos_capi/tc_factory.rb +7 -16
- data/test/geos_capi/tc_geometry_collection.rb +6 -14
- data/test/geos_capi/tc_line_string.rb +7 -15
- data/test/geos_capi/tc_misc.rb +26 -41
- data/test/geos_capi/tc_multi_line_string.rb +6 -14
- data/test/geos_capi/tc_multi_point.rb +7 -15
- data/test/geos_capi/tc_multi_polygon.rb +8 -18
- data/test/geos_capi/tc_parsing_unparsing.rb +11 -21
- data/test/geos_capi/tc_point.rb +12 -26
- data/test/geos_capi/tc_polygon.rb +52 -17
- data/test/geos_capi/tc_zmfactory.rb +7 -18
- data/test/geos_ffi/tc_factory.rb +7 -16
- data/test/geos_ffi/tc_geometry_collection.rb +7 -15
- data/test/geos_ffi/tc_line_string.rb +7 -15
- data/test/geos_ffi/tc_misc.rb +8 -18
- data/test/geos_ffi/tc_multi_line_string.rb +7 -15
- data/test/geos_ffi/tc_multi_point.rb +8 -16
- data/test/geos_ffi/tc_multi_polygon.rb +9 -18
- data/test/geos_ffi/tc_parsing_unparsing.rb +14 -24
- data/test/geos_ffi/tc_point.rb +13 -28
- data/test/geos_ffi/tc_polygon.rb +7 -17
- data/test/geos_ffi/tc_zmfactory.rb +8 -19
- data/test/projected_geographic/tc_factory.rb +7 -15
- data/test/projected_geographic/tc_geometry_collection.rb +7 -15
- data/test/projected_geographic/tc_line_string.rb +7 -15
- data/test/projected_geographic/tc_multi_line_string.rb +7 -16
- data/test/projected_geographic/tc_multi_point.rb +8 -17
- data/test/projected_geographic/tc_multi_polygon.rb +8 -16
- data/test/projected_geographic/tc_point.rb +11 -23
- data/test/projected_geographic/tc_polygon.rb +7 -15
- data/test/simple_cartesian/tc_calculations.rb +6 -22
- data/test/simple_cartesian/tc_factory.rb +7 -16
- data/test/simple_cartesian/tc_geometry_collection.rb +6 -15
- data/test/simple_cartesian/tc_line_string.rb +6 -15
- data/test/simple_cartesian/tc_multi_line_string.rb +6 -15
- data/test/simple_cartesian/tc_multi_point.rb +7 -16
- data/test/simple_cartesian/tc_multi_polygon.rb +7 -16
- data/test/simple_cartesian/tc_point.rb +10 -21
- data/test/simple_cartesian/tc_polygon.rb +6 -15
- data/test/simple_mercator/tc_factory.rb +6 -14
- data/test/simple_mercator/tc_geometry_collection.rb +6 -14
- data/test/simple_mercator/tc_line_string.rb +6 -14
- data/test/simple_mercator/tc_multi_line_string.rb +6 -15
- data/test/simple_mercator/tc_multi_point.rb +7 -16
- data/test/simple_mercator/tc_multi_polygon.rb +7 -15
- data/test/simple_mercator/tc_point.rb +11 -24
- data/test/simple_mercator/tc_polygon.rb +6 -14
- data/test/simple_mercator/tc_window.rb +10 -34
- data/test/spherical_geographic/tc_calculations.rb +5 -32
- data/test/spherical_geographic/tc_factory.rb +6 -15
- data/test/spherical_geographic/tc_geometry_collection.rb +6 -15
- data/test/spherical_geographic/tc_line_string.rb +6 -15
- data/test/spherical_geographic/tc_multi_line_string.rb +6 -15
- data/test/spherical_geographic/tc_multi_point.rb +7 -16
- data/test/spherical_geographic/tc_multi_polygon.rb +7 -16
- data/test/spherical_geographic/tc_point.rb +10 -22
- data/test/spherical_geographic/tc_polygon.rb +6 -15
- data/test/tc_cartesian_analysis.rb +4 -16
- data/test/tc_cartesian_bbox.rb +7 -21
- data/test/tc_mixins.rb +8 -25
- data/test/tc_oneoff.rb +5 -13
- data/test/tc_types.rb +7 -16
- data/test/wkrep/tc_wkb_generator.rb +63 -97
- data/test/wkrep/tc_wkb_parser.rb +63 -100
- data/test/wkrep/tc_wkt_generator.rb +54 -92
- data/test/wkrep/tc_wkt_parser.rb +84 -133
- metadata +39 -9
- data/lib/rgeo/coord_sys/srs_database/active_record_table.rb +0 -166
- data/test/coord_sys/tc_active_record_table.rb +0 -79
@@ -5,10 +5,7 @@
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
7
|
module RGeo
|
8
|
-
|
9
8
|
module Feature
|
10
|
-
|
11
|
-
|
12
9
|
# A FactoryGenerator is a callable object (usually a Proc) that
|
13
10
|
# takes a configuration as a hash and returns a factory. These are
|
14
11
|
# often used, e.g., by parsers to determine what factory the parsed
|
@@ -34,8 +31,6 @@ module RGeo
|
|
34
31
|
# factory generator.
|
35
32
|
|
36
33
|
module FactoryGenerator
|
37
|
-
|
38
|
-
|
39
34
|
# Generate a factory given a configuration as a hash.
|
40
35
|
#
|
41
36
|
# If the generator does not recognize or does not support a given
|
@@ -77,32 +72,25 @@ module RGeo
|
|
77
72
|
# [<tt>:has_m_coordinate</tt>]
|
78
73
|
# Support M coordinates. Default is usually false.
|
79
74
|
|
80
|
-
def call(
|
75
|
+
def call(_config_ = {})
|
81
76
|
nil
|
82
77
|
end
|
83
78
|
|
84
|
-
|
85
79
|
# Return a new FactoryGenerator that always returns the given
|
86
80
|
# factory.
|
87
81
|
|
88
82
|
def self.single(factory_)
|
89
|
-
::Proc.new{ |
|
83
|
+
::Proc.new { |_c_| factory_ }
|
90
84
|
end
|
91
85
|
|
92
|
-
|
93
86
|
# Return a new FactoryGenerator that calls the given delegate, but
|
94
87
|
# modifies the configuration passed to it. You can provide defaults
|
95
88
|
# for configuration values not explicitly specified, and you can
|
96
89
|
# force certain values to override the given configuration.
|
97
90
|
|
98
|
-
def self.decorate(delegate_, default_config_={}, force_config_={})
|
99
|
-
::Proc.new{ |c_| delegate_.call(default_config_.merge(c_).merge(force_config_)) }
|
91
|
+
def self.decorate(delegate_, default_config_ = {}, force_config_ = {})
|
92
|
+
::Proc.new { |c_| delegate_.call(default_config_.merge(c_).merge(force_config_)) }
|
100
93
|
end
|
101
|
-
|
102
|
-
|
103
94
|
end
|
104
|
-
|
105
|
-
|
106
95
|
end
|
107
|
-
|
108
96
|
end
|
@@ -5,10 +5,7 @@
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
7
|
module RGeo
|
8
|
-
|
9
8
|
module Feature
|
10
|
-
|
11
|
-
|
12
9
|
# == SFS 1.1 Description
|
13
10
|
#
|
14
11
|
# Geometry is the root class of the hierarchy. Geometry is an abstract
|
@@ -81,10 +78,8 @@ module RGeo
|
|
81
78
|
# of equivalence.
|
82
79
|
|
83
80
|
module Geometry
|
84
|
-
|
85
81
|
extend Type
|
86
82
|
|
87
|
-
|
88
83
|
# Returns a factory for creating features related to this one.
|
89
84
|
# This does not necessarily need to be the same factory that created
|
90
85
|
# this object, but it should create objects that are "compatible"
|
@@ -96,7 +91,6 @@ module RGeo
|
|
96
91
|
raise Error::UnsupportedOperation, "Method Geometry#factory not defined."
|
97
92
|
end
|
98
93
|
|
99
|
-
|
100
94
|
# === SFS 1.1 Description
|
101
95
|
#
|
102
96
|
# The inherent dimension of this geometric object, which must be less
|
@@ -112,7 +106,6 @@ module RGeo
|
|
112
106
|
raise Error::UnsupportedOperation, "Method Geometry#dimension not defined."
|
113
107
|
end
|
114
108
|
|
115
|
-
|
116
109
|
# === SFS 1.1 Description
|
117
110
|
#
|
118
111
|
# Returns the instantiable subtype of Geometry of which this
|
@@ -130,7 +123,6 @@ module RGeo
|
|
130
123
|
raise Error::UnsupportedOperation, "Method Geometry#geometry_type not defined."
|
131
124
|
end
|
132
125
|
|
133
|
-
|
134
126
|
# === SFS 1.1 Description
|
135
127
|
#
|
136
128
|
# Returns the Spatial Reference System ID for this geometric object.
|
@@ -146,7 +138,6 @@ module RGeo
|
|
146
138
|
raise Error::UnsupportedOperation, "Method Geometry#srid not defined."
|
147
139
|
end
|
148
140
|
|
149
|
-
|
150
141
|
# === SFS 1.1 Description
|
151
142
|
#
|
152
143
|
# The minimum bounding box for this Geometry, returned as a Geometry.
|
@@ -161,7 +152,6 @@ module RGeo
|
|
161
152
|
raise Error::UnsupportedOperation, "Method Geometry#envelope not defined."
|
162
153
|
end
|
163
154
|
|
164
|
-
|
165
155
|
# === SFS 1.1 Description
|
166
156
|
#
|
167
157
|
# Exports this geometric object to a specific Well-known Text
|
@@ -175,7 +165,6 @@ module RGeo
|
|
175
165
|
raise Error::UnsupportedOperation, "Method Geometry#as_text not defined."
|
176
166
|
end
|
177
167
|
|
178
|
-
|
179
168
|
# === SFS 1.1 Description
|
180
169
|
#
|
181
170
|
# Exports this geometric object to a specific Well-known Binary
|
@@ -189,7 +178,6 @@ module RGeo
|
|
189
178
|
raise Error::UnsupportedOperation, "Method Geometry#as_binary not defined."
|
190
179
|
end
|
191
180
|
|
192
|
-
|
193
181
|
# === SFS 1.1 Description
|
194
182
|
#
|
195
183
|
# Returns true if this geometric object is the empty Geometry. If true,
|
@@ -205,7 +193,6 @@ module RGeo
|
|
205
193
|
raise Error::UnsupportedOperation, "Method Geometry#is_empty? not defined."
|
206
194
|
end
|
207
195
|
|
208
|
-
|
209
196
|
# === SFS 1.1 Description
|
210
197
|
#
|
211
198
|
# Returns true if this geometric object has no anomalous geometric
|
@@ -223,7 +210,6 @@ module RGeo
|
|
223
210
|
raise Error::UnsupportedOperation, "Method Geometry#is_simple? not defined."
|
224
211
|
end
|
225
212
|
|
226
|
-
|
227
213
|
# === SFS 1.1 Description
|
228
214
|
#
|
229
215
|
# Returns the closure of the combinatorial boundary of this geometric
|
@@ -239,7 +225,6 @@ module RGeo
|
|
239
225
|
raise Error::UnsupportedOperation, "Method Geometry#boundary not defined."
|
240
226
|
end
|
241
227
|
|
242
|
-
|
243
228
|
# === SFS 1.1 Description
|
244
229
|
#
|
245
230
|
# Returns true if this geometric object is "spatially equal" to
|
@@ -255,11 +240,10 @@ module RGeo
|
|
255
240
|
# this geometry, strictly speaking, the result of comparing objects
|
256
241
|
# from different factories is undefined.
|
257
242
|
|
258
|
-
def equals?(
|
243
|
+
def equals?(_another_geometry_)
|
259
244
|
raise Error::UnsupportedOperation, "Method Geometry#equals? not defined."
|
260
245
|
end
|
261
246
|
|
262
|
-
|
263
247
|
# === SFS 1.1 Description
|
264
248
|
#
|
265
249
|
# Returns true if this geometric object is "spatially disjoint" from
|
@@ -275,11 +259,10 @@ module RGeo
|
|
275
259
|
# this geometry, strictly speaking, the result of comparing objects
|
276
260
|
# from different factories is undefined.
|
277
261
|
|
278
|
-
def disjoint?(
|
262
|
+
def disjoint?(_another_geometry_)
|
279
263
|
raise Error::UnsupportedOperation, "Method Geometry#disjoint? not defined."
|
280
264
|
end
|
281
265
|
|
282
|
-
|
283
266
|
# === SFS 1.1 Description
|
284
267
|
#
|
285
268
|
# Returns true if this geometric object "spatially intersects"
|
@@ -295,11 +278,10 @@ module RGeo
|
|
295
278
|
# this geometry, strictly speaking, the result of comparing objects
|
296
279
|
# from different factories is undefined.
|
297
280
|
|
298
|
-
def intersects?(
|
281
|
+
def intersects?(_another_geometry_)
|
299
282
|
raise Error::UnsupportedOperation, "Method Geometry#intersects? not defined."
|
300
283
|
end
|
301
284
|
|
302
|
-
|
303
285
|
# === SFS 1.1 Description
|
304
286
|
#
|
305
287
|
# Returns true if this geometric object "spatially touches"
|
@@ -315,11 +297,10 @@ module RGeo
|
|
315
297
|
# this geometry, strictly speaking, the result of comparing objects
|
316
298
|
# from different factories is undefined.
|
317
299
|
|
318
|
-
def touches?(
|
300
|
+
def touches?(_another_geometry_)
|
319
301
|
raise Error::UnsupportedOperation, "Method Geometry#touches? not defined."
|
320
302
|
end
|
321
303
|
|
322
|
-
|
323
304
|
# === SFS 1.1 Description
|
324
305
|
#
|
325
306
|
# Returns true if this geometric object "spatially crosses"
|
@@ -335,11 +316,10 @@ module RGeo
|
|
335
316
|
# this geometry, strictly speaking, the result of comparing objects
|
336
317
|
# from different factories is undefined.
|
337
318
|
|
338
|
-
def crosses?(
|
319
|
+
def crosses?(_another_geometry_)
|
339
320
|
raise Error::UnsupportedOperation, "Method Geometry#crosses? not defined."
|
340
321
|
end
|
341
322
|
|
342
|
-
|
343
323
|
# === SFS 1.1 Description
|
344
324
|
#
|
345
325
|
# Returns true if this geometric object is "spatially within"
|
@@ -355,11 +335,10 @@ module RGeo
|
|
355
335
|
# this geometry, strictly speaking, the result of comparing objects
|
356
336
|
# from different factories is undefined.
|
357
337
|
|
358
|
-
def within?(
|
338
|
+
def within?(_another_geometry_)
|
359
339
|
raise Error::UnsupportedOperation, "Method Geometry#within? not defined."
|
360
340
|
end
|
361
341
|
|
362
|
-
|
363
342
|
# === SFS 1.1 Description
|
364
343
|
#
|
365
344
|
# Returns true if this geometric object "spatially contains"
|
@@ -375,11 +354,10 @@ module RGeo
|
|
375
354
|
# this geometry, strictly speaking, the result of comparing objects
|
376
355
|
# from different factories is undefined.
|
377
356
|
|
378
|
-
def contains?(
|
357
|
+
def contains?(_another_geometry_)
|
379
358
|
raise Error::UnsupportedOperation, "Method Geometry#contains? not defined."
|
380
359
|
end
|
381
360
|
|
382
|
-
|
383
361
|
# === SFS 1.1 Description
|
384
362
|
#
|
385
363
|
# Returns true if this geometric object "spatially overlaps"
|
@@ -395,11 +373,10 @@ module RGeo
|
|
395
373
|
# this geometry, strictly speaking, the result of comparing objects
|
396
374
|
# from different factories is undefined.
|
397
375
|
|
398
|
-
def overlaps?(
|
376
|
+
def overlaps?(_another_geometry_)
|
399
377
|
raise Error::UnsupportedOperation, "Method Geometry#overlaps? not defined."
|
400
378
|
end
|
401
379
|
|
402
|
-
|
403
380
|
# === SFS 1.1 Description
|
404
381
|
#
|
405
382
|
# Returns true if this geometric object is spatially related to
|
@@ -422,18 +399,16 @@ module RGeo
|
|
422
399
|
# this geometry, strictly speaking, the result of comparing objects
|
423
400
|
# from different factories is undefined.
|
424
401
|
|
425
|
-
def relate?(
|
402
|
+
def relate?(_another_geometry_, _intersection_pattern_matrix_)
|
426
403
|
raise Error::UnsupportedOperation, "Method Geometry#relate not defined."
|
427
404
|
end
|
428
405
|
|
429
|
-
|
430
406
|
# Deprecated alias of Geometry#relate?
|
431
407
|
|
432
408
|
def relate(another_geometry_, intersection_pattern_matrix_)
|
433
409
|
relate?(another_geometry_, intersection_pattern_matrix_)
|
434
410
|
end
|
435
411
|
|
436
|
-
|
437
412
|
# === SFS 1.1 Description
|
438
413
|
#
|
439
414
|
# Returns the shortest distance between any two Points in the two
|
@@ -449,11 +424,10 @@ module RGeo
|
|
449
424
|
# this geometry, strictly speaking, the result of measuring the
|
450
425
|
# distance between objects from different factories is undefined.
|
451
426
|
|
452
|
-
def distance(
|
427
|
+
def distance(_another_geometry_)
|
453
428
|
raise Error::UnsupportedOperation, "Method Geometry#distance not defined."
|
454
429
|
end
|
455
430
|
|
456
|
-
|
457
431
|
# === SFS 1.1 Description
|
458
432
|
#
|
459
433
|
# Returns a geometric object that represents all Points whose distance
|
@@ -465,11 +439,10 @@ module RGeo
|
|
465
439
|
#
|
466
440
|
# Returns an object that supports the Geometry interface.
|
467
441
|
|
468
|
-
def buffer(
|
442
|
+
def buffer(_distance_)
|
469
443
|
raise Error::UnsupportedOperation, "Method Geometry#buffer not defined."
|
470
444
|
end
|
471
445
|
|
472
|
-
|
473
446
|
# === SFS 1.1 Description
|
474
447
|
#
|
475
448
|
# Returns a geometric object that represents the convex hull of this
|
@@ -483,7 +456,6 @@ module RGeo
|
|
483
456
|
raise Error::UnsupportedOperation, "Method Geometry#convex_hull not defined."
|
484
457
|
end
|
485
458
|
|
486
|
-
|
487
459
|
# === SFS 1.1 Description
|
488
460
|
#
|
489
461
|
# Returns a geometric object that represents the Point set
|
@@ -498,11 +470,10 @@ module RGeo
|
|
498
470
|
# this geometry, strictly speaking, the result of performing
|
499
471
|
# operations on objects from different factories is undefined.
|
500
472
|
|
501
|
-
def intersection(
|
473
|
+
def intersection(_another_geometry_)
|
502
474
|
raise Error::UnsupportedOperation, "Method Geometry#intersection not defined."
|
503
475
|
end
|
504
476
|
|
505
|
-
|
506
477
|
# === SFS 1.1 Description
|
507
478
|
#
|
508
479
|
# Returns a geometric object that represents the Point set
|
@@ -517,11 +488,10 @@ module RGeo
|
|
517
488
|
# this geometry, strictly speaking, the result of performing
|
518
489
|
# operations on objects from different factories is undefined.
|
519
490
|
|
520
|
-
def union(
|
491
|
+
def union(_another_geometry_)
|
521
492
|
raise Error::UnsupportedOperation, "Method Geometry#union not defined."
|
522
493
|
end
|
523
494
|
|
524
|
-
|
525
495
|
# === SFS 1.1 Description
|
526
496
|
#
|
527
497
|
# Returns a geometric object that represents the Point set
|
@@ -536,11 +506,10 @@ module RGeo
|
|
536
506
|
# this geometry, strictly speaking, the result of performing
|
537
507
|
# operations on objects from different factories is undefined.
|
538
508
|
|
539
|
-
def difference(
|
509
|
+
def difference(_another_geometry_)
|
540
510
|
raise Error::UnsupportedOperation, "Method Geometry#difference not defined."
|
541
511
|
end
|
542
512
|
|
543
|
-
|
544
513
|
# === SFS 1.1 Description
|
545
514
|
#
|
546
515
|
# Returns a geometric object that represents the Point set symmetric
|
@@ -555,11 +524,10 @@ module RGeo
|
|
555
524
|
# this geometry, strictly speaking, the result of performing
|
556
525
|
# operations on objects from different factories is undefined.
|
557
526
|
|
558
|
-
def sym_difference(
|
527
|
+
def sym_difference(_another_geometry_)
|
559
528
|
raise Error::UnsupportedOperation, "Method Geometry#sym_difference not defined."
|
560
529
|
end
|
561
530
|
|
562
|
-
|
563
531
|
# Returns true if this geometric object is representationally
|
564
532
|
# equivalent to the given object.
|
565
533
|
#
|
@@ -568,11 +536,10 @@ module RGeo
|
|
568
536
|
# this geometry, strictly speaking, the result of comparing objects
|
569
537
|
# from different factories is undefined.
|
570
538
|
|
571
|
-
def rep_equals?(
|
539
|
+
def rep_equals?(_another_geometry_)
|
572
540
|
raise Error::UnsupportedOperation, "Method Geometry#rep_equals? not defined."
|
573
541
|
end
|
574
542
|
|
575
|
-
|
576
543
|
# This method should behave almost the same as the rep_equals?
|
577
544
|
# method, with two key differences.
|
578
545
|
#
|
@@ -589,7 +556,7 @@ module RGeo
|
|
589
556
|
# objective equivalence.
|
590
557
|
|
591
558
|
def eql?(rhs_)
|
592
|
-
if rhs_.
|
559
|
+
if rhs_.is_a?(::RGeo::Feature::Instance)
|
593
560
|
begin
|
594
561
|
rep_equals?(rhs_)
|
595
562
|
rescue Error::UnsupportedOperation
|
@@ -600,7 +567,6 @@ module RGeo
|
|
600
567
|
end
|
601
568
|
end
|
602
569
|
|
603
|
-
|
604
570
|
# This operator should behave almost the same as the equals? method,
|
605
571
|
# with two key differences.
|
606
572
|
#
|
@@ -616,7 +582,7 @@ module RGeo
|
|
616
582
|
# objective equivalence.
|
617
583
|
|
618
584
|
def ==(rhs_)
|
619
|
-
if rhs_.
|
585
|
+
if rhs_.is_a?(::RGeo::Feature::Instance)
|
620
586
|
begin
|
621
587
|
equals?(rhs_)
|
622
588
|
rescue Error::UnsupportedOperation
|
@@ -627,7 +593,6 @@ module RGeo
|
|
627
593
|
end
|
628
594
|
end
|
629
595
|
|
630
|
-
|
631
596
|
# If the given rhs is a geometry object, this operator must behave
|
632
597
|
# the same as the difference method. The behavior for other rhs
|
633
598
|
# types is not specified; an implementation may choose to provide
|
@@ -637,7 +602,6 @@ module RGeo
|
|
637
602
|
difference(rhs_)
|
638
603
|
end
|
639
604
|
|
640
|
-
|
641
605
|
# If the given rhs is a geometry object, this operator must behave
|
642
606
|
# the same as the union method. The behavior for other rhs types
|
643
607
|
# is not specified; an implementation may choose to provide
|
@@ -647,7 +611,6 @@ module RGeo
|
|
647
611
|
union(rhs_)
|
648
612
|
end
|
649
613
|
|
650
|
-
|
651
614
|
# If the given rhs is a geometry object, this operator must behave
|
652
615
|
# the same as the intersection method. The behavior for other rhs
|
653
616
|
# types is not specified; an implementation may choose to provide
|
@@ -656,11 +619,6 @@ module RGeo
|
|
656
619
|
def *(rhs_)
|
657
620
|
intersection(rhs_)
|
658
621
|
end
|
659
|
-
|
660
|
-
|
661
622
|
end
|
662
|
-
|
663
|
-
|
664
623
|
end
|
665
|
-
|
666
624
|
end
|
@@ -5,10 +5,7 @@
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
7
|
module RGeo
|
8
|
-
|
9
8
|
module Feature
|
10
|
-
|
11
|
-
|
12
9
|
# == SFS 1.1 Description
|
13
10
|
#
|
14
11
|
# A GeometryCollection is a geometric object that is a collection of 1
|
@@ -31,13 +28,11 @@ module RGeo
|
|
31
28
|
# class method (or === operator) defined in the Type module.
|
32
29
|
|
33
30
|
module GeometryCollection
|
34
|
-
|
35
31
|
include Geometry
|
36
32
|
extend Type
|
37
33
|
|
38
34
|
include ::Enumerable
|
39
35
|
|
40
|
-
|
41
36
|
# === SFS 1.1 Description
|
42
37
|
#
|
43
38
|
# Returns the number of geometries in this GeometryCollection.
|
@@ -50,7 +45,6 @@ module RGeo
|
|
50
45
|
raise Error::UnsupportedOperation, "Method GeometryCollection#num_geometries not defined."
|
51
46
|
end
|
52
47
|
|
53
|
-
|
54
48
|
# === SFS 1.1 Description
|
55
49
|
#
|
56
50
|
# Returns the Nth geometry in this GeometryCollection.
|
@@ -62,18 +56,16 @@ module RGeo
|
|
62
56
|
# Also note that this method is different from GeometryCollection#[]
|
63
57
|
# in that it does not support negative indexes.
|
64
58
|
|
65
|
-
def geometry_n(
|
59
|
+
def geometry_n(_n_)
|
66
60
|
raise Error::UnsupportedOperation, "Method GeometryCollection#geometry_n not defined."
|
67
61
|
end
|
68
62
|
|
69
|
-
|
70
63
|
# Alias of the num_geometries method.
|
71
64
|
|
72
65
|
def size
|
73
66
|
num_geometries
|
74
67
|
end
|
75
68
|
|
76
|
-
|
77
69
|
# Returns the Nth geometry in this GeometryCollection, or nil if the
|
78
70
|
# given N is out of range. N is zero-based.
|
79
71
|
#
|
@@ -84,11 +76,10 @@ module RGeo
|
|
84
76
|
# the same way Ruby's array indexing works. Hence, geometry_n(-1)
|
85
77
|
# returns nil, where [-1] returns the last element of the collection.
|
86
78
|
|
87
|
-
def [](
|
79
|
+
def [](_n_)
|
88
80
|
raise Error::UnsupportedOperation, "Method GeometryCollection#[] not defined."
|
89
81
|
end
|
90
82
|
|
91
|
-
|
92
83
|
# Iterates over the geometries of this GeometryCollection.
|
93
84
|
#
|
94
85
|
# This is not a standard SFS method, but is provided so that a
|
@@ -96,14 +87,9 @@ module RGeo
|
|
96
87
|
# Note that all GeometryCollection implementations must also
|
97
88
|
# include the Enumerable mixin.
|
98
89
|
|
99
|
-
def each(&
|
90
|
+
def each(&_block_)
|
100
91
|
raise Error::UnsupportedOperation, "Method GeometryCollection#each not defined."
|
101
92
|
end
|
102
|
-
|
103
|
-
|
104
93
|
end
|
105
|
-
|
106
|
-
|
107
94
|
end
|
108
|
-
|
109
95
|
end
|