PROJ C++ API
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
osgeo::proj::datum::Ellipsoid Class Referencefinal

A geometric figure that can be used to describe the approximate shape of an object. More...

#include <datum.hpp>

Inheritance diagram for osgeo::proj::datum::Ellipsoid:
Inheritance graph
[legend]
Collaboration diagram for osgeo::proj::datum::Ellipsoid:
Collaboration graph
[legend]

Public Member Functions

const common::LengthsemiMajorAxis () PROJ_CONST_DECL
 Return the length of the semi-major axis of the ellipsoid. More...
 
const util::optional< common::Scale > & inverseFlattening () PROJ_CONST_DECL
 Return the inverse flattening value of the ellipsoid, if the ellipsoid has been defined with this value. More...
 
const util::optional< common::Length > & semiMinorAxis () PROJ_CONST_DECL
 Return the length of the semi-minor axis of the ellipsoid, if the ellipsoid has been defined with this value. More...
 
bool isSphere () PROJ_CONST_DECL
 Return whether the ellipsoid is spherical. More...
 
const util::optional< common::Length > & semiMedianAxis () PROJ_CONST_DECL
 Return the length of the semi-median axis of a triaxial ellipsoid. More...
 
common::Scale computeInverseFlattening () const
 Return or compute the inverse flattening value of the ellipsoid. More...
 
common::Length computeSemiMinorAxis () const
 Return or compute the length of the semi-minor axis of the ellipsoid. More...
 
const std::string & celestialBody () PROJ_CONST_DECL
 Return the name of the celestial body on which the ellipsoid refers to.
 
EllipsoidNNPtr identify () const
 Return a Ellipsoid object where some parameters are better identified. More...
 
bool isEquivalentTo (const util::IComparable *other, util::IComparable::Criterion criterion=util::IComparable::Criterion::STRICT) const override
 Returns whether an object is equivalent to another one. More...
 
- Public Member Functions inherited from osgeo::proj::common::IdentifiedObject
const metadata::IdentifierNNPtrname () PROJ_CONST_DECL
 Return the name of the object. More...
 
const std::string & nameStr () PROJ_CONST_DECL
 Return the name of the object. More...
 
const std::vector< metadata::IdentifierNNPtr > & identifiers () PROJ_CONST_DECL
 Return the identifier(s) of the object. More...
 
const std::vector< util::GenericNameNNPtr > & aliases () PROJ_CONST_DECL
 Return the alias(es) of the object.
 
const std::string & remarks () PROJ_CONST_DECL
 Return the remarks.
 
bool isDeprecated () PROJ_CONST_DECL
 Return whether the object is deprecated. More...
 
std::string alias () PROJ_CONST_DECL
 Return the (first) alias of the object as a string. More...
 
int getEPSGCode () PROJ_CONST_DECL
 Return the EPSG code. More...
 
bool isEPSG (int code) PROJ_CONST_DECL
 Return whether the object has a identifiers() in the EPSG code space.
 
- Public Member Functions inherited from osgeo::proj::io::IWKTExportable
std::string exportToWKT (WKTFormatter *formatter) const
 
- Public Member Functions inherited from osgeo::proj::io::IPROJStringExportable
std::string exportToPROJString (PROJStringFormatter *formatter) const
 Builds a PROJ string representation. More...
 

Static Public Member Functions

static EllipsoidNNPtr createSphere (const util::PropertyMap &properties, const common::Length &radius, const std::string &celestialBody=EARTH)
 Instanciate a Ellipsoid as a sphere. More...
 
static EllipsoidNNPtr createFlattenedSphere (const util::PropertyMap &properties, const common::Length &semiMajorAxisIn, const common::Scale &invFlattening, const std::string &celestialBody=EARTH)
 Instanciate a Ellipsoid from its inverse/reverse flattening. More...
 
static EllipsoidNNPtr createTwoAxis (const util::PropertyMap &properties, const common::Length &semiMajorAxisIn, const common::Length &semiMinorAxisIn, const std::string &celestialBody=EARTH)
 Instanciate a Ellipsoid from the value of its two semi axis. More...
 
- Static Public Member Functions inherited from osgeo::proj::common::IdentifiedObject
static IdentifiedObjectNNPtr create (const util::PropertyMap &properties)
 Instanciate a new IdentifiedObject. More...
 

Static Public Attributes

static const std::string EARTH
 Earth celestial body.
 
static const EllipsoidNNPtr CLARKE_1866
 The EPSG:7008 / "Clarke 1866" Ellipsoid.
 
static const EllipsoidNNPtr WGS84
 The EPSG:7030 / "WGS 84" Ellipsoid.
 
static const EllipsoidNNPtr GRS1980
 The EPSG:7019 / "GRS 1980" Ellipsoid.
 
- Static Public Attributes inherited from osgeo::proj::common::IdentifiedObject
static const std::string NAME_KEY
 Key to set the name of a common::IdentifiedObject. More...
 
static const std::string IDENTIFIERS_KEY
 Key to set the identifier(s) of a common::IdentifiedObject. More...
 
static const std::string ALIAS_KEY
 Key to set the alias(es) of a common::IdentifiedObject. More...
 
static const std::string REMARKS_KEY
 Key to set the remarks of a common::IdentifiedObject. More...
 
static const std::string DEPRECATED_KEY
 Key to set the deprecation flag of a common::IdentifiedObject. More...
 

Additional Inherited Members

- Public Types inherited from osgeo::proj::util::IComparable
enum  Criterion { Criterion::STRICT, Criterion::EQUIVALENT }
 Comparison criterion. More...
 

Detailed Description

A geometric figure that can be used to describe the approximate shape of an object.

For the Earth an oblate biaxial ellipsoid is used: in mathematical terms, it is a surface formed by the rotation of an ellipse about its minor axis.

Remarks
Implements Ellipsoid from ISO 19111:2018

Member Function Documentation

common::Scale osgeo::proj::datum::Ellipsoid::computeInverseFlattening ( ) const

Return or compute the inverse flattening value of the ellipsoid.

If computed, the inverse flattening is the result of a / (a - b), where a is the semi-major axis and b the semi-minor axis.

Returns
the inverse flattening value of the ellipsoid, or 0 for a sphere.
common::Length osgeo::proj::datum::Ellipsoid::computeSemiMinorAxis ( ) const

Return or compute the length of the semi-minor axis of the ellipsoid.

If computed, the semi-minor axis is the result of a * (1 - 1 / rf) where a is the semi-major axis and rf the reverse/inverse flattening.

Returns
the semi-minor axis of the ellipsoid.
EllipsoidNNPtr osgeo::proj::datum::Ellipsoid::createFlattenedSphere ( const util::PropertyMap properties,
const common::Length semiMajorAxisIn,
const common::Scale invFlattening,
const std::string &  celestialBody = EARTH 
)
static

Instanciate a Ellipsoid from its inverse/reverse flattening.

Parameters
propertiesSee General properties. At minimum the name should be defined.
semiMajorAxisInthe semi-major axis.
invFlatteningthe inverse/reverse flattening.
celestialBodyName of the celestial body on which the ellipsoid refers to.
Returns
new Ellipsoid.
EllipsoidNNPtr osgeo::proj::datum::Ellipsoid::createSphere ( const util::PropertyMap properties,
const common::Length radius,
const std::string &  celestialBody = EARTH 
)
static

Instanciate a Ellipsoid as a sphere.

Parameters
propertiesSee General properties. At minimum the name should be defined.
radiusthe sphere radius (semi-major axis).
celestialBodyName of the celestial body on which the ellipsoid refers to.
Returns
new Ellipsoid.
EllipsoidNNPtr osgeo::proj::datum::Ellipsoid::createTwoAxis ( const util::PropertyMap properties,
const common::Length semiMajorAxisIn,
const common::Length semiMinorAxisIn,
const std::string &  celestialBody = EARTH 
)
static

Instanciate a Ellipsoid from the value of its two semi axis.

Parameters
propertiesSee General properties. At minimum the name should be defined.
semiMajorAxisInthe semi-major axis.
semiMinorAxisInthe semi-minor axis.
celestialBodyName of the celestial body on which the ellipsoid refers to.
Returns
new Ellipsoid.
EllipsoidNNPtr osgeo::proj::datum::Ellipsoid::identify ( ) const

Return a Ellipsoid object where some parameters are better identified.

Returns
a new Ellipsoid.
const util::optional< common::Scale > & osgeo::proj::datum::Ellipsoid::inverseFlattening ( )

Return the inverse flattening value of the ellipsoid, if the ellipsoid has been defined with this value.

See also
computeInverseFlattening() that will always return a valid value of the inverse flattening, whether the ellipsoid has been defined through inverse flattening or semi-minor axis.
Returns
the inverse flattening value of the ellipsoid, or empty.
bool osgeo::proj::datum::Ellipsoid::isEquivalentTo ( const util::IComparable other,
util::IComparable::Criterion  criterion = util::IComparable::Criterion::STRICT 
) const
overridevirtual

Returns whether an object is equivalent to another one.

Parameters
otherother object to compare to
criterioncomparaison criterion.
Returns
true if objects are equivalent.

Implements osgeo::proj::util::IComparable.

bool osgeo::proj::datum::Ellipsoid::isSphere ( )

Return whether the ellipsoid is spherical.

That is to say is semiMajorAxis() == computeSemiMinorAxis().

A sphere is completely defined by the semi-major axis, which is the radius of the sphere.

Returns
true if the ellipsoid is spherical.
const common::Length & osgeo::proj::datum::Ellipsoid::semiMajorAxis ( )

Return the length of the semi-major axis of the ellipsoid.

Returns
the semi-major axis.
const util::optional< common::Length > & osgeo::proj::datum::Ellipsoid::semiMedianAxis ( )

Return the length of the semi-median axis of a triaxial ellipsoid.

This parameter is not required for a biaxial ellipsoid.

Returns
the semi-median axis of the ellipsoid, or empty.
const util::optional< common::Length > & osgeo::proj::datum::Ellipsoid::semiMinorAxis ( )

Return the length of the semi-minor axis of the ellipsoid, if the ellipsoid has been defined with this value.

See also
computeSemiMinorAxis() that will always return a valid value of the inverse flattening, whether the ellipsoid has been defined through inverse flattening or semi-minor axis.
Returns
the semi-minor axis of the ellipsoid, or empty.

The documentation for this class was generated from the following files: