digiKam
|
Public Member Functions | |
double | azimuth () |
bool | checkOrthodromicDistance () |
bool | computeDestinationPoint () |
bool | computeDirection () |
QPointF | destinationGeographicPoint () |
bool | destinationGeographicPoint (double *longitude, double *latitude) |
Ellipsoid | ellipsoid () const |
GeodeticCalculator (const Ellipsoid &e=Ellipsoid::WGS84()) | |
double | meridianArcLength (double latitude1, double latitude2) |
double | meridianArcLengthRadians (double P1, double P2) |
double | orthodromicDistance () |
void | setDestinationGeographicPoint (double longitude, double latitude) |
void | setDirection (double azimuth, double distance) |
void | setStartingGeographicPoint (double longitude, double latitude) |
Protected Member Functions | |
double | castToAngleRange (const double alpha) |
bool | checkAzimuth (double *azimuth) |
bool | checkLatitude (double *latitude) |
bool | checkLongitude (double *longitude) |
bool | checkOrthodromicDistance (const double distance) |
Protected Attributes | |
double | A |
double | a01 |
double | a02 |
double | a03 |
double | a21 |
double | a22 |
double | a23 |
double | a42 |
double | a43 |
double | a63 |
double | B |
double | C |
double | D |
double | E |
double | F |
double | f |
double | f2 |
double | f3 |
double | f4 |
double | fo |
double | m_azimuth |
bool | m_destinationValid |
bool | m_directionValid |
double | m_distance |
double | m_eccentricitySquared |
Ellipsoid | m_ellipsoid |
double | m_lat1 |
double | m_lat2 |
double | m_long1 |
double | m_long2 |
double | m_maxOrthodromicDistance |
double | m_semiMajorAxis |
double | m_semiMinorAxis |
double | T1 |
double | T2 |
double | T4 |
double | T6 |
double | TOLERANCE_0 |
double | TOLERANCE_1 |
double | TOLERANCE_2 |
double | TOLERANCE_3 |
double | TOLERANCE_CHECK |
|
explicit |
Performs geodetic calculations on an ellipsoid. This class encapsulates a generic ellipsoid and calculates the following properties:
Distance and azimuth between two points. Point located at a given distance and azimuth from an other point.
The calculation use the following information:
The starting position (setStartingPosition), which is always considered valid. It is initially set at (0,0) and can only be changed to another legitimate value. Only one of the following:
The destination position (setDestinationPosition), or An azimuth and distance (setDirection). The latest one set overrides the other and determines what will be calculated.
References A, a01, a02, a03, a21, a22, a23, a42, a43, a63, B, C, D, E, F, f, f2, f3, f4, fo, m_eccentricitySquared, m_ellipsoid, m_maxOrthodromicDistance, m_semiMajorAxis, m_semiMinorAxis, Digikam::Ellipsoid::semiMajorAxis(), Digikam::Ellipsoid::semiMinorAxis(), T1, T2, T4, T6, TOLERANCE_0, TOLERANCE_1, TOLERANCE_2, TOLERANCE_3, and TOLERANCE_CHECK.
double Digikam::GeodeticCalculator::azimuth | ( | ) |
Returns the azimuth. This method returns the value set by the last call to setDirection(double,double) setDirection(azimuth,distance)
, except if setDestinationGeographicPoint(double,double) setDestinationGeographicPoint(...)
has been invoked after. In this later case, the azimuth will be computed from the startingGeographicPoint starting point to the destination point.
References computeDirection(), m_azimuth, m_directionValid, and Digikam::Coordinates::toDegrees().
Referenced by checkAzimuth(), computeDestinationPoint(), and setDirection().
|
protected |
Referenced by computeDestinationPoint(), and computeDirection().
|
protected |
Checks the azimuth validity. The argument azimuth
should be greater or equal than -180 degrees and lower or equals than +180 degrees. As a convenience, this method converts the azimuth to radians.
azimuth | The azimuth value in decimal degrees. |
References azimuth(), and Digikam::Coordinates::toRadians().
Referenced by setDirection().
|
protected |
Checks the latitude validity. The argument latitude
should be greater or equal than -90 degrees and lower or equals than +90 degrees. As a convenience, this method converts the latitude to radians.
latitude | The latitude value in decimal degrees. |
References Digikam::Coordinates::toRadians().
Referenced by meridianArcLength(), setDestinationGeographicPoint(), and setStartingGeographicPoint().
|
protected |
Checks the longitude validity. The argument longitude
should be greater or equal than -180 degrees and lower or equals than +180 degrees. As a convenience, this method converts the longitude to radians.
longitude | The longitude value in decimal degrees. |
References Digikam::Coordinates::toRadians().
Referenced by setDestinationGeographicPoint(), and setStartingGeographicPoint().
bool Digikam::GeodeticCalculator::checkOrthodromicDistance | ( | ) |
Computes the orthodromic distance using the algorithm implemented in the Geotools's ellipsoid class (if available), and check if the error is smaller than some tolerance error.
References m_distance, m_ellipsoid, m_lat1, m_lat2, m_long1, m_long2, Digikam::Ellipsoid::orthodromicDistance(), Digikam::Coordinates::toDegrees(), and TOLERANCE_CHECK.
Referenced by orthodromicDistance(), and setDirection().
|
protected |
Checks the orthodromic distance validity. Arguments orthodromicDistance
should be greater or equal than 0 and lower or equals than the maximum orthodromic distance.
distance | The orthodromic distance value. |
References m_maxOrthodromicDistance.
bool Digikam::GeodeticCalculator::computeDestinationPoint | ( | ) |
Computes the destination point from the starting point, the azimuth and the orthodromic distance.
References azimuth(), C, castToAngleRange(), D, E, f, fo, m_azimuth, m_destinationValid, m_directionValid, m_distance, m_lat1, m_lat2, m_long1, m_long2, m_semiMajorAxis, TOLERANCE_1, and X.
Referenced by destinationGeographicPoint().
bool Digikam::GeodeticCalculator::computeDirection | ( | ) |
Computes the azimuth and orthodromic distance from the startingGeographicPoint starting point and the destinationGeographicPoint destination point.
Computes the azimuth and orthodromic distance from the startingGeographicPoint() and the destinationGeographicPoint().
References a01, a02, a03, a21, a22, a23, a42, a43, a63, castToAngleRange(), f, fo, m_azimuth, m_destinationValid, m_directionValid, m_distance, m_eccentricitySquared, m_lat1, m_lat2, m_long1, m_long2, m_semiMajorAxis, m_semiMinorAxis, meridianArcLengthRadians(), T1, T2, T4, T6, TOLERANCE_0, TOLERANCE_1, TOLERANCE_2, and TOLERANCE_3.
Referenced by azimuth(), and orthodromicDistance().
QPointF Digikam::GeodeticCalculator::destinationGeographicPoint | ( | ) |
bool Digikam::GeodeticCalculator::destinationGeographicPoint | ( | double * | longitude, |
double * | latitude | ||
) |
Returns the destination point. This method returns the point set by the last call to a setDestinationGeographicPoint(...) method, except if setDirection(...) has been invoked after. In this later case, the destination point will be computed from the starting point to the azimuth and distance specified. Coordinates positive North and East.
References computeDestinationPoint(), m_destinationValid, m_lat2, m_long2, and Digikam::Coordinates::toDegrees().
Referenced by Digikam::FieldQueryBuilder::addPosition().
Ellipsoid Digikam::GeodeticCalculator::ellipsoid | ( | ) | const |
Returns the referenced ellipsoid.
References m_ellipsoid.
Referenced by Digikam::FieldQueryBuilder::addPosition().
double Digikam::GeodeticCalculator::meridianArcLength | ( | double | latitude1, |
double | latitude2 | ||
) |
Calculates the meridian arc length between two points in the same meridian in the referenced ellipsoid.
latitude1 | The latitude of the first point (in decimal degrees). |
latitude2 | The latitude of the second point (in decimal degrees). |
References checkLatitude(), and meridianArcLengthRadians().
double Digikam::GeodeticCalculator::meridianArcLengthRadians | ( | double | P1, |
double | P2 | ||
) |
Calculates the meridian arc length between two points in the same meridian in the referenced ellipsoid.
P1 | The latitude of the first point (in radians). |
P2 | The latitude of the second point (in radians). |
References A, B, C, D, E, F, m_eccentricitySquared, m_semiMajorAxis, and TOLERANCE_0.
Referenced by computeDirection(), and meridianArcLength().
double Digikam::GeodeticCalculator::orthodromicDistance | ( | ) |
Returns the orthodromic distance. This method returns the value set by the last call to setDirection(double,double) setDirection(azimuth,distance)
, except if setDestinationGeographicPoint(double,double) setDestinationGeographicPoint(...)
has been invoked after. In this later case, the distance will be computed from the startingGeographicPoint starting point to the destination point.
References checkOrthodromicDistance(), computeDirection(), m_directionValid, and m_distance.
void Digikam::GeodeticCalculator::setDestinationGeographicPoint | ( | double | longitude, |
double | latitude | ||
) |
Set the destination point in geographic coordinates. The azimuth and distance values will be updated as a side effect of this call. They will be recomputed the next time getAzimuth() or getOrthodromicDistance() are invoked. Coordinates positive North and East.
longitude | The longitude in decimal degrees between -180 and +180° |
latitude | The latitude in decimal degrees between -90 and +90° |
References checkLatitude(), checkLongitude(), m_destinationValid, m_directionValid, m_lat2, and m_long2.
void Digikam::GeodeticCalculator::setDirection | ( | double | azimuth, |
double | distance | ||
) |
Set the azimuth and the distance from the startingGeographicPoint starting point. The destination point will be updated as a side effect of this call. It will be recomputed the next time destinationGeographicPoint() is invoked. Azimuth 0° North.
azimuth | The azimuth in decimal degrees from -180° to 180°. |
distance | The orthodromic distance in the same units as the ellipsoid axis. |
References azimuth(), checkAzimuth(), checkOrthodromicDistance(), m_azimuth, m_destinationValid, m_directionValid, and m_distance.
Referenced by Digikam::FieldQueryBuilder::addPosition().
void Digikam::GeodeticCalculator::setStartingGeographicPoint | ( | double | longitude, |
double | latitude | ||
) |
Set the starting point in geographic coordinates. The azimuth, the orthodromic distance and the destination point are discarded. They will need to be specified again. Coordinates positive North and East.
longitude | The longitude in decimal degrees between -180 and +180° |
latitude | The latitude in decimal degrees between -90 and +90° |
References checkLatitude(), checkLongitude(), m_destinationValid, m_directionValid, m_lat1, and m_long1.
Referenced by Digikam::FieldQueryBuilder::addPosition().
|
protected |
GPNARC parameters computed from the ellipsoid.
Referenced by GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
Parameters computed from the ellipsoid.
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
Referenced by computeDestinationPoint(), GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
Referenced by computeDestinationPoint(), GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
Referenced by computeDestinationPoint(), GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
Referenced by GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
Referenced by computeDestinationPoint(), computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by GeodeticCalculator().
|
protected |
Referenced by GeodeticCalculator().
|
protected |
Referenced by GeodeticCalculator().
|
protected |
GPNHRI parameters computed from the ellipsoid.
f
if the flattening of the referenced ellipsoid. f2
, f3
and f4
are f2, f3 and f4 respectively.
Referenced by computeDestinationPoint(), computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by azimuth(), computeDestinationPoint(), computeDirection(), and setDirection().
|
protected |
Tell if the destination point is valid. false
if long2 and lat2 need to be computed.
Referenced by computeDestinationPoint(), computeDirection(), destinationGeographicPoint(), setDestinationGeographicPoint(), setDirection(), and setStartingGeographicPoint().
|
protected |
Tell if the azimuth and the distance are valids. false
if distance and azimuth need to be computed.
Referenced by azimuth(), computeDestinationPoint(), computeDirection(), orthodromicDistance(), setDestinationGeographicPoint(), setDirection(), and setStartingGeographicPoint().
|
protected |
The distance and azimuth (in radians) from the starting point (long1, lat1) to the destination point (long2, lat2).
Referenced by checkOrthodromicDistance(), computeDestinationPoint(), computeDirection(), orthodromicDistance(), and setDirection().
|
protected |
The eccentricity squared of the referenced ellipsoid.
Referenced by computeDirection(), GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
The encapsulated ellipsoid.
Referenced by checkOrthodromicDistance(), ellipsoid(), and GeodeticCalculator().
|
protected |
The (latitude, longitude) coordinate of the first point in radians. This point is set by setStartingGeographicPoint.
Referenced by checkOrthodromicDistance(), computeDestinationPoint(), computeDirection(), and setStartingGeographicPoint().
|
protected |
The (latitude, longitude) coordinate of the destination point in radians. This point is set by setDestinationGeographicPoint.
Referenced by checkOrthodromicDistance(), computeDestinationPoint(), computeDirection(), destinationGeographicPoint(), and setDestinationGeographicPoint().
|
protected |
Referenced by checkOrthodromicDistance(), computeDestinationPoint(), computeDirection(), and setStartingGeographicPoint().
|
protected |
|
protected |
The maximum orthodromic distance that could be calculated onto the referenced ellipsoid.
Referenced by checkOrthodromicDistance(), and GeodeticCalculator().
|
protected |
The semi major axis of the referenced ellipsoid.
Referenced by computeDestinationPoint(), computeDirection(), GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
The semi minor axis of the referenced ellipsoid.
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Parameters computed from the ellipsoid.
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Tolerance factors from the strictest (TOLERANCE_0
) to the most relax one (TOLERANCE_3
).
Referenced by computeDirection(), GeodeticCalculator(), and meridianArcLengthRadians().
|
protected |
Referenced by computeDestinationPoint(), computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Referenced by computeDirection(), and GeodeticCalculator().
|
protected |
Tolerance factor for assertions. It has no impact on computed values.
Referenced by checkOrthodromicDistance(), and GeodeticCalculator().