Class: RGeo::CoordSys::CS::GeographicCoordinateSystem

Inherits:
HorizontalCoordinateSystem show all
Defined in:
lib/rgeo/coord_sys/cs/entities.rb

Overview

OGC spec description

A coordinate system based on latitude and longitude. Some geographic coordinate systems are Lat/Lon, and some are Lon/Lat. You can find out which this is by examining the axes. You should also check the angular units, since not all geographic coordinate systems use degrees.

Instance Attribute Summary collapse

Attributes inherited from HorizontalCoordinateSystem

#horizontal_datum

Attributes inherited from CoordinateSystem

#dimension

Attributes inherited from Info

#abbreviation, #alias, #authority, #authority_code, #name, #remarks

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CoordinateSystem

create_from_wkt, #projected?, #transform_coords

Methods inherited from Info

#extension

Methods inherited from Base

#encode_with, #eql?, #hash, #init_with, #inspect, #marshal_dump, #marshal_load, #to_s, #to_wkt

Constructor Details

#initialize(name, angular_unit, horizontal_datum, prime_meridian, axis0, axis1, *optional) ⇒ GeographicCoordinateSystem

:nodoc:



1264
1265
1266
1267
1268
1269
1270
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1264

def initialize(name, angular_unit, horizontal_datum, prime_meridian, axis0, axis1, *optional) # :nodoc:
  super(name, horizontal_datum, *optional)
  @prime_meridian = prime_meridian
  @angular_unit = angular_unit
  @axis0 = axis0
  @axis1 = axis1
end

Instance Attribute Details

#angular_unitObject (readonly)

Returns the AngularUnit. The angular unit must be the same as the CS_CoordinateSystem units.



1277
1278
1279
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1277

def angular_unit
  @angular_unit
end

#prime_meridianObject (readonly)

Returns the PrimeMeridian.



1273
1274
1275
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1273

def prime_meridian
  @prime_meridian
end

Class Method Details

.create(name, angular_unit, horizontal_datum, prime_meridian, axis0, axis1, *optional) ⇒ Object

Create a GeographicCoordinateSystem, given a name, an AngularUnit, a HorizontalDatum, a PrimeMeridian, and two AxisInfo objects. The AxisInfo objects are optional and may be set to nil. You may also provide the optional parameters specified by the Info interface.



1322
1323
1324
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1322

def create(name, angular_unit, horizontal_datum, prime_meridian, axis0, axis1, *optional)
  new(name, angular_unit, horizontal_datum, prime_meridian, axis0, axis1, *optional)
end

Instance Method Details

#geographic?Boolean

Returns:

  • (Boolean)


1307
1308
1309
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1307

def geographic?
  true
end

#get_axis(index) ⇒ Object

Implements CoordinateSystem#get_axis



1287
1288
1289
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1287

def get_axis(index)
  index == 1 ? @axis1 : @axis0
end

#get_units(_index) ⇒ Object

Implements CoordinateSystem#get_units



1281
1282
1283
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1281

def get_units(_index)
  @angular_unit
end

#get_wgs84_conversion_info(_index) ⇒ Object

Gets details on a conversion to WGS84. Some geographic coordinate systems provide several transformations into WGS84, which are designed to provide good accuracy in different areas of interest. The first conversion (with index=0) should provide acceptable accuracy over the largest possible area of interest.



1303
1304
1305
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1303

def get_wgs84_conversion_info(_index)
  @horizontal_datum.wgs84_parameters
end

#num_conversion_to_wgs84Object

Gets the number of available conversions to WGS84 coordinates.



1293
1294
1295
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1293

def num_conversion_to_wgs84
  @horizontal_datum.wgs84_parameters ? 1 : 0
end

#wkt_typenameObject



1311
1312
1313
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1311

def wkt_typename
  "GEOGCS"
end