12#include <QtCore/QDebug>
13#include <QtCore/QHashFunctions>
14#include <QtCore/QMetaType>
15#include <QtCore/QPointF>
16#include <QtPositioning/QGeoCoordinate>
45 return ::qHashMulti(seed, key.
x, key.
y, key.
zoom);
49QDebug
operator<<(QDebug debug,
const TileKey& key);
64QPointF
geoToWorld(
const QGeoCoordinate& coord);
67QGeoCoordinate
worldToGeo(
const QPointF& world);
constexpr double kMaxLatitude
Mercator latitude clamp (deg)
size_t qHash(const TileKey &key, size_t seed=0)
constexpr int kTilePixels
Nominal tile edge used for meters-per-pixel.
double worldSize()
Full mercator world extent (2*pi*R) in world meters.
constexpr double kEarthRadius
WGS84 equatorial radius (m)
QPointF geoToWorld(const QGeoCoordinate &coord)
Geo -> world meters. Latitude is clamped to +/-kMaxLatitude.
QPointF tileMinCorner(const TileKey &key)
South-west (minimum x/y) corner of a tile in world meters.
bool isValidKey(const TileKey &key)
True if zoom is within [kMinZoom, kMaxZoom] and x/y address a tile at that zoom.
QDebug operator<<(QDebug debug, const TileKey &key)
Streams as slippy "zoom/x/y" notation for logging.
int zoomForMetersPerPixel(double metersPerPixel)
Smallest zoom whose resolution is at least as fine as metersPerPixel (clamped to valid range)
double mercatorScale(double latitude)
double metersPerPixelAtZoom(int zoom)
World meters spanned by one pixel of a kTilePixels tile at zoom (equator)
QGeoCoordinate worldToGeo(const QPointF &world)
World meters -> geo (altitude 0)
double tileSpanAtZoom(int zoom)
Edge length of one tile at zoom, in world meters.
TileKey tileForWorld(const QPointF &world, int zoom)
Tile containing a world point. World coordinates are clamped to the world extent.
Q_DECLARE_METATYPE(satellite_info_s)
bool operator==(const TileKey &other) const