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:


1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1257

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.


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

def horizontal_datum
  @horizontal_datum
end

#linear_unitObject (readonly)

Gets the units used along all the axes.


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

def linear_unit
  @linear_unit
end

#prime_meridianObject (readonly)

Returns the PrimeMeridian.


1275
1276
1277
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1275

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.


1317
1318
1319
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1317

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:


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

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:


1295
1296
1297
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1295

def _wkt_typename  # :nodoc:
  "GEOCCS"
end

#get_axis(index_) ⇒ Object

Implements CoordinateSystem#get_axis


1290
1291
1292
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1290

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

#get_units(index_) ⇒ Object

Implements CoordinateSystem#get_units


1283
1284
1285
# File 'lib/rgeo/coord_sys/cs/entities.rb', line 1283

def get_units(index_)
  @linear_unit
end