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

:nodoc:



1106
1107
1108
1109
1110
1111
1112
1113
1114
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1106

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.



1120
1121
1122
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1120

def horizontal_datum
  @horizontal_datum
end

#linear_unitObject (readonly)

Gets the units used along all the axes.



1126
1127
1128
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1126

def linear_unit
  @linear_unit
end

#prime_meridianObject (readonly)

Returns the PrimeMeridian.



1123
1124
1125
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1123

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.



1155
1156
1157
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1155

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

#geographic?Boolean

Returns:

  • (Boolean)


1140
1141
1142
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1140

def geographic?
  true
end

#get_axis(index) ⇒ Object

Implements CoordinateSystem#get_axis



1136
1137
1138
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1136

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

#get_units(_index) ⇒ Object

Implements CoordinateSystem#get_units



1130
1131
1132
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1130

def get_units(_index)
  @linear_unit
end

#wkt_typenameObject



1144
1145
1146
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1144

def wkt_typename
  "GEOCCS"
end