digiKam
Digikam::Ellipsoid Class Reference

Public Member Functions

double eccentricity () const
 
double inverseFlattening () const
 
bool isIvfDefinitive () const
 
bool isSphere () const
 
double orthodromicDistance (double x1, double y1, double x2, double y2)
 
double radiusOfCurvature (double latitude)
 
double semiMajorAxis () const
 
double semiMinorAxis () const
 

Static Public Member Functions

static Ellipsoid CLARKE_1866 ()
 
static Ellipsoid createEllipsoid (const QString &name, double semiMajorAxis, double semiMinorAxis)
 
static Ellipsoid createFlattenedSphere (const QString &name, double semiMajorAxis, double inverseFlattening)
 
static Ellipsoid GRS80 ()
 
static Ellipsoid INTERNATIONAL_1924 ()
 
static Ellipsoid SPHERE ()
 
static Ellipsoid WGS84 ()
 

Protected Member Functions

 Ellipsoid (const QString &name, double radius, bool ivfDefinitive)
 
 Ellipsoid (const QString &name, double semiMajorAxis, double semiMinorAxis, double inverseFlattening, bool ivfDefinitive)
 

Protected Attributes

double m_inverseFlattening
 
bool m_isSphere
 
bool m_ivfDefinitive
 
double m_semiMajorAxis
 
double m_semiMinorAxis
 
QString name
 

Detailed Description

Geometric figure that can be used to describe the approximate shape of the earth. In mathematical terms, it is a surface formed by the rotation of an ellipse about its minor axis. An ellipsoid requires two defining parameters:

  • semi-major axis and inverse flattening, or
  • semi-major axis and semi-minor axis.

Constructor & Destructor Documentation

◆ Ellipsoid() [1/2]

Digikam::Ellipsoid::Ellipsoid ( const QString &  name,
double  semiMajorAxis,
double  semiMinorAxis,
double  inverseFlattening,
bool  ivfDefinitive 
)
protected

Constructs a new ellipsoid using the specified axis length. The properties map is given unchanged to the AbstractIdentifiedObjectAbstractIdentifiedObject(Map) super-class constructor.

Parameters
semiMajorAxisThe equatorial radius.
semiMinorAxisThe polar radius.
inverseFlatteningThe inverse of the flattening value.
ivfDefinitivetrue if the inverse flattening is definitive.
See also
createEllipsoid
createFlattenedSphere

Referenced by createEllipsoid(), and createFlattenedSphere().

◆ Ellipsoid() [2/2]

Digikam::Ellipsoid::Ellipsoid ( const QString &  name,
double  radius,
bool  ivfDefinitive 
)
protected

Member Function Documentation

◆ CLARKE_1866()

Ellipsoid Digikam::Ellipsoid::CLARKE_1866 ( )
static

Clarke 1866 ellipsoid with axis in metres.

References createFlattenedSphere().

◆ createEllipsoid()

Ellipsoid Digikam::Ellipsoid::createEllipsoid ( const QString &  name,
double  semiMajorAxis,
double  semiMinorAxis 
)
static

Constructs a new ellipsoid using the specified axis length.

Parameters
nameThe ellipsoid name.
semiMajorAxisThe equatorial radius.
semiMinorAxisThe polar radius.

References Ellipsoid(), m_semiMajorAxis, m_semiMinorAxis, and name.

Referenced by SPHERE().

◆ createFlattenedSphere()

Ellipsoid Digikam::Ellipsoid::createFlattenedSphere ( const QString &  name,
double  semiMajorAxis,
double  inverseFlattening 
)
static

Constructs a new ellipsoid using the specified axis length and inverse flattening value.

Parameters
nameThe ellipsoid name.
semiMajorAxisThe equatorial radius.
inverseFlatteningThe inverse flattening value. values.

References DBL_MAX, Ellipsoid(), m_inverseFlattening, m_semiMajorAxis, and name.

Referenced by CLARKE_1866(), GRS80(), INTERNATIONAL_1924(), and WGS84().

◆ eccentricity()

double Digikam::Ellipsoid::eccentricity ( ) const

The ratio of the distance between the center and a focus of the ellipse to the length of its semimajor axis. The eccentricity can alternately be computed from the equation: e=sqrt(2f-f^2).

References m_isSphere, m_semiMajorAxis, and m_semiMinorAxis.

Referenced by radiusOfCurvature().

◆ GRS80()

Ellipsoid Digikam::Ellipsoid::GRS80 ( )
static

GRS 80 ellipsoid with axis in metres.

References createFlattenedSphere().

◆ INTERNATIONAL_1924()

Ellipsoid Digikam::Ellipsoid::INTERNATIONAL_1924 ( )
static

International 1924 ellipsoid with axis in metres.

References createFlattenedSphere().

◆ inverseFlattening()

double Digikam::Ellipsoid::inverseFlattening ( ) const

Returns the value of the inverse of the flattening constant. Flattening is a value used to indicate how closely an ellipsoid approaches a spherical shape. The inverse flattening is related to the equatorial/polar radius by the formula

ivf=r_e/(r_e-r_p).

For perfect spheres (i.e. if isSphere returns true), the DoublePOSITIVE_INFINITY value is used.

Returns
The inverse flattening value.

References m_inverseFlattening.

◆ isIvfDefinitive()

bool Digikam::Ellipsoid::isIvfDefinitive ( ) const

Indicates if the inverse flattening is 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.

Returns
true if the inverse flattening is definitive, or false if the polar radius is definitive.

References m_ivfDefinitive.

◆ isSphere()

bool Digikam::Ellipsoid::isSphere ( ) const

true if the ellipsoid is degenerate and is actually a sphere. The sphere is completely defined by the semi-major axis, which is the radius of the sphere.

Returns
true if the ellipsoid is degenerate and is actually a sphere.

References m_semiMajorAxis, and m_semiMinorAxis.

◆ orthodromicDistance()

double Digikam::Ellipsoid::orthodromicDistance ( double  x1,
double  y1,
double  x2,
double  y2 
)

Returns the orthodromic distance between two geographic coordinates. The orthodromic distance is the shortest distance between two points on a sphere's surface. The orthodromic path is always on a great circle. This is different from the loxodromic distance, which is a longer distance on a path with a constant direction on the compass.

Parameters
x1Longitude of first point (in decimal degrees).
y1Latitude of first point (in decimal degrees).
x2Longitude of second point (in decimal degrees).
y2Latitude of second point (in decimal degrees).
Returns
The orthodromic distance (in the units of this ellipsoid's axis).

References F, m_inverseFlattening, m_semiMajorAxis, and Digikam::Coordinates::toRadians().

Referenced by Digikam::GeodeticCalculator::checkOrthodromicDistance().

◆ radiusOfCurvature()

double Digikam::Ellipsoid::radiusOfCurvature ( double  latitude)

Returns the Radius Of Curvature for the given latitude, using the geometric mean of two radii of curvature for all azimuths.

Parameters
latitudein degrees

References eccentricity(), m_semiMajorAxis, and Digikam::Coordinates::toRadians().

Referenced by Digikam::FieldQueryBuilder::addPosition().

◆ semiMajorAxis()

double Digikam::Ellipsoid::semiMajorAxis ( ) const

Length of the semi-major axis of the ellipsoid. This is the equatorial radius in axis linear unit.

Returns
Length of semi-major axis.

References m_semiMajorAxis.

Referenced by Digikam::GeodeticCalculator::GeodeticCalculator().

◆ semiMinorAxis()

double Digikam::Ellipsoid::semiMinorAxis ( ) const

Length of the semi-minor axis of the ellipsoid. This is the polar radius in axis linear unit.

Returns
Length of semi-minor axis.

References m_semiMinorAxis.

Referenced by Digikam::GeodeticCalculator::GeodeticCalculator().

◆ SPHERE()

Ellipsoid Digikam::Ellipsoid::SPHERE ( )
static

A sphere with a radius of 6371000 metres. Spheres use a simpler algorithm for orthodromic distance computation, which may be faster and more robust.

References createEllipsoid().

◆ WGS84()

Ellipsoid Digikam::Ellipsoid::WGS84 ( )
static

WGS 1984 ellipsoid with axis in metres. This ellipsoid is used in GPS systems and is the default for most org.geotools packages.

References createFlattenedSphere().

Member Data Documentation

◆ m_inverseFlattening

double Digikam::Ellipsoid::m_inverseFlattening
protected

The inverse of the flattening value, or DBL_MAX if the ellipsoid is a sphere.

See also
getInverseFlattening

Referenced by createFlattenedSphere(), inverseFlattening(), and orthodromicDistance().

◆ m_isSphere

bool Digikam::Ellipsoid::m_isSphere
protected

Referenced by eccentricity().

◆ m_ivfDefinitive

bool Digikam::Ellipsoid::m_ivfDefinitive
protected

Tells if the Inverse Flattening definitive for this ellipsoid.

See also
isIvfDefinitive

Referenced by isIvfDefinitive().

◆ m_semiMajorAxis

double Digikam::Ellipsoid::m_semiMajorAxis
protected

The equatorial radius.

See also
getSemiMajorAxis

Referenced by createEllipsoid(), createFlattenedSphere(), eccentricity(), isSphere(), orthodromicDistance(), radiusOfCurvature(), and semiMajorAxis().

◆ m_semiMinorAxis

double Digikam::Ellipsoid::m_semiMinorAxis
protected

The polar radius.

See also
getSemiMinorAxis

Referenced by createEllipsoid(), eccentricity(), isSphere(), and semiMinorAxis().

◆ name

QString Digikam::Ellipsoid::name
protected

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