rgeo 3.0.0.pre.rc.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -1
  3. data/ext/geos_c_impl/analysis.c +26 -23
  4. data/ext/geos_c_impl/analysis.h +8 -5
  5. data/ext/geos_c_impl/coordinates.c +27 -21
  6. data/ext/geos_c_impl/coordinates.h +5 -2
  7. data/ext/geos_c_impl/errors.c +15 -8
  8. data/ext/geos_c_impl/errors.h +4 -1
  9. data/ext/geos_c_impl/extconf.rb +40 -30
  10. data/ext/geos_c_impl/factory.c +405 -389
  11. data/ext/geos_c_impl/factory.h +71 -49
  12. data/ext/geos_c_impl/geometry.c +485 -408
  13. data/ext/geos_c_impl/geometry.h +5 -5
  14. data/ext/geos_c_impl/geometry_collection.c +269 -198
  15. data/ext/geos_c_impl/geometry_collection.h +6 -7
  16. data/ext/geos_c_impl/globals.c +99 -21
  17. data/ext/geos_c_impl/globals.h +3 -2
  18. data/ext/geos_c_impl/line_string.c +261 -220
  19. data/ext/geos_c_impl/line_string.h +5 -6
  20. data/ext/geos_c_impl/main.c +8 -9
  21. data/ext/geos_c_impl/point.c +62 -65
  22. data/ext/geos_c_impl/point.h +4 -5
  23. data/ext/geos_c_impl/polygon.c +121 -90
  24. data/ext/geos_c_impl/polygon.h +11 -9
  25. data/ext/geos_c_impl/preface.h +4 -13
  26. data/ext/geos_c_impl/ruby_more.c +39 -37
  27. data/ext/geos_c_impl/ruby_more.h +11 -2
  28. data/lib/rgeo/cartesian/analysis.rb +5 -3
  29. data/lib/rgeo/cartesian/bounding_box.rb +74 -79
  30. data/lib/rgeo/cartesian/calculations.rb +20 -26
  31. data/lib/rgeo/cartesian/factory.rb +52 -89
  32. data/lib/rgeo/cartesian/feature_methods.rb +0 -5
  33. data/lib/rgeo/cartesian/interface.rb +6 -5
  34. data/lib/rgeo/cartesian/planar_graph.rb +10 -16
  35. data/lib/rgeo/cartesian/sweepline_intersector.rb +1 -3
  36. data/lib/rgeo/cartesian/valid_op.rb +1 -3
  37. data/lib/rgeo/coord_sys/cs/entities.rb +299 -99
  38. data/lib/rgeo/coord_sys/cs/factories.rb +0 -2
  39. data/lib/rgeo/coord_sys/cs/wkt_parser.rb +85 -37
  40. data/lib/rgeo/coord_sys.rb +1 -9
  41. data/lib/rgeo/feature/curve.rb +0 -11
  42. data/lib/rgeo/feature/factory.rb +26 -36
  43. data/lib/rgeo/feature/factory_generator.rb +6 -11
  44. data/lib/rgeo/feature/geometry.rb +41 -40
  45. data/lib/rgeo/feature/geometry_collection.rb +3 -4
  46. data/lib/rgeo/feature/line_string.rb +1 -2
  47. data/lib/rgeo/feature/linear_ring.rb +0 -1
  48. data/lib/rgeo/feature/multi_curve.rb +0 -6
  49. data/lib/rgeo/feature/multi_surface.rb +0 -1
  50. data/lib/rgeo/feature/point.rb +0 -1
  51. data/lib/rgeo/feature/polygon.rb +1 -2
  52. data/lib/rgeo/feature/surface.rb +0 -1
  53. data/lib/rgeo/feature/types.rb +73 -83
  54. data/lib/rgeo/geographic/factory.rb +93 -119
  55. data/lib/rgeo/geographic/interface.rb +62 -116
  56. data/lib/rgeo/geographic/projected_feature_methods.rb +2 -16
  57. data/lib/rgeo/geographic/projected_window.rb +36 -22
  58. data/lib/rgeo/geographic/{proj4_projector.rb → projector.rb} +3 -3
  59. data/lib/rgeo/geographic/simple_mercator_projector.rb +24 -21
  60. data/lib/rgeo/geographic/spherical_feature_methods.rb +8 -8
  61. data/lib/rgeo/geographic/spherical_math.rb +17 -20
  62. data/lib/rgeo/geographic.rb +1 -1
  63. data/lib/rgeo/geos/capi_factory.rb +70 -124
  64. data/lib/rgeo/geos/capi_feature_classes.rb +0 -29
  65. data/lib/rgeo/geos/ffi_factory.rb +90 -131
  66. data/lib/rgeo/geos/ffi_feature_methods.rb +73 -128
  67. data/lib/rgeo/geos/interface.rb +21 -36
  68. data/lib/rgeo/geos/utils.rb +3 -3
  69. data/lib/rgeo/geos/zm_factory.rb +53 -76
  70. data/lib/rgeo/geos/zm_feature_methods.rb +16 -34
  71. data/lib/rgeo/geos.rb +2 -5
  72. data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +5 -18
  73. data/lib/rgeo/impl_helper/basic_geometry_methods.rb +1 -2
  74. data/lib/rgeo/impl_helper/basic_line_string_methods.rb +18 -42
  75. data/lib/rgeo/impl_helper/basic_point_methods.rb +1 -13
  76. data/lib/rgeo/impl_helper/basic_polygon_methods.rb +16 -25
  77. data/lib/rgeo/impl_helper/utils.rb +21 -0
  78. data/lib/rgeo/impl_helper/valid_op.rb +12 -16
  79. data/lib/rgeo/impl_helper/validity_check.rb +3 -3
  80. data/lib/rgeo/version.rb +1 -1
  81. data/lib/rgeo/wkrep/wkb_generator.rb +73 -63
  82. data/lib/rgeo/wkrep/wkb_parser.rb +33 -31
  83. data/lib/rgeo/wkrep/wkt_generator.rb +52 -45
  84. data/lib/rgeo/wkrep/wkt_parser.rb +48 -35
  85. data/lib/rgeo.rb +1 -3
  86. metadata +10 -9
@@ -42,20 +42,10 @@ module RGeo
42
42
  projection.empty?
43
43
  end
44
44
 
45
- def is_empty?
46
- warn "The is_empty? method is deprecated, please use the empty? counterpart, will be removed in v3" unless ENV["RGEO_SILENCE_DEPRECATION"]
47
- empty?
48
- end
49
-
50
45
  def simple?
51
46
  projection.simple?
52
47
  end
53
48
 
54
- def is_simple?
55
- warn "The is_simple? method is deprecated, please use the simple? counterpart, will be removed in v3" unless ENV["RGEO_SILENCE_DEPRECATION"]
56
- simple?
57
- end
58
-
59
49
  def valid?
60
50
  projection.valid?
61
51
  end
@@ -229,9 +219,7 @@ module RGeo
229
219
  # Ensure projection is available.
230
220
  def init_geometry
231
221
  super
232
- unless projection
233
- raise Error::InvalidGeometry, "Polygon failed assertions"
234
- end
222
+ raise Error::InvalidGeometry, "Polygon failed assertions" unless projection
235
223
  end
236
224
  end
237
225
 
@@ -241,9 +229,7 @@ module RGeo
241
229
  # Ensure projection is available.
242
230
  def init_geometry
243
231
  super
244
- unless projection
245
- raise Error::InvalidGeometry, "MultiPolygon failed assertions"
246
- end
232
+ raise Error::InvalidGeometry, "MultiPolygon failed assertions" unless projection
247
233
  end
248
234
  end
249
235
  end
@@ -13,7 +13,6 @@ module RGeo
13
13
  # map visualization, an envelope in a projected coordinate system, or
14
14
  # a spatial constraint. It must be attached to a Geographic::Factory
15
15
  # that has a projection.
16
-
17
16
  class ProjectedWindow
18
17
  # Create a new ProjectedWindow given the Geographic::Factory, and the
19
18
  # x and y extents of the rectangle.
@@ -64,38 +63,33 @@ module RGeo
64
63
  to_s
65
64
  end
66
65
 
67
- def eql?(obj_) # :nodoc:
68
- return false unless obj_.is_a?(ProjectedWindow)
69
- @factory == obj_.factory && @x_min == obj_.x_min && @x_max == obj_.x_max &&
70
- @y_min = obj_.y_min && @y_max = obj_.y_max
66
+ def eql?(other) # :nodoc:
67
+ return false unless other.is_a?(ProjectedWindow)
68
+ @factory == other.factory && @x_min == other.x_min && @x_max == other.x_max &&
69
+ @y_min = other.y_min && @y_max = other.y_max
71
70
  end
72
71
  alias == eql?
73
72
 
74
73
  def hash # :nodoc:
75
- @factory.hash + @x_min.hash + @x_max.hash + @y_min.hash + @y_max.hash
74
+ [@factory, @x_min, @x_max, @y_min, @y_max].hash
76
75
  end
77
76
 
78
77
  # Returns the Geographic::Factory associated with this window.
79
78
  # Note that this factory is the overall geography factory, not the
80
79
  # projected factory (which can be obtained by calling
81
80
  # Geographic::Factory#projection_factory on this factory).
82
-
83
81
  attr_reader :factory
84
82
 
85
83
  # Returns the lower limit in the x (easting) direction.
86
-
87
84
  attr_reader :x_min
88
85
 
89
86
  # Returns the upper limit in the x (easting) direction.
90
-
91
87
  attr_reader :x_max
92
88
 
93
89
  # Returns the lower limit in the y (northing) direction.
94
-
95
90
  attr_reader :y_min
96
91
 
97
92
  # Returns the upper limit in the y (northing) direction.
98
-
99
93
  attr_reader :y_max
100
94
 
101
95
  # Returns true if the projection wraps along the x axis, and this
@@ -146,35 +140,45 @@ module RGeo
146
140
  # (lat/lng) space, as a Feature::Point object.
147
141
 
148
142
  def sw_point
149
- @sw ||= @factory.unproject(@factory.projection_factory.point(@x_min, @y_min))
143
+ return @sw_point if defined?(@sw_point)
144
+
145
+ @sw_point = @factory.unproject(@factory.projection_factory.point(@x_min, @y_min))
150
146
  end
151
147
 
152
148
  # Returns the southeast corner of the rectangle in _unprojected_
153
149
  # (lat/lng) space, as a Feature::Point object.
154
150
 
155
151
  def se_point
156
- @se ||= @factory.unproject(@factory.projection_factory.point(@x_max, @y_min))
152
+ return @se_point if defined?(@se_point)
153
+
154
+ @se_point = @factory.unproject(@factory.projection_factory.point(@x_max, @y_min))
157
155
  end
158
156
 
159
157
  # Returns the northwest corner of the rectangle in _unprojected_
160
158
  # (lat/lng) space, as a Feature::Point object.
161
159
 
162
160
  def nw_point
163
- @nw ||= @factory.unproject(@factory.projection_factory.point(@x_min, @y_max))
161
+ return @nw_point if defined?(@nw_point)
162
+
163
+ @nw_point = @factory.unproject(@factory.projection_factory.point(@x_min, @y_max))
164
164
  end
165
165
 
166
166
  # Returns the northeast corner of the rectangle in _unprojected_
167
167
  # (lat/lng) space, as a Feature::Point object.
168
168
 
169
169
  def ne_point
170
- @ne ||= @factory.unproject(@factory.projection_factory.point(@x_max, @y_max))
170
+ return @ne_point if defined?(@ne_point)
171
+
172
+ @ne_point = @factory.unproject(@factory.projection_factory.point(@x_max, @y_max))
171
173
  end
172
174
 
173
175
  # Returns the center of the rectangle in _unprojected_
174
176
  # (lat/lng) space, as a Feature::Point object.
175
177
 
176
178
  def center_point
177
- @center ||= @factory.unproject(@factory.projection_factory.point(*center_xy))
179
+ return @center_point if defined?(@center_point)
180
+
181
+ @center_point = @factory.unproject(@factory.projection_factory.point(*center_xy))
178
182
  end
179
183
 
180
184
  # Returns a random point inside the rectangle in _unprojected_
@@ -233,7 +237,7 @@ module RGeo
233
237
 
234
238
  def scaled_by(x_factor_, y_factor_ = nil)
235
239
  y_factor_ ||= x_factor_
236
- if x_factor_ != 1.0 || y_factor_ != 1.0
240
+ if x_factor_ != 1 || y_factor_ != 1
237
241
  x_, y_ = *center_xy
238
242
  xr_ = x_span * 0.5 * x_factor_
239
243
  yr_ = y_span * 0.5 * y_factor_
@@ -287,9 +291,14 @@ module RGeo
287
291
 
288
292
  def with_margin(x_margin_, y_margin_ = nil)
289
293
  y_margin_ ||= x_margin_
290
- if x_margin_ != 0.0 || y_margin_ != 0.0
291
- ProjectedWindow.new(@factory, @x_min - x_margin_, @y_min - y_margin_,
292
- @x_max + x_margin_, @y_max + y_margin_)
294
+ if x_margin_ != 0 || y_margin_ != 0
295
+ ProjectedWindow.new(
296
+ @factory,
297
+ @x_min - x_margin_,
298
+ @y_min - y_margin_,
299
+ @x_max + x_margin_,
300
+ @y_max + y_margin_
301
+ )
293
302
  else
294
303
  self
295
304
  end
@@ -318,8 +327,13 @@ module RGeo
318
327
  y_margin_ ||= x_margin_
319
328
  factory_ = point_.factory
320
329
  projection_ = factory_.project(point_)
321
- ProjectedWindow.new(factory_, projection_.x - x_margin_, projection_.y - y_margin_,
322
- projection_.x + x_margin_, projection_.y + y_margin_)
330
+ ProjectedWindow.new(
331
+ factory_,
332
+ projection_.x - x_margin_,
333
+ projection_.y - y_margin_,
334
+ projection_.x + x_margin_,
335
+ projection_.y + y_margin_
336
+ )
323
337
  end
324
338
 
325
339
  # Creates a new window that contains all of the given points.
@@ -8,7 +8,7 @@
8
8
 
9
9
  module RGeo
10
10
  module Geographic
11
- class Proj4Projector # :nodoc:
11
+ class Projector # :nodoc:
12
12
  def initialize(geography_factory, projection_factory)
13
13
  @geography_factory = geography_factory
14
14
  @projection_factory = projection_factory
@@ -42,11 +42,11 @@ module RGeo
42
42
  new(geography_factory, projection_factory)
43
43
  end
44
44
 
45
- def create_from_proj4(geography_factory, proj4, opts = {})
45
+ def create_from_opts(geography_factory, opts = {})
46
46
  projection_factory =
47
47
  Cartesian.preferred_factory(
48
- proj4: proj4,
49
48
  coord_sys: opts[:coord_sys], srid: opts[:srid],
49
+ coord_sys_class: opts[:coord_sys_class],
50
50
  buffer_resolution: opts[:buffer_resolution],
51
51
  has_z_coordinate: opts[:has_z_coordinate],
52
52
  has_m_coordinate: opts[:has_m_coordinate],
@@ -14,7 +14,6 @@ module RGeo
14
14
  def initialize(geography_factory, opts = {})
15
15
  @geography_factory = geography_factory
16
16
  @projection_factory = Cartesian.preferred_factory(srid: 3857,
17
- proj4: SimpleMercatorProjector._proj4_3857,
18
17
  coord_sys: SimpleMercatorProjector._coordsys_3857,
19
18
  buffer_resolution: opts[:buffer_resolution],
20
19
  has_z_coordinate: opts[:has_z_coordinate],
@@ -33,8 +32,10 @@ module RGeo
33
32
  when Feature::Point
34
33
  rpd_ = ImplHelper::Math::RADIANS_PER_DEGREE
35
34
  radius = EQUATORIAL_RADIUS
36
- @projection_factory.point(geometry.x * rpd_ * radius,
37
- Math.log(Math.tan(Math::PI / 4.0 + geometry.y * rpd_ / 2.0)) * radius)
35
+ @projection_factory.point(
36
+ geometry.x * rpd_ * radius,
37
+ Math.log(Math.tan(Math::PI / 4.0 + geometry.y * rpd_ / 2.0)) * radius
38
+ )
38
39
  when Feature::Line
39
40
  @projection_factory.line(project(geometry.start_point), project(geometry.end_point))
40
41
  when Feature::LinearRing
@@ -60,8 +61,10 @@ module RGeo
60
61
  when Feature::Point
61
62
  dpr = ImplHelper::Math::DEGREES_PER_RADIAN
62
63
  radius = EQUATORIAL_RADIUS
63
- @geography_factory.point(geometry.x / radius * dpr,
64
- (2.0 * Math.atan(Math.exp(geometry.y / radius)) - Math::PI / 2.0) * dpr)
64
+ @geography_factory.point(
65
+ geometry.x / radius * dpr,
66
+ (2.0 * Math.atan(Math.exp(geometry.y / radius)) - Math::PI / 2.0) * dpr
67
+ )
65
68
  when Feature::Line
66
69
  @geography_factory.line(unproject(geometry.start_point), unproject(geometry.end_point))
67
70
  when Feature::LinearRing
@@ -69,8 +72,10 @@ module RGeo
69
72
  when Feature::LineString
70
73
  @geography_factory.line_string(geometry.points.map { |p| unproject(p) })
71
74
  when Feature::Polygon
72
- @geography_factory.polygon(unproject(geometry.exterior_ring),
73
- geometry.interior_rings.map { |p| unproject(p) })
75
+ @geography_factory.polygon(
76
+ unproject(geometry.exterior_ring),
77
+ geometry.interior_rings.map { |p| unproject(p) }
78
+ )
74
79
  when Feature::MultiPoint
75
80
  @geography_factory.multi_point(geometry.map { |p| unproject(p) })
76
81
  when Feature::MultiLineString
@@ -87,24 +92,22 @@ module RGeo
87
92
  end
88
93
 
89
94
  def limits_window
90
- @limits_window ||= ProjectedWindow.new(@geography_factory,
91
- -20_037_508.342789, -20_037_508.342789, 20_037_508.342789, 20_037_508.342789,
92
- is_limits: true)
93
- end
95
+ return @limits_window if defined?(@limits_window)
94
96
 
95
- def self._proj4_3857 # :nodoc:
96
- return unless CoordSys.supported?(:proj4)
97
- unless defined?(@proj4_3857)
98
- @proj4_3857 = CoordSys::Proj4.create("+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
99
- end
100
- @proj4_3857
97
+ @limits_window = ProjectedWindow.new(
98
+ @geography_factory,
99
+ -20_037_508.342789,
100
+ -20_037_508.342789,
101
+ 20_037_508.342789,
102
+ 20_037_508.342789,
103
+ is_limits: true
104
+ )
101
105
  end
102
106
 
103
107
  def self._coordsys_3857 # :nodoc:
104
- unless defined?(@coordsys_3857)
105
- @coordsys_3857 = CoordSys::CS.create_from_wkt('PROJCS["Popular Visualisation CRS / Mercator",GEOGCS["Popular Visualisation CRS",DATUM["Popular_Visualisation_Datum",SPHEROID["Popular Visualisation Sphere",6378137,0,AUTHORITY["EPSG","7059"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6055"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4055"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],AUTHORITY["EPSG","3785"],AXIS["X",EAST],AXIS["Y",NORTH]]')
106
- end
107
- @coordsys_3857
108
+ return @coordsys_3857 if defined?(@coordsys_3857)
109
+
110
+ @coordsys_3857 = CoordSys::CONFIG.default_coord_sys_class.create(3857)
108
111
  end
109
112
  end
110
113
  end
@@ -49,9 +49,10 @@ module RGeo
49
49
  return false unless rhs.is_a?(self.class) && rhs.factory == factory
50
50
  case rhs
51
51
  when Feature::Point
52
- if @y == 90
52
+ case @y
53
+ when 90
53
54
  rhs.y == 90
54
- elsif @y == -90
55
+ when -90
55
56
  rhs.y == -90
56
57
  else
57
58
  rhs.x == @x && rhs.y == @y
@@ -137,11 +138,6 @@ module RGeo
137
138
  true
138
139
  end
139
140
 
140
- def is_simple?
141
- warn "The is_simple? method is deprecated, please use the simple? counterpart, will be removed in v3" unless ENV["RGEO_SILENCE_DEPRECATION"]
142
- simple?
143
- end
144
-
145
141
  def length
146
142
  arcs.inject(0.0) { |sum, arc| sum + arc.length } * SphericalMath::RADIUS
147
143
  end
@@ -198,7 +194,11 @@ module RGeo
198
194
  next unless arc.intersects_arc?(rhs_arc)
199
195
 
200
196
  # check that endpoints aren't the intersection point
201
- is_endpoint = arc.contains_point?(rhs_arc.s) || arc.contains_point?(rhs_arc.e) || rhs_arc.contains_point?(arc.s) || rhs_arc.contains_point?(arc.e)
197
+ is_endpoint = arc.contains_point?(rhs_arc.s) ||
198
+ arc.contains_point?(rhs_arc.e) ||
199
+ rhs_arc.contains_point?(arc.s) ||
200
+ rhs_arc.contains_point?(arc.e)
201
+
202
202
  return true unless is_endpoint
203
203
  end
204
204
  end
@@ -23,6 +23,8 @@ module RGeo
23
23
  # of rotation.
24
24
 
25
25
  class PointXYZ # :nodoc:
26
+ attr_reader :x, :y, :z
27
+
26
28
  def initialize(x, y, z)
27
29
  r = Math.sqrt(x * x + y * y + z * z)
28
30
  @x = (x / r).to_f
@@ -35,12 +37,8 @@ module RGeo
35
37
  "(#{@x}, #{@y}, #{@z})"
36
38
  end
37
39
 
38
- attr_reader :x
39
- attr_reader :y
40
- attr_reader :z
41
-
42
- def eql?(rhs)
43
- rhs.is_a?(PointXYZ) && @x == rhs.x && @y == rhs.y && @z == rhs.z
40
+ def eql?(other)
41
+ other.is_a?(PointXYZ) && @x == other.x && @y == other.y && @z == other.z
44
42
  end
45
43
  alias == eql?
46
44
 
@@ -58,17 +56,17 @@ module RGeo
58
56
  [lon_rad / rpd, lat_rad / rpd]
59
57
  end
60
58
 
61
- def *(rhs)
62
- val = @x * rhs.x + @y * rhs.y + @z * rhs.z
59
+ def *(other)
60
+ val = @x * other.x + @y * other.y + @z * other.z
63
61
  val = 1.0 if val > 1.0
64
62
  val = -1.0 if val < -1.0
65
63
  val
66
64
  end
67
65
 
68
- def %(rhs)
69
- rx = rhs.x
70
- ry = rhs.y
71
- rz = rhs.z
66
+ def %(other)
67
+ rx = other.x
68
+ ry = other.y
69
+ rz = other.z
72
70
  begin
73
71
  PointXYZ.new(@y * rz - @z * ry, @z * rx - @x * rz, @x * ry - @y * rx)
74
72
  rescue StandardError
@@ -113,8 +111,8 @@ module RGeo
113
111
  new(x, y, z)
114
112
  end
115
113
 
116
- def self.weighted_combination(p1, w1, p2, w2)
117
- new(p1.x * w1 + p2.x * w2, p1.y * w1 + p2.y * w2, p1.z * w1 + p2.z * w2)
114
+ def self.weighted_combination(pt1, wt1, pt2, wt2)
115
+ new(pt1.x * wt1 + pt2.x * wt2, pt1.y * wt1 + pt2.y * wt2, pt1.z * wt1 + pt2.z * wt2)
118
116
  end
119
117
 
120
118
  P1 = new(1, 0, 0)
@@ -124,21 +122,20 @@ module RGeo
124
122
  # Represents a finite arc on the sphere.
125
123
 
126
124
  class ArcXYZ # :nodoc:
125
+ attr_reader :s, :e
126
+
127
127
  def initialize(start, stop)
128
128
  @s = start
129
129
  @e = stop
130
130
  @axis = false
131
131
  end
132
132
 
133
- attr_reader :s
134
- attr_reader :e
135
-
136
133
  def to_s
137
134
  "#{@s} - #{@e}"
138
135
  end
139
136
 
140
- def eql?(rhs)
141
- rhs.is_a?(ArcXYZ) && @s == rhs.s && @e == rhs.e
137
+ def eql?(other)
138
+ other.is_a?(ArcXYZ) && @s == other.s && @e == other.e
142
139
  end
143
140
  alias == eql?
144
141
 
@@ -156,7 +153,7 @@ module RGeo
156
153
  my_axis = axis
157
154
  s_axis = ArcXYZ.new(@s, obj).axis
158
155
  e_axis = ArcXYZ.new(obj, @e).axis
159
- !s_axis || !e_axis || obj * my_axis == 0.0 && s_axis * my_axis > 0 && e_axis * my_axis > 0
156
+ !s_axis || !e_axis || obj * my_axis == 0 && s_axis * my_axis > 0 && e_axis * my_axis > 0
160
157
  end
161
158
 
162
159
  def intersects_arc?(obj)
@@ -24,7 +24,7 @@ require_relative "geographic/interface"
24
24
  require_relative "geographic/spherical_math"
25
25
  require_relative "geographic/spherical_feature_methods"
26
26
  require_relative "geographic/spherical_feature_classes"
27
- require_relative "geographic/proj4_projector"
27
+ require_relative "geographic/projector"
28
28
  require_relative "geographic/simple_mercator_projector"
29
29
  require_relative "geographic/projected_feature_methods"
30
30
  require_relative "geographic/projected_feature_classes"