rgeo 3.0.0.pre.rc.3 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -3
  3. data/ext/geos_c_impl/extconf.rb +1 -0
  4. data/ext/geos_c_impl/factory.c +43 -5
  5. data/ext/geos_c_impl/factory.h +13 -2
  6. data/ext/geos_c_impl/geometry.c +178 -122
  7. data/ext/geos_c_impl/geometry_collection.c +17 -19
  8. data/ext/geos_c_impl/line_string.c +46 -36
  9. data/ext/geos_c_impl/point.c +0 -2
  10. data/ext/geos_c_impl/polygon.c +10 -11
  11. data/ext/geos_c_impl/polygon.h +1 -1
  12. data/ext/geos_c_impl/preface.h +3 -0
  13. data/ext/geos_c_impl/ruby_more.c +7 -0
  14. data/ext/geos_c_impl/ruby_more.h +8 -0
  15. data/lib/rgeo/cartesian/analysis.rb +5 -3
  16. data/lib/rgeo/cartesian/bounding_box.rb +74 -79
  17. data/lib/rgeo/cartesian/calculations.rb +20 -26
  18. data/lib/rgeo/cartesian/factory.rb +47 -49
  19. data/lib/rgeo/cartesian/planar_graph.rb +10 -16
  20. data/lib/rgeo/cartesian/sweepline_intersector.rb +1 -3
  21. data/lib/rgeo/cartesian/valid_op.rb +1 -3
  22. data/lib/rgeo/coord_sys/cs/entities.rb +91 -101
  23. data/lib/rgeo/coord_sys/cs/factories.rb +0 -2
  24. data/lib/rgeo/coord_sys/cs/wkt_parser.rb +70 -29
  25. data/lib/rgeo/feature/curve.rb +0 -1
  26. data/lib/rgeo/feature/factory.rb +25 -27
  27. data/lib/rgeo/feature/factory_generator.rb +3 -4
  28. data/lib/rgeo/feature/geometry.rb +41 -30
  29. data/lib/rgeo/feature/geometry_collection.rb +3 -4
  30. data/lib/rgeo/feature/line_string.rb +1 -2
  31. data/lib/rgeo/feature/linear_ring.rb +0 -1
  32. data/lib/rgeo/feature/multi_curve.rb +0 -1
  33. data/lib/rgeo/feature/multi_surface.rb +0 -1
  34. data/lib/rgeo/feature/point.rb +0 -1
  35. data/lib/rgeo/feature/polygon.rb +1 -2
  36. data/lib/rgeo/feature/surface.rb +0 -1
  37. data/lib/rgeo/feature/types.rb +69 -85
  38. data/lib/rgeo/geographic/factory.rb +87 -80
  39. data/lib/rgeo/geographic/interface.rb +44 -27
  40. data/lib/rgeo/geographic/projected_feature_methods.rb +2 -6
  41. data/lib/rgeo/geographic/projected_window.rb +35 -21
  42. data/lib/rgeo/geographic/simple_mercator_projector.rb +27 -15
  43. data/lib/rgeo/geographic/spherical_feature_methods.rb +8 -3
  44. data/lib/rgeo/geographic/spherical_math.rb +17 -20
  45. data/lib/rgeo/geos/capi_factory.rb +50 -50
  46. data/lib/rgeo/geos/ffi_factory.rb +50 -49
  47. data/lib/rgeo/geos/ffi_feature_methods.rb +72 -98
  48. data/lib/rgeo/geos/interface.rb +16 -16
  49. data/lib/rgeo/geos/utils.rb +5 -5
  50. data/lib/rgeo/geos/zm_factory.rb +50 -42
  51. data/lib/rgeo/geos/zm_feature_methods.rb +15 -9
  52. data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +4 -4
  53. data/lib/rgeo/impl_helper/basic_geometry_methods.rb +1 -2
  54. data/lib/rgeo/impl_helper/basic_line_string_methods.rb +18 -24
  55. data/lib/rgeo/impl_helper/basic_point_methods.rb +1 -3
  56. data/lib/rgeo/impl_helper/basic_polygon_methods.rb +15 -16
  57. data/lib/rgeo/impl_helper/utils.rb +3 -9
  58. data/lib/rgeo/impl_helper/valid_op.rb +12 -16
  59. data/lib/rgeo/version.rb +1 -1
  60. data/lib/rgeo/wkrep/wkb_generator.rb +42 -47
  61. data/lib/rgeo/wkrep/wkb_parser.rb +17 -18
  62. data/lib/rgeo/wkrep/wkt_generator.rb +23 -16
  63. data/lib/rgeo/wkrep/wkt_parser.rb +23 -13
  64. metadata +6 -6
@@ -147,7 +147,6 @@ module RGeo
147
147
  # Coordinate Transformation spec.
148
148
  #
149
149
  # This is a non-instantiable abstract class.
150
-
151
150
  class Base
152
151
  # Standard object inspection output
153
152
 
@@ -158,8 +157,8 @@ module RGeo
158
157
  # Tests for equality. Two objects are defined as equal if they
159
158
  # have the same type (class) and the same WKT representation.
160
159
 
161
- def eql?(rhs)
162
- rhs.class == self.class && rhs.to_wkt == to_wkt
160
+ def eql?(other)
161
+ other.class == self.class && other.to_wkt == to_wkt
163
162
  end
164
163
  alias == eql?
165
164
 
@@ -180,19 +179,21 @@ module RGeo
180
179
  # <tt>:standard_brackets</tt>
181
180
  # If true, outputs parentheses rather than square
182
181
  # brackets. Default is false.
183
- def to_wkt(standard_brackets = false)
182
+ def to_wkt(standard_brackets: false)
184
183
  open, close = brackets(standard_brackets)
185
184
  content = wkt_content(standard_brackets).map { |obj| ",#{obj}" }.join
186
- if defined?(@authority) && @authority
187
- authority = ",AUTHORITY#{open}#{@authority.inspect},#{@authority_code.inspect}#{close}"
188
- else
189
- authority = ""
190
- end
191
- if defined?(@extensions) && @extensions
192
- extensions = @extensions.map { |k, v| ",EXTENSION#{open}#{k.inspect},#{v.inspect}#{close}" }.join
193
- else
194
- extensions = ""
195
- end
185
+ authority =
186
+ if defined?(@authority) && @authority
187
+ ",AUTHORITY#{open}#{@authority.inspect},#{@authority_code.inspect}#{close}"
188
+ else
189
+ ""
190
+ end
191
+ extensions =
192
+ if defined?(@extensions) && @extensions
193
+ @extensions.map { |k, v| ",EXTENSION#{open}#{k.inspect},#{v.inspect}#{close}" }.join
194
+ else
195
+ ""
196
+ end
196
197
  "#{wkt_typename}#{open}#{@name.inspect}#{content}#{extensions}#{authority}#{close}"
197
198
  end
198
199
 
@@ -205,12 +206,11 @@ module RGeo
205
206
  def marshal_load(data) # :nodoc:
206
207
  data = data["wkt"] if data.is_a?(Hash)
207
208
  temp = CS.create_from_wkt(data)
208
- if temp.class == self.class
209
- temp.instance_variables.each do |iv|
210
- instance_variable_set(iv, temp.instance_variable_get(iv))
211
- end
212
- else
213
- raise TypeError, "Bad Marshal data"
209
+
210
+ raise TypeError, "Bad Marshal data" unless temp.instance_of?(self.class)
211
+
212
+ temp.instance_variables.each do |iv|
213
+ instance_variable_set(iv, temp.instance_variable_get(iv))
214
214
  end
215
215
  end
216
216
 
@@ -222,12 +222,11 @@ module RGeo
222
222
 
223
223
  def init_with(coder) # :nodoc:
224
224
  temp = CS.create_from_wkt(coder.type == :scalar ? coder.scalar : coder["wkt"])
225
- if temp.class == self.class
226
- temp.instance_variables.each do |iv|
227
- instance_variable_set(iv, temp.instance_variable_get(iv))
228
- end
229
- else
230
- raise TypeError, "Bad YAML data"
225
+
226
+ raise TypeError, "Bad YAML data" unless temp.instance_of?(self.class)
227
+
228
+ temp.instance_variables.each do |iv|
229
+ instance_variable_set(iv, temp.instance_variable_get(iv))
231
230
  end
232
231
  end
233
232
 
@@ -246,20 +245,21 @@ module RGeo
246
245
  #
247
246
  # Details of axis. This is used to label axes, and indicate the
248
247
  # orientation.
249
-
250
248
  class AxisInfo < Base
251
249
  # :stopdoc:
252
250
  NAMES_BY_VALUE = %w[OTHER NORTH SOUTH EAST WEST UP DOWN].freeze
253
251
  # :startdoc:
254
252
 
255
253
  def initialize(name, orientation) # :nodoc:
254
+ super()
256
255
  @name = name
257
- case orientation
258
- when String, Symbol
259
- @orientation = NAMES_BY_VALUE.index(orientation.to_s.upcase).to_i
260
- else
261
- @orientation = orientation.to_i
262
- end
256
+ @orientation =
257
+ case orientation
258
+ when String, Symbol
259
+ NAMES_BY_VALUE.index(orientation.to_s.upcase).to_i
260
+ else
261
+ orientation.to_i
262
+ end
263
263
  end
264
264
 
265
265
  # Human readable name for axis. Possible values are "X", "Y",
@@ -301,9 +301,9 @@ module RGeo
301
301
  # projected coordinate system. The angular units of parameter
302
302
  # values match the angular units of the geographic coordinate
303
303
  # system that the projected coordinate system is based on.
304
-
305
304
  class ProjectionParameter < Base
306
305
  def initialize(name, value) # :nodoc:
306
+ super()
307
307
  @name = name
308
308
  @value = value.to_f
309
309
  end
@@ -339,15 +339,15 @@ module RGeo
339
339
  # Wolf parameters should be applied to geocentric coordinates, where
340
340
  # the X axis points towards the Greenwich Prime Meridian, the Y axis
341
341
  # points East, and the Z axis points North.
342
-
343
342
  class WGS84ConversionInfo < Base
344
- def initialize(dx, dy, dz, ex, ey, ez, ppm) # :nodoc:
345
- @dx = dx.to_f
346
- @dy = dy.to_f
347
- @dz = dz.to_f
348
- @ex = ex.to_f
349
- @ey = ey.to_f
350
- @ez = ez.to_f
343
+ def initialize(dx_meters, dy_meters, dz_meters, ex_arc_seconds, ey_arc_seconds, ez_arc_seconds, ppm) # :nodoc:
344
+ super()
345
+ @dx = dx_meters.to_f
346
+ @dy = dy_meters.to_f
347
+ @dz = dz_meters.to_f
348
+ @ex = ex_arc_seconds.to_f
349
+ @ey = ey_arc_seconds.to_f
350
+ @ez = ez_arc_seconds.to_f
351
351
  @ppm = ppm.to_f
352
352
  end
353
353
 
@@ -372,7 +372,7 @@ module RGeo
372
372
  # Bursa Wolf scaling in in parts per million.
373
373
  attr_reader :ppm
374
374
 
375
- def to_wkt(standard_brackets = false)
375
+ def to_wkt(standard_brackets: false)
376
376
  open, close = brackets(standard_brackets)
377
377
  "TOWGS84#{open}#{@dx},#{@dy},#{@dz},#{@ex},#{@ey},#{@ez},#{@ppm}#{close}"
378
378
  end
@@ -383,8 +383,8 @@ module RGeo
383
383
  # The Bursa Wolf shift should be in meters, the rotation in arc
384
384
  # seconds, and the scaling in parts per million.
385
385
 
386
- def create(dx, dy, dz, ex, ey, ez, ppm)
387
- new(dx, dy, dz, ex, ey, ez, ppm)
386
+ def create(dx_meters, dy_meters, dz_meters, ex_arc_seconds, ey_arc_seconds, ez_arc_seconds, ppm)
387
+ new(dx_meters, dy_meters, dz_meters, ex_arc_seconds, ey_arc_seconds, ez_arc_seconds, ppm)
388
388
  end
389
389
  end
390
390
  end
@@ -427,9 +427,10 @@ module RGeo
427
427
  # * <b>alias</b>: an alias
428
428
  # * <b>remarks</b>: provider-supplied remarks.
429
429
  # * <b>extensions</b>: a hash of extension keys and values
430
-
431
430
  class Info < Base
432
- def initialize(name, authority = nil, authority_code = nil, abbreviation = nil, init_alias = nil, remarks = nil, extensions = nil) # :nodoc:
431
+ def initialize(name, authority = nil, authority_code = nil, abbreviation = nil, init_alias = nil,
432
+ remarks = nil, extensions = nil) # :nodoc:
433
+ super()
433
434
  @name = name
434
435
  @authority = authority ? authority.to_s : nil
435
436
  @authority_code = authority_code ? authority_code.to_s : nil
@@ -488,7 +489,6 @@ module RGeo
488
489
  # Normally, you will instantiate one of the subclasses LinearUnit or
489
490
  # AngularUnit. However, it is possible to instantiate Unit if it is
490
491
  # not clear whether the data refers to a LinearUnit or AngularUnit.
491
-
492
492
  class Unit < Info
493
493
  def initialize(name, conversion_factor, *optional) # :nodoc:
494
494
  super(name, *optional)
@@ -525,7 +525,6 @@ module RGeo
525
525
  # == OGC spec description
526
526
  #
527
527
  # Definition of linear units.
528
-
529
528
  class LinearUnit < Unit
530
529
  # Returns the number of meters per LinearUnit.
531
530
  # Also available as Unit#conversion_factor.
@@ -548,7 +547,6 @@ module RGeo
548
547
  # == OGC spec description
549
548
  #
550
549
  # Definition of angular units.
551
-
552
550
  class AngularUnit < Unit
553
551
  # Returns the number of radians per AngularUnit.
554
552
  # Also available as Unit#conversion_factor.
@@ -571,7 +569,6 @@ module RGeo
571
569
  # == OGC spec description
572
570
  #
573
571
  # A meridian used to take longitude measurements from.
574
-
575
572
  class PrimeMeridian < Info
576
573
  def initialize(name, angular_unit, longitude, *optional) # :nodoc:
577
574
  super(name, *optional)
@@ -611,9 +608,9 @@ module RGeo
611
608
  # == OGC spec description
612
609
  #
613
610
  # An approximation of the Earth's surface as a squashed sphere.
614
-
615
611
  class Ellipsoid < Info
616
- def initialize(name, semi_major_axis, semi_minor_axis, inverse_flattening, ivf_definitive, linear_unit, *optional) # :nodoc:
612
+ def initialize(name, semi_major_axis, semi_minor_axis, inverse_flattening, ivf_definitive,
613
+ linear_unit, *optional) # :nodoc:
617
614
  super(name, *optional)
618
615
  @semi_major_axis = semi_major_axis.to_f
619
616
  @semi_minor_axis = semi_minor_axis.to_f
@@ -718,7 +715,6 @@ module RGeo
718
715
  # This is a non-instantiable abstract class. You must instantiate
719
716
  # one of the subclasses HorizontalDatum, VerticalDatum, or
720
717
  # LocalDatum.
721
-
722
718
  class Datum < Info
723
719
  def initialize(name, datum_type, *optional) # :nodoc:
724
720
  super(name, *optional)
@@ -738,7 +734,6 @@ module RGeo
738
734
  # == OGC spec description
739
735
  #
740
736
  # Procedure used to measure vertical distances.
741
-
742
737
  class VerticalDatum < Datum
743
738
  def wkt_typename
744
739
  "VERT_DATUM"
@@ -768,7 +763,6 @@ module RGeo
768
763
  # coordinates can be transformed between two different local
769
764
  # coordinate systems, as long as they are based on the same local
770
765
  # datum.
771
-
772
766
  class LocalDatum < Datum
773
767
  def wkt_typename
774
768
  "LOCAL_DATUM"
@@ -794,7 +788,6 @@ module RGeo
794
788
  # == OGC spec description
795
789
  #
796
790
  # Procedure used to measure positions on the surface of the Earth.
797
-
798
791
  class HorizontalDatum < Datum
799
792
  def initialize(name, datum_type, ellipsoid, wgs84_parameters, *optional) # :nodoc:
800
793
  super(name, datum_type, *optional)
@@ -828,8 +821,8 @@ module RGeo
828
821
  private
829
822
 
830
823
  def wkt_content(standard_brackets)
831
- array = [@ellipsoid.to_wkt(standard_brackets)]
832
- array << @wgs84_parameters.to_wkt(standard_brackets) if @wgs84_parameters
824
+ array = [@ellipsoid.to_wkt(standard_brackets: standard_brackets)]
825
+ array << @wgs84_parameters.to_wkt(standard_brackets: standard_brackets) if @wgs84_parameters
833
826
  array
834
827
  end
835
828
  end
@@ -837,7 +830,6 @@ module RGeo
837
830
  # == OGC spec description
838
831
  #
839
832
  # A projection from geographic coordinates to projected coordinates.
840
-
841
833
  class Projection < Info
842
834
  def initialize(name, class_name, parameters, *optional) # :nodoc:
843
835
  super(name, *optional)
@@ -916,7 +908,6 @@ module RGeo
916
908
  # GeographicCoordinateSystem, ProjectedCoordinateSystem,
917
909
  # VerticalCoordinateSystem, LocalCoordinateSystem, or
918
910
  # CompoundCoordinateSystem.
919
-
920
911
  class CoordinateSystem < Info
921
912
  def initialize(name, dimension, *optional) # :nodoc:
922
913
  super(name, *optional)
@@ -929,14 +920,14 @@ module RGeo
929
920
  # Gets axis details for dimension within coordinate system. Each
930
921
  # dimension in the coordinate system has a corresponding axis.
931
922
 
932
- def get_axis(dimension)
923
+ def get_axis(_dimension)
933
924
  nil
934
925
  end
935
926
 
936
927
  # Gets units for dimension within coordinate system. Each
937
928
  # dimension in the coordinate system has corresponding units.
938
929
 
939
- def get_units(dimension)
930
+ def get_units(_dimension)
940
931
  nil
941
932
  end
942
933
 
@@ -993,7 +984,6 @@ module RGeo
993
984
  # as a geographic or a projected coordinate system with a horizontal
994
985
  # datum. The other is a vertical CRS which is a one-dimensional
995
986
  # coordinate system with a vertical datum.
996
-
997
987
  class CompoundCoordinateSystem < CoordinateSystem
998
988
  def initialize(name, head, tail, *optional) # :nodoc:
999
989
  super(name, head.dimension + tail.dimension, *optional)
@@ -1038,7 +1028,7 @@ module RGeo
1038
1028
  private
1039
1029
 
1040
1030
  def wkt_content(standard_brackets)
1041
- [@head.to_wkt(standard_brackets), @tail.to_wkt(standard_brackets)]
1031
+ [@head.to_wkt(standard_brackets: standard_brackets), @tail.to_wkt(standard_brackets: standard_brackets)]
1042
1032
  end
1043
1033
  end
1044
1034
 
@@ -1060,7 +1050,6 @@ module RGeo
1060
1050
  #
1061
1051
  # RGeo's implementation does not provide the Coordinate
1062
1052
  # Transformation (CT) package.
1063
-
1064
1053
  class LocalCoordinateSystem < CoordinateSystem
1065
1054
  def initialize(name, local_datum, unit, axes, *optional) # :nodoc:
1066
1055
  super(name, axes.size, *optional)
@@ -1080,7 +1069,7 @@ module RGeo
1080
1069
 
1081
1070
  # Implements CoordinateSystem#get_units
1082
1071
 
1083
- def get_units(index)
1072
+ def get_units(_index)
1084
1073
  @unit
1085
1074
  end
1086
1075
 
@@ -1103,9 +1092,9 @@ module RGeo
1103
1092
 
1104
1093
  def wkt_content(standard_brackets)
1105
1094
  [
1106
- @local_datum.to_wkt(standard_brackets),
1107
- @unit.to_wkt(standard_brackets)
1108
- ] + @axes.map { |ax| ax.to_wkt(standard_brackets) }
1095
+ @local_datum.to_wkt(standard_brackets: standard_brackets),
1096
+ @unit.to_wkt(standard_brackets: standard_brackets)
1097
+ ] + @axes.map { |ax| ax.to_wkt(standard_brackets: standard_brackets) }
1109
1098
  end
1110
1099
  end
1111
1100
 
@@ -1117,7 +1106,6 @@ module RGeo
1117
1106
  # the Z axis will point North, and the Y axis will point East (e.g.
1118
1107
  # a right handed system), but you should check the axes for
1119
1108
  # non-default values.
1120
-
1121
1109
  class GeocentricCoordinateSystem < CoordinateSystem
1122
1110
  def initialize(name, horizontal_datum, prime_meridian, linear_unit, axis0, axis1, axis2, *optional) # :nodoc:
1123
1111
  super(name, 3, *optional)
@@ -1143,7 +1131,7 @@ module RGeo
1143
1131
 
1144
1132
  # Implements CoordinateSystem#get_units
1145
1133
 
1146
- def get_units(index)
1134
+ def get_units(_index)
1147
1135
  @linear_unit
1148
1136
  end
1149
1137
 
@@ -1177,13 +1165,13 @@ module RGeo
1177
1165
 
1178
1166
  def wkt_content(standard_brackets)
1179
1167
  arr = [
1180
- @horizontal_datum.to_wkt(standard_brackets),
1181
- @prime_meridian.to_wkt(standard_brackets),
1182
- @linear_unit.to_wkt(standard_brackets)
1168
+ @horizontal_datum.to_wkt(standard_brackets: standard_brackets),
1169
+ @prime_meridian.to_wkt(standard_brackets: standard_brackets),
1170
+ @linear_unit.to_wkt(standard_brackets: standard_brackets)
1183
1171
  ]
1184
- arr << @axis0.to_wkt(standard_brackets) if @axis0
1185
- arr << @axis1.to_wkt(standard_brackets) if @axis1
1186
- arr << @axis2.to_wkt(standard_brackets) if @axis2
1172
+ arr << @axis0.to_wkt(standard_brackets: standard_brackets) if @axis0
1173
+ arr << @axis1.to_wkt(standard_brackets: standard_brackets) if @axis1
1174
+ arr << @axis2.to_wkt(standard_brackets: standard_brackets) if @axis2
1187
1175
  arr
1188
1176
  end
1189
1177
  end
@@ -1192,7 +1180,6 @@ module RGeo
1192
1180
  #
1193
1181
  # A one-dimensional coordinate system suitable for vertical
1194
1182
  # measurements.
1195
-
1196
1183
  class VerticalCoordinateSystem < CoordinateSystem
1197
1184
  def initialize(name, vertical_datum, vertical_unit, axis, *optional) # :nodoc:
1198
1185
  super(name, 1, *optional)
@@ -1210,13 +1197,13 @@ module RGeo
1210
1197
 
1211
1198
  # Implements CoordinateSystem#get_units
1212
1199
 
1213
- def get_units(index)
1200
+ def get_units(_index)
1214
1201
  @vertical_unit
1215
1202
  end
1216
1203
 
1217
1204
  # Implements CoordinateSystem#get_axis
1218
1205
 
1219
- def get_axis(index)
1206
+ def get_axis(_index)
1220
1207
  @axis
1221
1208
  end
1222
1209
 
@@ -1238,8 +1225,11 @@ module RGeo
1238
1225
  private
1239
1226
 
1240
1227
  def wkt_content(standard_brackets)
1241
- arr = [@vertical_datum.to_wkt(standard_brackets), @vertical_unit.to_wkt(standard_brackets)]
1242
- arr << @axis.to_wkt(standard_brackets) if @axis
1228
+ arr = [
1229
+ @vertical_datum.to_wkt(standard_brackets: standard_brackets),
1230
+ @vertical_unit.to_wkt(standard_brackets: standard_brackets)
1231
+ ]
1232
+ arr << @axis.to_wkt(standard_brackets: standard_brackets) if @axis
1243
1233
  arr
1244
1234
  end
1245
1235
  end
@@ -1253,7 +1243,6 @@ module RGeo
1253
1243
  # This is a non-instantiable abstract class. You must instantiate
1254
1244
  # one of the subclasses GeographicCoordinateSystem or
1255
1245
  # ProjectedCoordinateSystem.
1256
-
1257
1246
  class HorizontalCoordinateSystem < CoordinateSystem
1258
1247
  def initialize(name, horizontal_datum, *optional) # :nodoc:
1259
1248
  super(name, 2, *optional)
@@ -1271,7 +1260,6 @@ module RGeo
1271
1260
  # You can find out which this is by examining the axes. You should
1272
1261
  # also check the angular units, since not all geographic coordinate
1273
1262
  # systems use degrees.
1274
-
1275
1263
  class GeographicCoordinateSystem < HorizontalCoordinateSystem
1276
1264
  def initialize(name, angular_unit, horizontal_datum, prime_meridian, axis0, axis1, *optional) # :nodoc:
1277
1265
  super(name, horizontal_datum, *optional)
@@ -1290,7 +1278,7 @@ module RGeo
1290
1278
 
1291
1279
  # Implements CoordinateSystem#get_units
1292
1280
 
1293
- def get_units(index)
1281
+ def get_units(_index)
1294
1282
  @angular_unit
1295
1283
  end
1296
1284
 
@@ -1312,7 +1300,7 @@ module RGeo
1312
1300
  # of interest. The first conversion (with index=0) should provide
1313
1301
  # acceptable accuracy over the largest possible area of interest.
1314
1302
 
1315
- def get_wgs84_conversion_info(index)
1303
+ def get_wgs84_conversion_info(_index)
1316
1304
  @horizontal_datum.wgs84_parameters
1317
1305
  end
1318
1306
 
@@ -1340,12 +1328,12 @@ module RGeo
1340
1328
 
1341
1329
  def wkt_content(standard_brackets)
1342
1330
  arr = [
1343
- @horizontal_datum.to_wkt(standard_brackets),
1344
- @prime_meridian.to_wkt(standard_brackets),
1345
- @angular_unit.to_wkt(standard_brackets)
1331
+ @horizontal_datum.to_wkt(standard_brackets: standard_brackets),
1332
+ @prime_meridian.to_wkt(standard_brackets: standard_brackets),
1333
+ @angular_unit.to_wkt(standard_brackets: standard_brackets)
1346
1334
  ]
1347
- arr << @axis0.to_wkt(standard_brackets) if @axis0
1348
- arr << @axis1.to_wkt(standard_brackets) if @axis1
1335
+ arr << @axis0.to_wkt(standard_brackets: standard_brackets) if @axis0
1336
+ arr << @axis1.to_wkt(standard_brackets: standard_brackets) if @axis1
1349
1337
  arr
1350
1338
  end
1351
1339
  end
@@ -1353,7 +1341,6 @@ module RGeo
1353
1341
  # == OGC spec description
1354
1342
  #
1355
1343
  # A 2D cartographic coordinate system.
1356
-
1357
1344
  class ProjectedCoordinateSystem < HorizontalCoordinateSystem
1358
1345
  def initialize(name, geographic_coordinate_system, projection, linear_unit, axis0, axis1, *optional) # :nodoc:
1359
1346
  super(name, geographic_coordinate_system.horizontal_datum, *optional)
@@ -1376,7 +1363,7 @@ module RGeo
1376
1363
 
1377
1364
  # Implements CoordinateSystem#get_units
1378
1365
 
1379
- def get_units(index)
1366
+ def get_units(_index)
1380
1367
  @linear_unit
1381
1368
  end
1382
1369
 
@@ -1409,11 +1396,14 @@ module RGeo
1409
1396
  private
1410
1397
 
1411
1398
  def wkt_content(standard_brackets)
1412
- arr = [@geographic_coordinate_system.to_wkt(standard_brackets), @projection.to_wkt(standard_brackets)]
1413
- @projection.each_parameter { |param| arr << param.to_wkt(standard_brackets) }
1414
- arr << @linear_unit.to_wkt(standard_brackets)
1415
- arr << @axis0.to_wkt(standard_brackets) if @axis0
1416
- arr << @axis1.to_wkt(standard_brackets) if @axis1
1399
+ arr = [
1400
+ @geographic_coordinate_system.to_wkt(standard_brackets: standard_brackets),
1401
+ @projection.to_wkt(standard_brackets: standard_brackets)
1402
+ ]
1403
+ @projection.each_parameter { |param| arr << param.to_wkt(standard_brackets: standard_brackets) }
1404
+ arr << @linear_unit.to_wkt(standard_brackets: standard_brackets)
1405
+ arr << @axis0.to_wkt(standard_brackets: standard_brackets) if @axis0
1406
+ arr << @axis1.to_wkt(standard_brackets: standard_brackets) if @axis1
1417
1407
  arr
1418
1408
  end
1419
1409
  end
@@ -1560,8 +1550,8 @@ module RGeo
1560
1550
  private
1561
1551
 
1562
1552
  def wkt_content(standard_brackets)
1563
- source_cs_wkt = "SOURCECS[#{source_cs.to_wkt(standard_brackets)}]"
1564
- target_cs_wkt = "TARGETCS[#{target_cs.to_wkt(standard_brackets)}]"
1553
+ source_cs_wkt = "SOURCECS[#{source_cs.to_wkt(standard_brackets: standard_brackets)}]"
1554
+ target_cs_wkt = "TARGETCS[#{target_cs.to_wkt(standard_brackets: standard_brackets)}]"
1565
1555
 
1566
1556
  [source_cs_wkt, target_cs_wkt]
1567
1557
  end
@@ -28,7 +28,6 @@ module RGeo
28
28
  # * FittedCoordinateSystem is not implemented.
29
29
  # * The defaultEnvelope attribute of CS_CoordinateSystem is not
30
30
  # implemented.
31
-
32
31
  module CS
33
32
  # A class implementing the CS_CoordinateSystemFactory interface.
34
33
  # It provides methods for building up complex objects from simpler
@@ -37,7 +36,6 @@ module RGeo
37
36
  # Note that the methods of CS_CoordinateSystemFactory do not provide
38
37
  # facilities for setting the authority. If you need to set authority
39
38
  # values, use the create methods for the object classes themselves.
40
-
41
39
  class CoordinateSystemFactory
42
40
  # Create a CompoundCoordinateSystem from a name, and two
43
41
  # constituent coordinate systems.