class RGeo::CoordSys::CS::Ellipsoid

OGC spec description

An approximation of the Earth’s surface as a squashed sphere.

Attributes

axis_unit[R]

Returns the LinearUnit. The units of the semi-major and semi-minor axis values.

inverse_flattening[R]

Returns the value of the inverse of the flattening constant. The inverse flattening is related to the equatorial/polar radius by the formula ivf=re/(re-rp). For perfect spheres, this formula breaks down, and a special IVF value of zero is used.

ivf_definitive[R]

Is the Inverse Flattening definitive for this ellipsoid? Some ellipsoids use the IVF as the defining value, and calculate the polar radius whenever asked. Other ellipsoids use the polar radius to calculate the IVF whenever asked. This distinction can be important to avoid floating-point rounding errors.

semi_major_axis[R]

Gets the equatorial radius. The returned length is expressed in this object’s axis units.

semi_minor_axis[R]

Gets the polar radius. The returned length is expressed in this object’s axis units.

Public Class Methods

create(name_, semi_major_axis_, semi_minor_axis_, inverse_flattening_, ivf_definitive_, linear_unit_, *optional_) click to toggle source

Create an Ellipsoid given a name, semi-major and semi-minor axes, the inverse flattening, a boolean indicating whether the inverse flattening is definitive, and the LinearUnit indicating the axis units. The LinearUnit is optional and may be set to nil. You may also provide the optional parameters specified by the Info interface.

# File lib/rgeo/coord_sys/cs/entities.rb, line 783
def create(name_, semi_major_axis_, semi_minor_axis_, inverse_flattening_, ivf_definitive_, linear_unit_, *optional_)
  new(name_, semi_major_axis_, semi_minor_axis_, inverse_flattening_, ivf_definitive_, linear_unit_, *optional_)
end
create_ellipsoid(name_, semi_major_axis_, semi_minor_axis_, linear_unit_, *optional_) click to toggle source

Create an Ellipsoid given a name, semi-major and semi-minor axes, and the LinearUnit indicating the axis units. In the resulting ellipsoid, the inverse flattening is not definitive. The LinearUnit is optional and may be set to nil. You may also provide the optional parameters specified by the Info interface.

# File lib/rgeo/coord_sys/cs/entities.rb, line 794
def create_ellipsoid(name_, semi_major_axis_, semi_minor_axis_, linear_unit_, *optional_)
  semi_major_axis_ = semi_major_axis_.to_f
  semi_minor_axis_ = semi_minor_axis_.to_f
  inverse_flattening_ = semi_major_axis_ / (semi_major_axis_ - semi_minor_axis_)
  inverse_flattening_ = 0.0 if inverse_flattening_.infinite?
  new(name_, semi_major_axis_, semi_minor_axis_, inverse_flattening_, false, linear_unit_, *optional_)
end
create_flattened_sphere(name_, semi_major_axis_, inverse_flattening_, linear_unit_, *optional_) click to toggle source

Create an Ellipsoid given a name, semi-major axis, inverse flattening, and the LinearUnit indicating the axis units. In the resulting ellipsoid, the inverse flattening is definitive. The LinearUnit is optional and may be set to nil. You may also provide the optional parameters specified by the Info interface.

# File lib/rgeo/coord_sys/cs/entities.rb, line 809
def create_flattened_sphere(name_, semi_major_axis_, inverse_flattening_, linear_unit_, *optional_)
  semi_major_axis_ = semi_major_axis_.to_f
  inverse_flattening_ = inverse_flattening_.to_f
  semi_minor_axis_ = semi_major_axis_ - semi_major_axis_ / inverse_flattening_
  semi_minor_axis_ = semi_major_axis_ if semi_minor_axis_.infinite?
  new(name_, semi_major_axis_, semi_minor_axis_, inverse_flattening_, true, linear_unit_, *optional_)
end