Class: RGeo::CoordSys::CS::GeocentricCoordinateSystem

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

Overview

OGC spec description

A 3D coordinate system, with its origin at the centre of the Earth. The X axis points towards the prime meridian. The Y axis points East or West. The Z axis points North or South. By default the Z axis will point North, and the Y axis will point East (e.g. a right handed system), but you should check the axes for non-default values.

Instance Attribute Summary collapse

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, horizontal_datum, prime_meridian, linear_unit, axis0, axis1, axis2, *optional) ⇒ GeocentricCoordinateSystem

:nodoc:


1069
1070
1071
1072
1073
1074
1075
1076
1077
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1069

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

Instance Attribute Details

#horizontal_datumObject (readonly)

Returns the HorizontalDatum. The horizontal datum is used to determine where the centre of the Earth is considered to be. All coordinate points will be measured from the centre of the Earth, and not the surface.


1083
1084
1085
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1083

def horizontal_datum
  @horizontal_datum
end

#linear_unitObject (readonly)

Gets the units used along all the axes.


1089
1090
1091
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1089

def linear_unit
  @linear_unit
end

#prime_meridianObject (readonly)

Returns the PrimeMeridian.


1086
1087
1088
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1086

def prime_meridian
  @prime_meridian
end

Class Method Details

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

Create a GeocentricCoordinateSystem given a name, a HorizontalDatum, a PrimeMeridian, a LinearUnit, and three AxisInfo objects. The AxisInfo are optional and may be nil. You may also provide the optional parameters specified by the Info interface.


1114
1115
1116
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1114

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

Instance Method Details

#get_axis(index) ⇒ Object

Implements CoordinateSystem#get_axis


1099
1100
1101
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1099

def get_axis(index)
  [@axis0, @axis1, @axis2][index]
end

#get_units(index) ⇒ Object

Implements CoordinateSystem#get_units


1093
1094
1095
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1093

def get_units(index)
  @linear_unit
end

#wkt_typenameObject


1103
1104
1105
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1103

def wkt_typename
  "GEOCCS"
end