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

#_to_wkt, #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:



1043
1044
1045
1046
1047
1048
1049
1050
1051
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1043

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.



1057
1058
1059
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1057

def horizontal_datum
  @horizontal_datum
end

#linear_unitObject (readonly)

Gets the units used along all the axes.



1063
1064
1065
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1063

def linear_unit
  @linear_unit
end

#prime_meridianObject (readonly)

Returns the PrimeMeridian.



1060
1061
1062
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1060

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.



1096
1097
1098
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1096

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

#_wkt_content(open_, close_) ⇒ Object

:nodoc:



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

def _wkt_content(open_, close_) # :nodoc:
  arr_ = [@horizontal_datum._to_wkt(open_, close_), @prime_meridian._to_wkt(open_, close_), @linear_unit._to_wkt(open_, close_)]
  arr_ << @axis0._to_wkt(open_, close_) if @axis0
  arr_ << @axis1._to_wkt(open_, close_) if @axis1
  arr_ << @axis2._to_wkt(open_, close_) if @axis2
  arr_
end

#_wkt_typenameObject

:nodoc:



1077
1078
1079
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1077

def _wkt_typename # :nodoc:
  "GEOCCS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis



1073
1074
1075
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1073

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

#get_units(_index_) ⇒ Object

Implements CoordinateSystem#get_units



1067
1068
1069
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1067

def get_units(_index_)
  @linear_unit
end