47 m_mercatorX(
other.m_mercatorX),
48 m_mercatorY(
other.m_mercatorY)
288 return t == Coordinate2D ||
t == Coordinate3D;
403 double haversine_dlat = sin(dlat / 2.0);
404 haversine_dlat *= haversine_dlat;
405 double haversine_dlon = sin(dlon / 2.0);
406 haversine_dlon *= haversine_dlon;
407 double y = haversine_dlat
411 double x = 2 * asin(sqrt(
y));
437 double y = sin(dlon) * cos(lat2Rad);
438 double x = cos(lat1Rad) * sin(lat2Rad) - sin(lat1Rad) * cos(lat2Rad) * cos(dlon);
442 double fraction = modf(azimuth, &whole);
443 return qreal((
int(whole + 360) % 360) + fraction);
448 double *lon,
double *lat)
452 double cosLatRad = cos(latRad);
453 double sinLatRad = sin(latRad);
458 double cosRatio = cos(ratio);
459 double sinRatio = sin(ratio);
461 double resultLatRad = asin(sinLatRad * cosRatio
462 + cosLatRad * sinRatio * cos(azimuthRad));
463 double resultLonRad = lonRad + atan2(sin(azimuthRad) * sinRatio * cosLatRad,
464 cosRatio - sinLatRad * sin(resultLatRad));
485 double resultLon, resultLat;
487 &resultLon, &resultLat);
488 double resultAlt = d->
alt + distanceUp;
537 QChar symbol(0x00B0);
548 double latMin = (absLat - int(absLat)) * 60;
549 double lngMin = (absLng - int(absLng)) * 60;
556 if (latMin > 59.9995) {
560 if (lngMin > 59.9995) {
577 double latMin = (absLat - int(absLat)) * 60;
578 double lngMin = (absLng - int(absLng)) * 60;
579 double latSec = (latMin - int(latMin)) * 60;
580 double lngSec = (lngMin - int(lngMin)) * 60;
587 if (latSec >= 59.95) {
593 if (
qRound(latMin) >= 60) {
598 if (lngSec >= 59.95) {
601 if (
qRound(lngMin) >= 60) {
661 if (!
qIsNaN(lhs.d->
lat) && ((lhs.d->
lat == 90.0) || (lhs.d->
lat == -90.0)))
664 return (latEqual && lngEqual && altEqual);
672#ifndef QT_NO_DEBUG_STREAM
676 double lat =
coord.latitude();
677 double lng =
coord.longitude();
681 dbg.nospace() <<
"QGeoCoordinate(";
693 dbg <<
coord.altitude();
700#ifndef QT_NO_DATASTREAM
718#ifndef QT_NO_DATASTREAM
759#include "moc_qgeocoordinate.cpp"
\inmodule QtCore\reentrant
virtual ~QGeoCoordinatePrivate()
static void atDistanceAndAzimuth(const QGeoCoordinate &coord, qreal distance, qreal azimuth, double *lon, double *lat)
double longitude
This property holds the longitude in decimal degrees.
double latitude
This property holds the latitude in decimal degrees.
Q_INVOKABLE QGeoCoordinate atDistanceAndAzimuth(qreal distance, qreal azimuth, qreal distanceUp=0.0) const
Returns the coordinate that is reached by traveling distance meters from the current coordinate at az...
CoordinateFormat
Defines the possible formatting options for toString().
@ DegreesMinutesSecondsWithHemisphere
@ DegreesMinutesWithHemisphere
double altitude
This property holds the altitude in meters above sea level.
Q_INVOKABLE QString toString(CoordinateFormat format=DegreesMinutesSecondsWithHemisphere) const
Returns this coordinate as a string in the specified format.
QGeoCoordinate & operator=(const QGeoCoordinate &other)
Assigns other to this coordinate and returns a reference to this coordinate.
Q_INVOKABLE qreal azimuthTo(const QGeoCoordinate &other) const
Returns the azimuth (or bearing) in degrees from this coordinate to the coordinate specified by other...
void setLatitude(double latitude)
Sets the latitude (in decimal degrees) to latitude.
void setLongitude(double longitude)
Sets the longitude (in decimal degrees) to longitude.
Q_INVOKABLE qreal distanceTo(const QGeoCoordinate &other) const
Returns the distance (in meters) from this coordinate to the coordinate specified by other.
void setAltitude(double altitude)
Sets the altitude (meters above sea level) to altitude.
~QGeoCoordinate()
Destroys the coordinate object.
QGeoCoordinate()
Constructs a coordinate.
bool isValid
This property holds the validity of this geo coordinate.
CoordinateType
Defines the types of a coordinate.
CoordinateType type() const
Returns the type of this coordinate.
~QGeoMercatorCoordinatePrivate()
QGeoMercatorCoordinatePrivate()
static bool isValidLong(double lng)
static bool isValidLat(double lat)
static double wrapLong(double lng)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QString & insert(qsizetype i, QChar c)
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString & append(QChar c)
QHash< int, QWidget * > hash
[35multi]
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qIsNaN(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
static QT_BEGIN_NAMESPACE const double qgeocoordinate_EARTH_MEAN_RADIUS
size_t qHash(const QGeoCoordinate &coordinate, size_t seed)
constexpr float qRadiansToDegrees(float radians)
constexpr float qDegreesToRadians(float degrees)
constexpr T qAbs(const T &t)
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qQNaN()
GLint GLint GLint GLint GLint x
[0]
GLsizei GLsizei GLfloat distance
GLint GLsizei GLsizei GLenum format
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
#define QT_DEFINE_QSDP_SPECIALIZATION_DTOR(Class)
#define QStringLiteral(str)
QTextStreamManipulator qSetRealNumberPrecision(int precision)