QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TileMath.cc File Reference
#include "TileMath.h"
#include <QtCore/QDebug>
#include <QtCore/QtMath>
#include <algorithm>
#include <cmath>
Include dependency graph for TileMath.cc:

Go to the source code of this file.

Namespaces

namespace  TileMath

Functions

QDebug TileMath::operator<< (QDebug debug, const TileKey &key)
 Streams as slippy "zoom/x/y" notation for logging.
double TileMath::worldSize ()
 Full mercator world extent (2*pi*R) in world meters.
QPointF TileMath::geoToWorld (const QGeoCoordinate &coord)
 Geo -> world meters. Latitude is clamped to +/-kMaxLatitude.
QGeoCoordinate TileMath::worldToGeo (const QPointF &world)
 World meters -> geo (altitude 0).
double TileMath::mercatorScale (double latitude)
bool TileMath::isValidKey (const TileKey &key)
 True if zoom is within [kMinZoom, kMaxZoom] and x/y address a tile at that zoom.
double TileMath::tileSpanAtZoom (int zoom)
 Edge length of one tile at zoom, in world meters.
QPointF TileMath::tileMinCorner (const TileKey &key)
 South-west (minimum x/y) corner of a tile in world meters.
TileKey TileMath::tileForWorld (const QPointF &world, int zoom)
 Tile containing a world point. World coordinates are clamped to the world extent.
double TileMath::metersPerPixelAtZoom (int zoom)
 World meters spanned by one pixel of a kTilePixels tile at zoom (equator).
int TileMath::zoomForMetersPerPixel (double metersPerPixel)
 Smallest zoom whose resolution is at least as fine as metersPerPixel (clamped to valid range).