3#ifndef QLOCATIONUTILS_P_H
4#define QLOCATIONUTILS_P_H
17#include <QtCore/QtGlobal>
20#include <QtPositioning/QGeoCoordinate>
21#include <QtPositioning/QNmeaSatelliteInfoSource>
22#include <QtPositioning/private/qpositioningglobal_p.h>
68 return lat >= -90.0 && lat <= 90.0;
71 return lng >= -180.0 && lng <= 180.0;
74 inline static double clipLat(
double lat,
double clipValue = 90.0) {
77 else if (lat < -clipValue)
85 else if (lng < -180.0)
92 azimuth = fmod(azimuth, 360.0);
93 if (azimuth < 45.0 || azimuth > 315.0 )
95 else if (azimuth < 135.0)
97 else if (azimuth < 225.0)
105 azimuth = fmod(azimuth, 360.0);
106 if (azimuth < 22.5 || azimuth > 337.5 )
108 else if (azimuth < 67.5)
110 else if (azimuth < 112.5)
112 else if (azimuth < 157.5)
114 else if (azimuth < 202.5)
117 else if (azimuth < 247.5)
119 else if (azimuth < 292.5)
127 azimuth = fmod(azimuth, 360.0);
128 if (azimuth < 11.5 || azimuth > 348.75 )
130 else if (azimuth < 33.75)
132 else if (azimuth < 56.25)
134 else if (azimuth < 78.75)
136 else if (azimuth < 101.25)
138 else if (azimuth < 123.75)
140 else if (azimuth < 146.25)
142 else if (azimuth < 168.75)
144 else if (azimuth < 191.25)
147 else if (azimuth < 213.75)
149 else if (azimuth < 236.25)
151 else if (azimuth < 258.75)
153 else if (azimuth < 281.25)
155 else if (azimuth < 303.75)
157 else if (azimuth < 326.25)
165 double remainder = fmod(lng + 180.0, 360.0);
166 return fmod(remainder + 360.0, 360.0) - 180.0;
172 return 180.0 - azimuth;
174 return 180.0 + (360.0 - azimuth);
181 return 360.0 - azimuth;
201 return earthMeanRadius() * 2.0 *
M_PI;
217 return wrapLong(centerLongitude +
leftOffset);
223 return wrapLong(centerLongitude -
leftOffset);
228 *hipart = (float)
input;
229 double delta =
input - ((double) *hipart);
230 *lopart = (float) delta;
235 const qreal metersPerTile = earthMeanCircumference() * std::cos(radians(coordinate.
latitude())) / std::pow(2, zoomLevel);
236 return metersPerTile / 256.0;
267 bool *hasFix =
nullptr);
303 static bool getNmeaLatLong(
const QByteArray &latString,
double latitude
This property holds the latitude in decimal degrees.
SatelliteSystem
Defines the GNSS system of the satellite.
static double radians(double degrees)
static bool isValidLong(double lng)
static double mapRightLongitude(double centerLongitude)
static double mirrorAzimuthY(double azimuth)
static bool isValidLat(double lat)
static QGeoCoordinate antipodalPoint(const QGeoCoordinate &p)
static double degrees(double radians)
static double earthMeanRadius()
static double wrapLong(double lng)
static double wrapLongExt(double lng)
static CardinalDirection azimuthToCardinalDirection4(double azimuth)
static double clipLat(double lat, double clipValue=90.0)
static qreal metersPerPixel(qreal zoomLevel, const QGeoCoordinate &coordinate)
static CardinalDirection azimuthToCardinalDirection8(double azimuth)
static CardinalDirection azimuthToCardinalDirection16(double azimuth)
static double mercatorMaxLatitude()
static double mapLeftLongitude(double centerLongitude)
static double mirrorAzimuthX(double azimuth)
static void split_double(double input, float *hipart, float *lopart)
static double earthMeanCircumference()
SatelliteInfoParseStatus
Defines the parse status of satellite information.
\inmodule QtCore \reentrant
Combined button and popup list for selecting options.
static const double leftOffset
static const double offsetEpsilon
static const double rightOffset
constexpr float qRadiansToDegrees(float radians)
constexpr float qDegreesToRadians(float degrees)
GLenum GLenum GLenum input
QFileInfo info(fileName)
[8]