|
QGroundControl
Ground Control Station for MAVLink Drones
|
Classes | |
| struct | TileKey |
Functions | |
| QDebug | operator<< (QDebug debug, const TileKey &key) |
| Streams as slippy "zoom/x/y" notation for logging. | |
| double | worldSize () |
| Full mercator world extent (2*pi*R) in world meters. | |
| QPointF | geoToWorld (const QGeoCoordinate &coord) |
| Geo -> world meters. Latitude is clamped to +/-kMaxLatitude. | |
| QGeoCoordinate | worldToGeo (const QPointF &world) |
| World meters -> geo (altitude 0) | |
| double | mercatorScale (double latitude) |
| bool | isValidKey (const TileKey &key) |
| True if zoom is within [kMinZoom, kMaxZoom] and x/y address a tile at that zoom. | |
| double | tileSpanAtZoom (int zoom) |
| Edge length of one tile at zoom, in world meters. | |
| QPointF | tileMinCorner (const TileKey &key) |
| South-west (minimum x/y) corner of a tile in world meters. | |
| TileKey | tileForWorld (const QPointF &world, int zoom) |
| Tile containing a world point. World coordinates are clamped to the world extent. | |
| double | metersPerPixelAtZoom (int zoom) |
| World meters spanned by one pixel of a kTilePixels tile at zoom (equator) | |
| int | zoomForMetersPerPixel (double metersPerPixel) |
| Smallest zoom whose resolution is at least as fine as metersPerPixel (clamped to valid range) | |
| size_t | qHash (const TileKey &key, size_t seed=0) |
Variables | |
| constexpr double | kEarthRadius = 6378137.0 |
| WGS84 equatorial radius (m) | |
| constexpr double | kMaxLatitude = 85.05112878 |
| Mercator latitude clamp (deg) | |
| constexpr int | kMinZoom = 0 |
| constexpr int | kMaxZoom = 23 |
| constexpr int | kTilePixels = 256 |
| Nominal tile edge used for meters-per-pixel. | |
Web Mercator (EPSG:3857) projection and slippy-tile math for the GeoMap engine.
World space: mercator meters, origin at (lon 0, equator), x east, y north, z up. Note mercator meters are true meters only at the equator (scale grows with 1/cos(lat)); the rendered scene is self-consistent but distances are not geodesic.
Tile addressing: standard slippy scheme — tile (0,0) is the north-west corner, x grows east, y grows south.
| QPointF TileMath::geoToWorld | ( | const QGeoCoordinate & | coord | ) |
Geo -> world meters. Latitude is clamped to +/-kMaxLatitude.
Definition at line 23 of file TileMath.cc.
References kEarthRadius, and kMaxLatitude.
Referenced by GeoMapCamera::centerForCoordinateAtScreenPoint(), GeoScene::scenePositionFor(), GeoScene::screenPositionFor(), GeoMapCamera::setCenter(), and SurfacePatchModel::terrainHeightAt().
| bool TileMath::isValidKey | ( | const TileKey & | key | ) |
True if zoom is within [kMinZoom, kMaxZoom] and x/y address a tile at that zoom.
Definition at line 44 of file TileMath.cc.
References kMaxZoom, kMinZoom, TileMath::TileKey::x, TileMath::TileKey::y, and TileMath::TileKey::zoom.
Referenced by ElevationTilePyramid::bestTileFor(), HeightField::insertTile(), ElevationTilePyramid::insertTile(), TerrariumTileFetcher::requestPatchHeights(), ProceduralHeightSource::requestTile(), TerrariumTileFetcher::requestTile(), and HeightField::samplePatch().
| double TileMath::mercatorScale | ( | double | latitude | ) |
Mercator scale factor 1/cos(lat): how many mercator meters one true ground meter spans at the given latitude (clamped to +/-kMaxLatitude). Used to convert true-meter heights/altitudes into mercator scene units so vertical and horizontal geometry stay consistent away from the equator.
Definition at line 38 of file TileMath.cc.
References kMaxLatitude.
Referenced by GeoScene::verticalScale().
| double TileMath::metersPerPixelAtZoom | ( | int | zoom | ) |
World meters spanned by one pixel of a kTilePixels tile at zoom (equator)
Definition at line 84 of file TileMath.cc.
References kTilePixels, and tileSpanAtZoom().
Referenced by zoomForMetersPerPixel().
| QDebug TileMath::operator<< | ( | QDebug | debug, |
| const TileKey & | key | ||
| ) |
Streams as slippy "zoom/x/y" notation for logging.
Definition at line 11 of file TileMath.cc.
References TileMath::TileKey::x, TileMath::TileKey::y, and TileMath::TileKey::zoom.
|
inline |
Definition at line 43 of file TileMath.h.
References TileMath::TileKey::x, TileMath::TileKey::y, and TileMath::TileKey::zoom.
| TileKey TileMath::tileForWorld | ( | const QPointF & | world, |
| int | zoom | ||
| ) |
Tile containing a world point. World coordinates are clamped to the world extent.
Definition at line 67 of file TileMath.cc.
References kMaxZoom, kMinZoom, tileSpanAtZoom(), worldSize(), TileMath::TileKey::x, TileMath::TileKey::y, and TileMath::TileKey::zoom.
Referenced by HeightField::heightAt().
| QPointF TileMath::tileMinCorner | ( | const TileKey & | key | ) |
South-west (minimum x/y) corner of a tile in world meters.
Definition at line 58 of file TileMath.cc.
References tileSpanAtZoom(), worldSize(), TileMath::TileKey::x, TileMath::TileKey::y, and TileMath::TileKey::zoom.
Referenced by SurfaceAnalysis::analyze(), SurfacePatchModel::data(), HeightField::heightAt(), HeightField::insertTile(), ProceduralHeightSource::requestPatchHeights(), and ProceduralHeightSource::requestTile().
| double TileMath::tileSpanAtZoom | ( | int | zoom | ) |
Edge length of one tile at zoom, in world meters.
Definition at line 53 of file TileMath.cc.
References kMaxZoom, kMinZoom, and worldSize().
Referenced by SurfaceAnalysis::analyze(), SurfacePatchModel::data(), HeightField::heightAt(), HeightField::insertTile(), metersPerPixelAtZoom(), ProceduralHeightSource::requestPatchHeights(), ProceduralHeightSource::requestTile(), tileForWorld(), and tileMinCorner().
| double TileMath::worldSize | ( | ) |
Full mercator world extent (2*pi*R) in world meters.
Definition at line 18 of file TileMath.cc.
References kEarthRadius.
Referenced by GeoMapCamera::distanceForZoomLevel(), tileForWorld(), tileMinCorner(), and tileSpanAtZoom().
| QGeoCoordinate TileMath::worldToGeo | ( | const QPointF & | world | ) |
World meters -> geo (altitude 0)
Definition at line 31 of file TileMath.cc.
References kEarthRadius.
Referenced by SurfaceAnalysis::analyze(), GeoMapCamera::center(), GeoMapCamera::centerForCoordinateAtScreenPoint(), and GeoScene::verticalScale().
| int TileMath::zoomForMetersPerPixel | ( | double | metersPerPixel | ) |
Smallest zoom whose resolution is at least as fine as metersPerPixel (clamped to valid range)
Definition at line 89 of file TileMath.cc.
References kMaxZoom, kMinZoom, and metersPerPixelAtZoom().
|
constexpr |
WGS84 equatorial radius (m)
Definition at line 28 of file TileMath.h.
Referenced by geoToWorld(), worldSize(), and worldToGeo().
|
constexpr |
Mercator latitude clamp (deg)
Definition at line 29 of file TileMath.h.
Referenced by geoToWorld(), and mercatorScale().
|
constexpr |
Definition at line 31 of file TileMath.h.
Referenced by HeightField::heightAt(), isValidKey(), HeightField::samplePatch(), tileForWorld(), tileSpanAtZoom(), and zoomForMetersPerPixel().
|
constexpr |
Definition at line 30 of file TileMath.h.
Referenced by SurfaceAnalysis::analyze(), ElevationTilePyramid::bestTileFor(), isValidKey(), tileForWorld(), tileSpanAtZoom(), SurfaceModel::update(), and zoomForMetersPerPixel().
|
constexpr |
Nominal tile edge used for meters-per-pixel.
Definition at line 32 of file TileMath.h.
Referenced by GeoMapCamera::distanceForZoomLevel(), and metersPerPixelAtZoom().