swift
Loading...
Searching...
No Matches
swift::misc::geo::CCoordinateGeodetic Class Reference

Geodetic coordinate. More...

#include <coordinategeodetic.h>

Inheritance diagram for swift::misc::geo::CCoordinateGeodetic:
[legend]

Public Member Functions

 CCoordinateGeodetic ()=default
 Default constructor (null coordinate).
 CCoordinateGeodetic (const QVector3D &normal)
 Constructor by normal vector.
 CCoordinateGeodetic (const std::array< double, 3 > &normalVector)
 Constructor by normal vector.
 CCoordinateGeodetic (const CLatitude &latitude, const CLongitude &longitude)
 Constructor by latitude/longitude, height is null.
 CCoordinateGeodetic (const CLatitude &latitude, const CLongitude &longitude, const aviation::CAltitude &geodeticHeight)
 Constructor by latitude/longitude/height (or altitude).
 CCoordinateGeodetic (double latitudeDegrees, double longitudeDegrees)
 Constructor by double values, but no geodetic height.
 CCoordinateGeodetic (double latitudeDegrees, double longitudeDegrees, double heightFeet)
 Constructor by values.
 CCoordinateGeodetic (const ICoordinateGeodetic &coordinate)
 Constructor by interface.
CCoordinateGeodetic calculatePosition (const physical_quantities::CLength &distance, const physical_quantities::CAngle &relBearing) const
 Calculate a position in distance/bearing.
CLatitude latitude () const
 Latitude.
CLongitude longitude () const
 Longitude.
const aviation::CAltitude & geodeticHeight () const
 Height, ellipsoidal or geodetic height (used in GPS).
QVector3D normalVector () const
 Normal vector.
std::array< double, 3 > normalVectorDouble () const
 Normal vector with double precision.
QVariant propertyByIndex (CPropertyIndexRef index) const
 Property by index.
void setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant)
 Set property by index.
int comparePropertyByIndex (CPropertyIndexRef index, const CCoordinateGeodetic &compareValue) const
 Set property by index.
CCoordinateGeodetic & switchUnit (const physical_quantities::CLengthUnit &unit)
 Switch unit of height.
void setLatitude (const CLatitude &latitude)
 Set latitude.
void setLatitudeFromWgs84 (const QString &wgs)
 Set latitude.
void setLongitude (const CLongitude &longitude)
 Set longitude.
void setLongitudeFromWgs84 (const QString &wgs)
 Set longitude.
void setLatLong (const CLatitude &latitude, const CLongitude &longitude)
 Set latitude and longitude.
void setLatLongFromWgs84 (const QString &latitude, const QString &longitude)
 Set latitude and longitude.
void setGeodeticHeight (const aviation::CAltitude &height)
 Set height (ellipsoidal or geodetic height).
void setGeodeticHeightToNull ()
 Set height to NULL.
void setNormalVector (const QVector3D &normal)
 Set normal vector.
void setNormalVector (double x, double y, double z)
 Set normal vector.
void setNormalVector (const std::array< double, 3 > &normalVector)
 Set normal vector.
int clampVector ()
 Clamp vector values if out [-1, 1].
void setNull ()
 Set to null.
bool isNull () const
 Is null?
QString convertToQString (bool i18n=false) const
 Cast as QString.
Public Member Functions inherited from swift::misc::mixin::MetaType< CCoordinateGeodetic >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object.
QString getClassName () const
 Class name.
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< CCoordinateGeodetic >
void marshallToDbus (QDBusArgument &arg, Tags...) const
 Marshall without begin/endStructure, for when composed within another object.
void unmarshallFromDbus (const QDBusArgument &arg, Tags...)
 Unmarshall without begin/endStructure, for when composed within another object.
Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< CCoordinateGeodetic >
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CCoordinateGeodetic >
QJsonObject toJson () const
 Cast to JSON object.
QString toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const
 Convenience function JSON as string.
void convertFromJson (const QJsonObject &json)
 Assign from JSON object.
Public Member Functions inherited from swift::misc::mixin::String< CCoordinateGeodetic >
QString toQString (bool i18n=false) const
 Cast as QString.
std::string toStdString (bool i18n=false) const
 To std string.
QString stringForStreaming () const
 String for streaming operators.
Public Member Functions inherited from swift::misc::mixin::Index< CCoordinateGeodetic >
CPropertyIndexList apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false)
 Update by variant map.
void setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant)
 Set property by index.
QVariant propertyByIndex (CPropertyIndexRef index) const
 Property by index.
int comparePropertyByIndex (CPropertyIndexRef index, const CCoordinateGeodetic &compareValue) const
 Compare for index.
bool equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const
 Is given variant equal to value of property index?
Public Member Functions inherited from swift::misc::mixin::Icon< CCoordinateGeodetic >
CIcons::CIcons::StandardIconUnknown16 toIcon () const
 As icon, not implemented by all classes.
Public Member Functions inherited from swift::misc::geo::ICoordinateGeodetic
 ICoordinateGeodetic ()=default
 Ctor.
virtual ~ICoordinateGeodetic ()=default
 Destructor.
 ICoordinateGeodetic (const ICoordinateGeodetic &)=default
 Copy constructor.
ICoordinateGeodetic & operator= (const ICoordinateGeodetic &)=default
 Copy assignment operator.
bool equalNormalVectorDouble (const std::array< double, 3 > &otherVector) const
 Is equal? Epsilon considered.
bool equalNormalVectorDouble (const ICoordinateGeodetic &otherCoordinate) const
 Is equal, epsilon considered?
QString latitudeAsString () const
 Latitude as string.
QString longitudeAsString () const
 Longitude as string.
QString geodeticHeightAsString () const
 Height as string.
bool isGeodeticHeightNull () const
 Geodetic height null?
bool hasMSLGeodeticHeight () const
 Geodetic height not null and aviation::CAltitude::MeanSeaLevel.
physical_quantities::CLength calculateGreatCircleDistance (const ICoordinateGeodetic &otherCoordinate) const
 Great circle distance.
bool isWithinRange (const ICoordinateGeodetic &otherCoordinate, const physical_quantities::CLength &range) const
 Object within range?
physical_quantities::CAngle calculateBearing (const ICoordinateGeodetic &otherCoordinate) const
 Initial bearing.
QVariant propertyByIndex (CPropertyIndexRef index) const
 Property by index.
int comparePropertyByIndex (CPropertyIndexRef index, const ICoordinateGeodetic &compareValue) const
 Compare for index.
QString convertToQString (bool i18n=false) const
 Cast as QString.
bool isNaNVector () const
 Check values.
bool isNaNVectorDouble () const
 Check values.
bool isInfVector () const
 Check values.
bool isInfVectorDouble () const
 Check values.
bool isValidVectorRange () const
 Check values.

Static Public Member Functions

static CCoordinateGeodetic fromWgs84 (const QString &latitudeWgs84, const QString &longitudeWgs84, const aviation::CAltitude &geodeticHeight={})
 Coordinate by WGS84 position data.
static const CCoordinateGeodetic & null ()
 null coordinate
Static Public Member Functions inherited from swift::misc::mixin::MetaType< CCoordinateGeodetic >
static void registerMetadata ()
 Register metadata.
Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CCoordinateGeodetic >
static DerivedObj fromJson (const QJsonObject &json)
 Get object from QJsonObject.
static DerivedObj fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg)
 Get object from JSON string.
static bool isValidVector (const std::array< double, 3 > &v)
 Check values.

Additional Inherited Members

Public Types inherited from swift::misc::CValueObject< CCoordinateGeodetic >
using base_type
 Base class.
Public Types inherited from swift::misc::CEmpty
using base_type = CEmpty
 Base class is alias of itself.
Public Types inherited from swift::misc::mixin::Index< CCoordinateGeodetic >
enum  ColumnIndex
 Base class enums. More...
Public Types inherited from swift::misc::geo::ICoordinateGeodetic
enum  ColumnIndex {
  IndexLatitude = CPropertyIndexRef::GlobalIndexICoordinateGeodetic , IndexLongitude , IndexLatitudeAsString , IndexLongitudeAsString ,
  IndexGeodeticHeight , IndexGeodeticHeightAsString , IndexNormalVector
}
 Properties by index. More...
Protected Member Functions inherited from swift::misc::CValueObject< CCoordinateGeodetic >
 CEmpty ()=default
 Inheriting constructors.
 CEmpty (const CEmpty &)=default
 Inheriting constructors.
 CValueObject ()=default
 Default constructor.
CValueObject & operator= (const CValueObject &)=default
 Copy assignment operator.
 ~CValueObject ()=default
 Destructor.
Protected Member Functions inherited from swift::misc::CEmpty
 CEmpty ()=default
 Protected default constructor.
 CEmpty (const CEmpty &)=default
 Protected copy constructor.
CEmpty & operator= (const CEmpty &)=default
 Protected copy assignment operator.
 ~CEmpty ()=default
 Non-virtual protected destructor.
Static Protected Member Functions inherited from swift::misc::geo::ICoordinateGeodetic
static bool canHandleIndex (CPropertyIndexRef index)
 Can given index be handled?

Detailed Description

Geodetic coordinate.

Definition at line 229 of file coordinategeodetic.h.

Constructor & Destructor Documentation

◆ CCoordinateGeodetic() [1/7]

swift::misc::geo::CCoordinateGeodetic::CCoordinateGeodetic ( const QVector3D & normal)
inline

Constructor by normal vector.

Definition at line 238 of file coordinategeodetic.h.

◆ CCoordinateGeodetic() [2/7]

swift::misc::geo::CCoordinateGeodetic::CCoordinateGeodetic ( const std::array< double, 3 > & normalVector)

Constructor by normal vector.

Definition at line 325 of file coordinategeodetic.cpp.

◆ CCoordinateGeodetic() [3/7]

swift::misc::geo::CCoordinateGeodetic::CCoordinateGeodetic ( const CLatitude & latitude,
const CLongitude & longitude )

Constructor by latitude/longitude, height is null.

Definition at line 330 of file coordinategeodetic.cpp.

◆ CCoordinateGeodetic() [4/7]

swift::misc::geo::CCoordinateGeodetic::CCoordinateGeodetic ( const CLatitude & latitude,
const CLongitude & longitude,
const aviation::CAltitude & geodeticHeight )

Constructor by latitude/longitude/height (or altitude).

Definition at line 336 of file coordinategeodetic.cpp.

◆ CCoordinateGeodetic() [5/7]

swift::misc::geo::CCoordinateGeodetic::CCoordinateGeodetic ( double latitudeDegrees,
double longitudeDegrees )

Constructor by double values, but no geodetic height.

Definition at line 342 of file coordinategeodetic.cpp.

◆ CCoordinateGeodetic() [6/7]

swift::misc::geo::CCoordinateGeodetic::CCoordinateGeodetic ( double latitudeDegrees,
double longitudeDegrees,
double heightFeet )

Constructor by values.

Definition at line 347 of file coordinategeodetic.cpp.

◆ CCoordinateGeodetic() [7/7]

swift::misc::geo::CCoordinateGeodetic::CCoordinateGeodetic ( const ICoordinateGeodetic & coordinate)

Constructor by interface.

Definition at line 352 of file coordinategeodetic.cpp.

Member Function Documentation

◆ calculatePosition()

CCoordinateGeodetic swift::misc::geo::CCoordinateGeodetic::calculatePosition ( const physical_quantities::CLength & distance,
const physical_quantities::CAngle & relBearing ) const

Calculate a position in distance/bearing.

Definition at line 358 of file coordinategeodetic.cpp.

◆ clampVector()

int swift::misc::geo::CCoordinateGeodetic::clampVector ( )

Clamp vector values if out [-1, 1].

Definition at line 250 of file coordinategeodetic.cpp.

◆ comparePropertyByIndex()

int swift::misc::geo::CCoordinateGeodetic::comparePropertyByIndex ( CPropertyIndexRef index,
const CCoordinateGeodetic & compareValue ) const

Set property by index.

Definition at line 317 of file coordinategeodetic.cpp.

◆ convertToQString()

QString swift::misc::geo::CCoordinateGeodetic::convertToQString ( bool i18n = false) const

Cast as QString.

Definition at line 22 of file coordinategeodetic.cpp.

◆ fromWgs84()

CCoordinateGeodetic swift::misc::geo::CCoordinateGeodetic::fromWgs84 ( const QString & latitudeWgs84,
const QString & longitudeWgs84,
const aviation::CAltitude & geodeticHeight = {} )
static

Coordinate by WGS84 position data.

Definition at line 27 of file coordinategeodetic.cpp.

◆ geodeticHeight()

const aviation::CAltitude & swift::misc::geo::CCoordinateGeodetic::geodeticHeight ( ) const
inlinevirtual

Height, ellipsoidal or geodetic height (used in GPS).

This is approximately MSL (orthometric) height, aka altitude, aka elevation. The terms "geodetic height", "altitude", and "elevation" are interchangable. "Geodetic height" is the generic, context-free term for the vertical component of a position. This is commonly called "altitude" for objects that can move freely in the vertical component. By a similar convention, "elevation" is commonly used for objects that are fixed to the ground.

See also
see http://www.gmat.unsw.edu.au/snap/gps/clynch_pdfs/coordcvt.pdf page 5
http://www.esri.com/news/arcuser/0703/geoid1of3.html

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 273 of file coordinategeodetic.h.

◆ isNull()

bool swift::misc::geo::CCoordinateGeodetic::isNull ( ) const
inlinevirtual

Is null?

Reimplemented from swift::misc::geo::ICoordinateGeodetic.

Reimplemented in swift::misc::geo::CElevationPlane.

Definition at line 347 of file coordinategeodetic.h.

◆ latitude()

CLatitude swift::misc::geo::CCoordinateGeodetic::latitude ( ) const
virtual

Latitude.

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 404 of file coordinategeodetic.cpp.

◆ longitude()

CLongitude swift::misc::geo::CCoordinateGeodetic::longitude ( ) const
virtual

Longitude.

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 409 of file coordinategeodetic.cpp.

◆ normalVector()

QVector3D swift::misc::geo::CCoordinateGeodetic::normalVector ( ) const
virtual

Normal vector.

Note
QVector3D uses floats, so don't use if double precision is needed
See also
https://en.wikipedia.org/wiki/N-vector
http://www.movable-type.co.uk/scripts/latlong-vectors.html

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 415 of file coordinategeodetic.cpp.

◆ normalVectorDouble()

std::array< double, 3 > swift::misc::geo::CCoordinateGeodetic::normalVectorDouble ( ) const
virtual

Normal vector with double precision.

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 420 of file coordinategeodetic.cpp.

◆ null()

const CCoordinateGeodetic & swift::misc::geo::CCoordinateGeodetic::null ( )
static

null coordinate

Definition at line 35 of file coordinategeodetic.cpp.

◆ propertyByIndex()

QVariant swift::misc::geo::CCoordinateGeodetic::propertyByIndex ( CPropertyIndexRef index) const

Property by index.

Definition at line 286 of file coordinategeodetic.cpp.

◆ setGeodeticHeight()

void swift::misc::geo::CCoordinateGeodetic::setGeodeticHeight ( const aviation::CAltitude & height)
inline

Set height (ellipsoidal or geodetic height).

Definition at line 312 of file coordinategeodetic.h.

◆ setGeodeticHeightToNull()

void swift::misc::geo::CCoordinateGeodetic::setGeodeticHeightToNull ( )

Set height to NULL.

Definition at line 449 of file coordinategeodetic.cpp.

◆ setLatitude()

void swift::misc::geo::CCoordinateGeodetic::setLatitude ( const CLatitude & latitude)

Set latitude.

Definition at line 422 of file coordinategeodetic.cpp.

◆ setLatitudeFromWgs84()

void swift::misc::geo::CCoordinateGeodetic::setLatitudeFromWgs84 ( const QString & wgs)

Set latitude.

Definition at line 424 of file coordinategeodetic.cpp.

◆ setLatLong()

void swift::misc::geo::CCoordinateGeodetic::setLatLong ( const CLatitude & latitude,
const CLongitude & longitude )

Set latitude and longitude.

Definition at line 436 of file coordinategeodetic.cpp.

◆ setLatLongFromWgs84()

void swift::misc::geo::CCoordinateGeodetic::setLatLongFromWgs84 ( const QString & latitude,
const QString & longitude )

Set latitude and longitude.

Definition at line 443 of file coordinategeodetic.cpp.

◆ setLongitude()

void swift::misc::geo::CCoordinateGeodetic::setLongitude ( const CLongitude & longitude)

Set longitude.

Definition at line 426 of file coordinategeodetic.cpp.

◆ setLongitudeFromWgs84()

void swift::misc::geo::CCoordinateGeodetic::setLongitudeFromWgs84 ( const QString & wgs)

Set longitude.

Definition at line 431 of file coordinategeodetic.cpp.

◆ setNormalVector() [1/3]

void swift::misc::geo::CCoordinateGeodetic::setNormalVector ( const QVector3D & normal)
inline

Set normal vector.

Definition at line 318 of file coordinategeodetic.h.

◆ setNormalVector() [2/3]

void swift::misc::geo::CCoordinateGeodetic::setNormalVector ( const std::array< double, 3 > & normalVector)

Set normal vector.

Definition at line 451 of file coordinategeodetic.cpp.

◆ setNormalVector() [3/3]

void swift::misc::geo::CCoordinateGeodetic::setNormalVector ( double x,
double y,
double z )
inline

Set normal vector.

Definition at line 326 of file coordinategeodetic.h.

◆ setNull()

void swift::misc::geo::CCoordinateGeodetic::setNull ( )
inline

Set to null.

Definition at line 340 of file coordinategeodetic.h.

◆ setPropertyByIndex()

void swift::misc::geo::CCoordinateGeodetic::setPropertyByIndex ( CPropertyIndexRef index,
const QVariant & variant )

Set property by index.

Definition at line 296 of file coordinategeodetic.cpp.

◆ switchUnit()

CCoordinateGeodetic & swift::misc::geo::CCoordinateGeodetic::switchUnit ( const physical_quantities::CLengthUnit & unit)

Switch unit of height.

Definition at line 459 of file coordinategeodetic.cpp.


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