File indexing completed on 2025-01-05 03:59:11
0001 /* 0002 SPDX-FileCopyrightText: 2016 Friedrich W. H. Kossebau <kossebau@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef MARBLE_GEOSCENEMERCATORTILEPROJECTION_H 0008 #define MARBLE_GEOSCENEMERCATORTILEPROJECTION_H 0009 0010 #include "GeoSceneAbstractTileProjection.h" 0011 0012 namespace Marble 0013 { 0014 0015 /** 0016 * Converts the x and y indices of tiles to and from geo coordinates. 0017 * For tiles of maps in Mercator projection. 0018 * 0019 * Tiles do have the same width and the same height per zoomlevel. 0020 * The number of tiles per dimension is twice that of the previous lower zoomlevel. 0021 * The indexing is done in x dimension eastwards, with the first tiles beginning at -180 degree 0022 * and an x value of 0 and the last tiles ending at +180 degree, 0023 * in y dimension southwards with the first tiles beginning at +85.05113 degree and a y value of 0 0024 * and the last tiles ending at -85.05113 degree. 0025 * 0026 * NOTE: The method @c tileIndexes() handles any latitude value >= +85.0 degree as 0027 * exactly +85.0 degree and any latitude value <= -85.0 as exactly -85.0 degree. 0028 * So for higher zoomlevels the outermost tiles will be masked by that and not included in any results. 0029 */ 0030 class DIGIKAM_EXPORT GeoSceneMercatorTileProjection : public GeoSceneAbstractTileProjection 0031 { 0032 public: 0033 /** 0034 * @brief Construct a new GeoSceneMercatorTileProjection. 0035 */ 0036 GeoSceneMercatorTileProjection(); 0037 0038 ~GeoSceneMercatorTileProjection() override; 0039 0040 public: 0041 /** 0042 * @copydoc 0043 */ 0044 GeoSceneAbstractTileProjection::Type type() const override; 0045 0046 /** 0047 * @copydoc 0048 */ 0049 QRect tileIndexes(const GeoDataLatLonBox &latLonBox, int zoomLevel) const override; 0050 0051 /** 0052 * @copydoc 0053 */ 0054 GeoDataLatLonBox geoCoordinates(int zoomLevel, int x, int y) const override; 0055 0056 using GeoSceneAbstractTileProjection::geoCoordinates; 0057 0058 private: 0059 Q_DISABLE_COPY(GeoSceneMercatorTileProjection) 0060 }; 0061 0062 } 0063 0064 #endif