QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgstilingscheme.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstilingscheme.h
3 --------------------------------------
4 Date : July 2017
5 Copyright : (C) 2017 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSTILINGSCHEME_H
17#define QGSTILINGSCHEME_H
18
19#include "qgis_3d.h"
21#include "qgspointxy.h"
22
23class QgsRectangle;
24struct QgsChunkNodeId;
25
26#define SIP_NO_FILE
27
35class _3D_EXPORT QgsTilingScheme
36{
37 public:
39 QgsTilingScheme() = default;
40
43
45 QgsPointXY tileToMap( int x, int y, int z ) const;
47 void mapToTile( const QgsPointXY &pt, int z, float &x, float &y ) const;
48
50 QgsRectangle tileToExtent( int x, int y, int z ) const;
51
53 QgsRectangle tileToExtent( const QgsChunkNodeId &nodeId ) const;
54
56 void extentToTile( const QgsRectangle &extent, int &x, int &y, int &z ) const;
57
59 QgsCoordinateReferenceSystem crs() const { return mCrs; }
60
66 QgsRectangle fullExtent() const { return mFullExtent; }
67
68 private:
69 QgsPointXY mMapOrigin;
70 double mBaseTileSide = 0;
72 QgsRectangle mFullExtent;
73};
74
75#endif // QGSTILINGSCHEME_H
Represents a coordinate reference system (CRS).
Represents a 2D point.
Definition qgspointxy.h:60
A rectangle specified with double values.
void mapToTile(const QgsPointXY &pt, int z, float &x, float &y) const
Returns tile coordinates for given map coordinates and Z level.
QgsCoordinateReferenceSystem crs() const
Returns CRS of the tiling scheme.
QgsRectangle fullExtent() const
Returns the full extent used in the constructor, which might not be square.
void extentToTile(const QgsRectangle &extent, int &x, int &y, int &z) const
Returns coordinates of a tile that most tightly fits the whole extent.
QgsPointXY tileToMap(int x, int y, int z) const
Returns map coordinates at tile coordinates (for lower-left corner of the tile).
QgsTilingScheme()=default
Creates invalid tiling scheme.
QgsRectangle tileToExtent(int x, int y, int z) const
Returns map coordinates of the extent of a tile.