rgeo 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 184e7c44e88f61f3bea18519a484ed2a9dfbd8acc3fc4dd7bd10cc07dc648322
4
- data.tar.gz: 5fd5f2a1cc75ad98680aad888eb43b637a2b9905e14968e09ed136513baf2f05
3
+ metadata.gz: f60f96ff950b9d39762392b471cd0be70fce1510daa17958da531f76d14c7f34
4
+ data.tar.gz: b30460450e679b6a46599a68171b6b8de69134913dfbc7d6c6f5a47c209207d0
5
5
  SHA512:
6
- metadata.gz: 960736c5e7bd96c0c9d6e19ff77ca4261f97ce58c8f8e9f6494a93d5cec03c912b39dd4b7149970aaf847d7007f1d1dfa1c5143169951b3a3ceeb6e27da76ba4
7
- data.tar.gz: 44505eac9f0fc602c862ce68697fc8ddbcbdbe21d8e63d7e44964dde277e2ffba3c7853221dd1baeb8fb9d634fb9a0e61572e0ecc4054ee3b328227dda891e42
6
+ metadata.gz: 638a465a19dbf4352b1ad4977a7193b228f62824ffaf93686f045383e8315bee5334ab978b5690f4d035fb1f091e6c905f9fbe941d50c2570c97c70215f94666
7
+ data.tar.gz: 5cbcb7893970f4b6819ca66112e09a3f3222bb7fdc529b6cf8af134cac4ee1018b66995b41a2227df45b2be7339c713ba7b59835eef833f686269eb97a1717b6
@@ -74,7 +74,7 @@ module RGeo
74
74
  @min_z == rhs_.min_z && @max_z == rhs_.max_z &&
75
75
  @min_m == rhs_.min_m && @max_m == rhs_.max_m
76
76
  end
77
- alias_method :==, :eql?
77
+ alias == eql?
78
78
 
79
79
  # Returns the bounding box's factory.
80
80
 
@@ -33,7 +33,7 @@ module RGeo
33
33
  def eql?(rhs_)
34
34
  rhs_.is_a?(Segment) && @s == rhs_.s && @e == rhs_.e
35
35
  end
36
- alias_method :==, :eql?
36
+ alias == eql?
37
37
 
38
38
  def degenerate?
39
39
  @lensq == 0
@@ -14,7 +14,7 @@ module RGeo
14
14
 
15
15
  # Create a new simple cartesian factory.
16
16
  #
17
- # See ::RGeo::Cartesian.simple_factory for a list of supported options.
17
+ # See RGeo::Cartesian.simple_factory for a list of supported options.
18
18
 
19
19
  def initialize(opts_ = {})
20
20
  @has_z = opts_[:has_z_coordinate] ? true : false
@@ -85,7 +85,7 @@ module RGeo
85
85
  @has_m == rhs_.property(:has_m_coordinate) &&
86
86
  @proj4.eql?(rhs_.proj4)
87
87
  end
88
- alias_method :==, :eql?
88
+ alias == eql?
89
89
 
90
90
  # Standard hash code
91
91
 
@@ -192,7 +192,7 @@ module RGeo
192
192
 
193
193
  attr_reader :srid
194
194
 
195
- # See ::RGeo::Feature::Factory#property
195
+ # See RGeo::Feature::Factory#property
196
196
 
197
197
  def property(name_)
198
198
  case name_
@@ -209,19 +209,19 @@ module RGeo
209
209
  end
210
210
  end
211
211
 
212
- # See ::RGeo::Feature::Factory#parse_wkt
212
+ # See RGeo::Feature::Factory#parse_wkt
213
213
 
214
214
  def parse_wkt(str_)
215
215
  @wkt_parser.parse(str_)
216
216
  end
217
217
 
218
- # See ::RGeo::Feature::Factory#parse_wkb
218
+ # See RGeo::Feature::Factory#parse_wkb
219
219
 
220
220
  def parse_wkb(str_)
221
221
  @wkb_parser.parse(str_)
222
222
  end
223
223
 
224
- # See ::RGeo::Feature::Factory#point
224
+ # See RGeo::Feature::Factory#point
225
225
 
226
226
  def point(x_, y_, *extra_)
227
227
  PointImpl.new(self, x_, y_, *extra_)
@@ -229,7 +229,7 @@ module RGeo
229
229
  nil
230
230
  end
231
231
 
232
- # See ::RGeo::Feature::Factory#line_string
232
+ # See RGeo::Feature::Factory#line_string
233
233
 
234
234
  def line_string(points_)
235
235
  LineStringImpl.new(self, points_)
@@ -237,7 +237,7 @@ module RGeo
237
237
  nil
238
238
  end
239
239
 
240
- # See ::RGeo::Feature::Factory#line
240
+ # See RGeo::Feature::Factory#line
241
241
 
242
242
  def line(start_, end_)
243
243
  LineImpl.new(self, start_, end_)
@@ -245,7 +245,7 @@ module RGeo
245
245
  nil
246
246
  end
247
247
 
248
- # See ::RGeo::Feature::Factory#linear_ring
248
+ # See RGeo::Feature::Factory#linear_ring
249
249
 
250
250
  def linear_ring(points_)
251
251
  LinearRingImpl.new(self, points_)
@@ -253,7 +253,7 @@ module RGeo
253
253
  nil
254
254
  end
255
255
 
256
- # See ::RGeo::Feature::Factory#polygon
256
+ # See RGeo::Feature::Factory#polygon
257
257
 
258
258
  def polygon(outer_ring_, inner_rings_ = nil)
259
259
  PolygonImpl.new(self, outer_ring_, inner_rings_)
@@ -261,7 +261,7 @@ module RGeo
261
261
  nil
262
262
  end
263
263
 
264
- # See ::RGeo::Feature::Factory#collection
264
+ # See RGeo::Feature::Factory#collection
265
265
 
266
266
  def collection(elems_)
267
267
  GeometryCollectionImpl.new(self, elems_)
@@ -269,7 +269,7 @@ module RGeo
269
269
  nil
270
270
  end
271
271
 
272
- # See ::RGeo::Feature::Factory#multi_point
272
+ # See RGeo::Feature::Factory#multi_point
273
273
 
274
274
  def multi_point(elems_)
275
275
  MultiPointImpl.new(self, elems_)
@@ -277,7 +277,7 @@ module RGeo
277
277
  nil
278
278
  end
279
279
 
280
- # See ::RGeo::Feature::Factory#multi_line_string
280
+ # See RGeo::Feature::Factory#multi_line_string
281
281
 
282
282
  def multi_line_string(elems_)
283
283
  MultiLineStringImpl.new(self, elems_)
@@ -285,7 +285,7 @@ module RGeo
285
285
  nil
286
286
  end
287
287
 
288
- # See ::RGeo::Feature::Factory#multi_polygon
288
+ # See RGeo::Feature::Factory#multi_polygon
289
289
 
290
290
  def multi_polygon(elems_)
291
291
  MultiPolygonImpl.new(self, elems_)
@@ -293,11 +293,11 @@ module RGeo
293
293
  nil
294
294
  end
295
295
 
296
- # See ::RGeo::Feature::Factory#proj4
296
+ # See RGeo::Feature::Factory#proj4
297
297
 
298
298
  attr_reader :proj4
299
299
 
300
- # See ::RGeo::Feature::Factory#coord_sys
300
+ # See RGeo::Feature::Factory#coord_sys
301
301
 
302
302
  attr_reader :coord_sys
303
303
 
@@ -311,7 +311,7 @@ module RGeo
311
311
 
312
312
  def _marshal_wkb_generator # :nodoc:
313
313
  unless defined?(@marshal_wkb_generator)
314
- @marshal_wkb_generator = ::RGeo::WKRep::WKBGenerator.new(
314
+ @marshal_wkb_generator = RGeo::WKRep::WKBGenerator.new(
315
315
  type_format: :wkb12)
316
316
  end
317
317
  @marshal_wkb_generator
@@ -319,7 +319,7 @@ module RGeo
319
319
 
320
320
  def _marshal_wkb_parser # :nodoc:
321
321
  unless defined?(@marshal_wkb_parser)
322
- @marshal_wkb_parser = ::RGeo::WKRep::WKBParser.new(self,
322
+ @marshal_wkb_parser = RGeo::WKRep::WKBParser.new(self,
323
323
  support_wkb12: true)
324
324
  end
325
325
  @marshal_wkb_parser
@@ -327,7 +327,7 @@ module RGeo
327
327
 
328
328
  def _psych_wkt_generator # :nodoc:
329
329
  unless defined?(@psych_wkt_generator)
330
- @psych_wkt_generator = ::RGeo::WKRep::WKTGenerator.new(
330
+ @psych_wkt_generator = RGeo::WKRep::WKTGenerator.new(
331
331
  tag_format: :wkt12)
332
332
  end
333
333
  @psych_wkt_generator
@@ -335,7 +335,7 @@ module RGeo
335
335
 
336
336
  def _psych_wkt_parser # :nodoc:
337
337
  unless defined?(@psych_wkt_parser)
338
- @psych_wkt_parser = ::RGeo::WKRep::WKTParser.new(self,
338
+ @psych_wkt_parser = RGeo::WKRep::WKTParser.new(self,
339
339
  support_wkt12: true, support_ewkt: true)
340
340
  end
341
341
  @psych_wkt_parser
@@ -7,92 +7,92 @@
7
7
  module RGeo
8
8
  module Cartesian
9
9
  class PointImpl # :nodoc:
10
- include ::RGeo::Feature::Point
11
- include ::RGeo::ImplHelper::BasicGeometryMethods
12
- include ::RGeo::ImplHelper::BasicPointMethods
13
- include ::RGeo::Cartesian::GeometryMethods
14
- include ::RGeo::Cartesian::PointMethods
10
+ include RGeo::Feature::Point
11
+ include RGeo::ImplHelper::BasicGeometryMethods
12
+ include RGeo::ImplHelper::BasicPointMethods
13
+ include RGeo::Cartesian::GeometryMethods
14
+ include RGeo::Cartesian::PointMethods
15
15
 
16
16
  Feature::MixinCollection::GLOBAL.for_type(Feature::Point).include_in_class(self, true)
17
17
  end
18
18
 
19
19
  class LineStringImpl # :nodoc:
20
- include ::RGeo::Feature::LineString
21
- include ::RGeo::ImplHelper::BasicGeometryMethods
22
- include ::RGeo::ImplHelper::BasicLineStringMethods
23
- include ::RGeo::Cartesian::GeometryMethods
24
- include ::RGeo::Cartesian::LineStringMethods
20
+ include RGeo::Feature::LineString
21
+ include RGeo::ImplHelper::BasicGeometryMethods
22
+ include RGeo::ImplHelper::BasicLineStringMethods
23
+ include RGeo::Cartesian::GeometryMethods
24
+ include RGeo::Cartesian::LineStringMethods
25
25
 
26
26
  Feature::MixinCollection::GLOBAL.for_type(Feature::LineString).include_in_class(self, true)
27
27
  end
28
28
 
29
29
  class LineImpl # :nodoc:
30
- include ::RGeo::Feature::Line
31
- include ::RGeo::ImplHelper::BasicGeometryMethods
32
- include ::RGeo::ImplHelper::BasicLineStringMethods
33
- include ::RGeo::ImplHelper::BasicLineMethods
34
- include ::RGeo::Cartesian::GeometryMethods
35
- include ::RGeo::Cartesian::LineStringMethods
30
+ include RGeo::Feature::Line
31
+ include RGeo::ImplHelper::BasicGeometryMethods
32
+ include RGeo::ImplHelper::BasicLineStringMethods
33
+ include RGeo::ImplHelper::BasicLineMethods
34
+ include RGeo::Cartesian::GeometryMethods
35
+ include RGeo::Cartesian::LineStringMethods
36
36
 
37
37
  Feature::MixinCollection::GLOBAL.for_type(Feature::Line).include_in_class(self, true)
38
38
  end
39
39
 
40
40
  class LinearRingImpl # :nodoc:
41
- include ::RGeo::Feature::LinearRing
42
- include ::RGeo::ImplHelper::BasicGeometryMethods
43
- include ::RGeo::ImplHelper::BasicLineStringMethods
44
- include ::RGeo::ImplHelper::BasicLinearRingMethods
45
- include ::RGeo::Cartesian::GeometryMethods
46
- include ::RGeo::Cartesian::LineStringMethods
41
+ include RGeo::Feature::LinearRing
42
+ include RGeo::ImplHelper::BasicGeometryMethods
43
+ include RGeo::ImplHelper::BasicLineStringMethods
44
+ include RGeo::ImplHelper::BasicLinearRingMethods
45
+ include RGeo::Cartesian::GeometryMethods
46
+ include RGeo::Cartesian::LineStringMethods
47
47
 
48
48
  Feature::MixinCollection::GLOBAL.for_type(Feature::LinearRing).include_in_class(self, true)
49
49
  end
50
50
 
51
51
  class PolygonImpl # :nodoc:
52
- include ::RGeo::Feature::Polygon
53
- include ::RGeo::ImplHelper::BasicGeometryMethods
54
- include ::RGeo::ImplHelper::BasicPolygonMethods
55
- include ::RGeo::Cartesian::GeometryMethods
52
+ include RGeo::Feature::Polygon
53
+ include RGeo::ImplHelper::BasicGeometryMethods
54
+ include RGeo::ImplHelper::BasicPolygonMethods
55
+ include RGeo::Cartesian::GeometryMethods
56
56
 
57
57
  Feature::MixinCollection::GLOBAL.for_type(Feature::Polygon).include_in_class(self, true)
58
58
  end
59
59
 
60
60
  class GeometryCollectionImpl # :nodoc:
61
- include ::RGeo::Feature::GeometryCollection
62
- include ::RGeo::ImplHelper::BasicGeometryMethods
63
- include ::RGeo::ImplHelper::BasicGeometryCollectionMethods
64
- include ::RGeo::Cartesian::GeometryMethods
61
+ include RGeo::Feature::GeometryCollection
62
+ include RGeo::ImplHelper::BasicGeometryMethods
63
+ include RGeo::ImplHelper::BasicGeometryCollectionMethods
64
+ include RGeo::Cartesian::GeometryMethods
65
65
 
66
66
  Feature::MixinCollection::GLOBAL.for_type(Feature::GeometryCollection).include_in_class(self, true)
67
67
  end
68
68
 
69
69
  class MultiPointImpl # :nodoc:
70
- include ::RGeo::Feature::MultiPoint
71
- include ::RGeo::ImplHelper::BasicGeometryMethods
72
- include ::RGeo::ImplHelper::BasicGeometryCollectionMethods
73
- include ::RGeo::ImplHelper::BasicMultiPointMethods
74
- include ::RGeo::Cartesian::GeometryMethods
70
+ include RGeo::Feature::MultiPoint
71
+ include RGeo::ImplHelper::BasicGeometryMethods
72
+ include RGeo::ImplHelper::BasicGeometryCollectionMethods
73
+ include RGeo::ImplHelper::BasicMultiPointMethods
74
+ include RGeo::Cartesian::GeometryMethods
75
75
 
76
76
  Feature::MixinCollection::GLOBAL.for_type(Feature::MultiPoint).include_in_class(self, true)
77
77
  end
78
78
 
79
79
  class MultiLineStringImpl # :nodoc:
80
- include ::RGeo::Feature::MultiLineString
81
- include ::RGeo::ImplHelper::BasicGeometryMethods
82
- include ::RGeo::ImplHelper::BasicGeometryCollectionMethods
83
- include ::RGeo::ImplHelper::BasicMultiLineStringMethods
84
- include ::RGeo::Cartesian::GeometryMethods
85
- include ::RGeo::Cartesian::MultiLineStringMethods
80
+ include RGeo::Feature::MultiLineString
81
+ include RGeo::ImplHelper::BasicGeometryMethods
82
+ include RGeo::ImplHelper::BasicGeometryCollectionMethods
83
+ include RGeo::ImplHelper::BasicMultiLineStringMethods
84
+ include RGeo::Cartesian::GeometryMethods
85
+ include RGeo::Cartesian::MultiLineStringMethods
86
86
 
87
87
  Feature::MixinCollection::GLOBAL.for_type(Feature::MultiLineString).include_in_class(self, true)
88
88
  end
89
89
 
90
90
  class MultiPolygonImpl # :nodoc:
91
- include ::RGeo::Feature::MultiPolygon
92
- include ::RGeo::ImplHelper::BasicGeometryMethods
93
- include ::RGeo::ImplHelper::BasicGeometryCollectionMethods
94
- include ::RGeo::ImplHelper::BasicMultiPolygonMethods
95
- include ::RGeo::Cartesian::GeometryMethods
91
+ include RGeo::Feature::MultiPolygon
92
+ include RGeo::ImplHelper::BasicGeometryMethods
93
+ include RGeo::ImplHelper::BasicGeometryCollectionMethods
94
+ include RGeo::ImplHelper::BasicMultiPolygonMethods
95
+ include RGeo::Cartesian::GeometryMethods
96
96
 
97
97
  Feature::MixinCollection::GLOBAL.for_type(Feature::MultiPolygon).include_in_class(self, true)
98
98
  end
@@ -18,7 +18,7 @@ module RGeo
18
18
 
19
19
  module PointMethods # :nodoc:
20
20
  def distance(rhs_)
21
- rhs_ = ::RGeo::Feature.cast(rhs_, @factory)
21
+ rhs_ = RGeo::Feature.cast(rhs_, @factory)
22
22
  case rhs_
23
23
  when PointImpl
24
24
  dx_ = @x - rhs_.x
@@ -25,13 +25,13 @@ module RGeo
25
25
  # are ignored.
26
26
 
27
27
  def preferred_factory(opts_ = {})
28
- if ::RGeo::Geos.supported?
29
- ::RGeo::Geos.factory(opts_)
28
+ if RGeo::Geos.supported?
29
+ RGeo::Geos.factory(opts_)
30
30
  else
31
31
  simple_factory(opts_)
32
32
  end
33
33
  end
34
- alias_method :factory, :preferred_factory
34
+ alias factory preferred_factory
35
35
 
36
36
  # Returns a factory for the simple Cartesian implementation. This
37
37
  # implementation provides all SFS 1.1 types, and also allows Z and
@@ -117,7 +117,7 @@ module RGeo
117
117
  def preferred_factory_generator(defaults_ = {})
118
118
  ::Proc.new { |c_| preferred_factory(defaults_.merge(c_)) }
119
119
  end
120
- alias_method :factory_generator, :preferred_factory_generator
120
+ alias factory_generator preferred_factory_generator
121
121
 
122
122
  # Returns a Feature::FactoryGenerator that creates simple factories.
123
123
  # The given options are used as the default options.
@@ -29,7 +29,7 @@ module RGeo
29
29
  # The only valid key is :proj4
30
30
  def self.supported?(key)
31
31
  raise(Error::UnsupportedOperation, "Invalid key. The only valid key is :proj4.") unless key == :proj4
32
- defined?(Proj4) && Proj4.supported?
32
+ defined?(RGeo::CoordSys::Proj4) && RGeo::CoordSys::Proj4.supported?
33
33
  end
34
34
 
35
35
  def self.check!(key)
@@ -151,7 +151,7 @@ module RGeo
151
151
  def eql?(rhs_)
152
152
  rhs_.class == self.class && rhs_.to_wkt == to_wkt
153
153
  end
154
- alias_method :==, :eql?
154
+ alias == eql?
155
155
 
156
156
  # Standard hash code
157
157
 
@@ -22,7 +22,7 @@ module RGeo
22
22
  # implementation. Thus, to get a corresponding factory generator,
23
23
  # you can use the <tt>method</tt> method. e.g.
24
24
  #
25
- # factory_generator = ::RGeo::Cartesian.method(:preferred_factory)
25
+ # factory_generator = RGeo::Cartesian.method(:preferred_factory)
26
26
  #
27
27
  # FactoryGenerator is defined as a module and is provided
28
28
  # primarily for the sake of documentation. Implementations need not
@@ -567,7 +567,7 @@ module RGeo
567
567
  # objective equivalence.
568
568
 
569
569
  def eql?(rhs_)
570
- if rhs_.is_a?(::RGeo::Feature::Instance)
570
+ if rhs_.is_a?(RGeo::Feature::Instance)
571
571
  begin
572
572
  rep_equals?(rhs_)
573
573
  rescue Error::UnsupportedOperation
@@ -593,7 +593,7 @@ module RGeo
593
593
  # objective equivalence.
594
594
 
595
595
  def ==(rhs_)
596
- if rhs_.is_a?(::RGeo::Feature::Instance)
596
+ if rhs_.is_a?(RGeo::Feature::Instance)
597
597
  begin
598
598
  equals?(rhs_)
599
599
  rescue Error::UnsupportedOperation
@@ -99,7 +99,7 @@ module RGeo
99
99
  # Returns a TypeData for the given type.
100
100
  #
101
101
  # e.g. to add a module for point types, you can call:
102
- # for_type(::RGeo::Feature::Point).add(module)
102
+ # for_type(RGeo::Feature::Point).add(module)
103
103
 
104
104
  def for_type(type_)
105
105
  (@types[type_] ||= TypeData.new(self, type_))
@@ -14,39 +14,39 @@ module RGeo
14
14
  end
15
15
 
16
16
  # This module provides the API for geometry type objects. Technically
17
- # these objects are modules (such as ::RGeo::Feature::Point), but as
17
+ # these objects are modules (such as RGeo::Feature::Point), but as
18
18
  # objects they respond to the methods documented here.
19
19
  #
20
20
  # For example, you may determine whether a feature object is a
21
21
  # point by calling:
22
22
  #
23
- # ::RGeo::Feature::Point.check_type(object)
23
+ # RGeo::Feature::Point.check_type(object)
24
24
  #
25
25
  # A corresponding === operator is provided so you can use the type
26
26
  # modules in a case-when clause:
27
27
  #
28
28
  # case object
29
- # when ::RGeo::Feature::Point
29
+ # when RGeo::Feature::Point
30
30
  # # do stuff here...
31
31
  #
32
32
  # However, a feature object may not actually include the point module
33
33
  # itself; hence, the following will *not* work:
34
34
  #
35
- # object.is_a?(::RGeo::Feature::Point) # DON'T DO THIS-- DOES NOT WORK
35
+ # object.is_a?(RGeo::Feature::Point) # DON'T DO THIS-- DOES NOT WORK
36
36
  #
37
37
  # You may obtain the type of a feature object by calling its
38
38
  # geometry_type method. You may then use the methods in this module to
39
39
  # interrogate that type.
40
40
  #
41
41
  # # supppose object is a Point
42
- # type = object.geometry_type # ::RGeo::Feature::Point
42
+ # type = object.geometry_type # RGeo::Feature::Point
43
43
  # type.type_name # "Point"
44
- # type.supertype # ::RGeo::Feature::Geometry
44
+ # type.supertype # RGeo::Feature::Geometry
45
45
  #
46
46
  # You may also use the presence of this module to determine whether
47
47
  # a particular object is a feature type:
48
48
  #
49
- # ::RGeo::Feature::Type === object.geometry_type # true
49
+ # RGeo::Feature::Type === object.geometry_type # true
50
50
 
51
51
  module Type
52
52
  # Returns true if the given object is this type or a subtype
@@ -60,7 +60,7 @@ module RGeo
60
60
  rhs_ = rhs_.geometry_type if rhs_.is_a?(Feature::Instance)
61
61
  rhs_.is_a?(Type) && (rhs_ == self || rhs_.include?(self))
62
62
  end
63
- alias_method :===, :check_type
63
+ alias === check_type
64
64
 
65
65
  # Returns true if this type is the same type or a subtype of the
66
66
  # given type.
@@ -84,12 +84,12 @@ module RGeo
84
84
 
85
85
  # Returns the OpenGIS type name of this type. For example:
86
86
  #
87
- # ::RGeo::Feature::Point.type_name # "Point"
87
+ # RGeo::Feature::Point.type_name # "Point"
88
88
 
89
89
  def type_name
90
90
  name.sub("RGeo::Feature::", "")
91
91
  end
92
- alias_method :to_s, :type_name
92
+ alias to_s type_name
93
93
 
94
94
  def _add_subtype(type_) # :nodoc:
95
95
  (@subtypes ||= []) << type_
@@ -153,7 +153,7 @@ module RGeo
153
153
  # RGeo provides a default casting algorithm. Individual feature
154
154
  # implementation factories may override this and customize the
155
155
  # casting behavior by defining the override_cast method. See
156
- # ::RGeo::Feature::Factory#override_cast for more details.
156
+ # RGeo::Feature::Factory#override_cast for more details.
157
157
 
158
158
  def cast(obj_, *params_)
159
159
  # Interpret params