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 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:


1219
1220
1221
1222
1223
1224
1225
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1219

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.


1232
1233
1234
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1232

def angular_unit
  @angular_unit
end

#prime_meridianObject (readonly)

Returns the PrimeMeridian.


1228
1229
1230
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1228

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.


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

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

#get_axis(index) ⇒ Object

Implements CoordinateSystem#get_axis


1242
1243
1244
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1242

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

#get_units(index) ⇒ Object

Implements CoordinateSystem#get_units


1236
1237
1238
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1236

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.


1258
1259
1260
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1258

def get_wgs84_conversion_info(index)
  @horizontal_datum.wgs84_parameters
end

#num_conversion_to_wgs84Object

Gets the number of available conversions to WGS84 coordinates.


1248
1249
1250
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1248

def num_conversion_to_wgs84
  @horizontal_datum.wgs84_parameters ? 1 : 0
end

#wkt_typenameObject


1262
1263
1264
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1262

def wkt_typename
  "GEOGCS"
end