QGIS API Documentation  3.27.0-Master (e113457133)
Public Member Functions | Static Public Member Functions | Friends | List of all members
QgsTileMatrix Class Reference

Defines a matrix of tiles for a single zoom level: it is defined by its size (width *. More...

#include <qgstiles.h>

Public Member Functions

QgsCoordinateReferenceSystem crs () const
 Returns the crs of the tile matrix. More...
 
QgsRectangle extent () const
 Returns extent of the tile matrix. More...
 
bool isRootTileMatrix () const
 Returns the root status of the tile matrix (zoom level == 0) More...
 
QPointF mapToTileCoordinates (const QgsPointXY &mapPoint) const
 Returns row/column coordinates (floating point number) from the given point in map coordinates. More...
 
int matrixHeight () const
 Returns number of rows of the tile matrix. More...
 
int matrixWidth () const
 Returns number of columns of the tile matrix. More...
 
double scale () const
 Returns scale denominator of the tile matrix. More...
 
void setCrs (const QgsCoordinateReferenceSystem &crs)
 Sets the crs of the tile matrix. More...
 
void setScale (double scale)
 Sets the scale denominator of the tile matrix. More...
 
void setZoomLevel (int level)
 Sets the zoom level of the tile matrix. More...
 
QgsPointXY tileCenter (QgsTileXYZ id) const
 Returns center of the given tile in this matrix. More...
 
QgsRectangle tileExtent (QgsTileXYZ id) const
 Returns extent of the given tile in this matrix. More...
 
QgsTileRange tileRangeFromExtent (const QgsRectangle &mExtent) const
 Returns tile range that fully covers the given extent. More...
 
int zoomLevel () const
 Returns the zoom level of the tile matrix. More...
 

Static Public Member Functions

static QgsTileMatrix fromCustomDef (int zoomLevel, const QgsCoordinateReferenceSystem &crs, const QgsPointXY &z0TopLeftPoint, double z0Dimension, int z0MatrixWidth=1, int z0MatrixHeight=1)
 Returns a tile matrix for a specific CRS, top left point, zoom level 0 dimension in CRS units. More...
 
static QgsTileMatrix fromTileMatrix (int zoomLevel, const QgsTileMatrix &tileMatrix)
 Returns a tile matrix based on another one. More...
 
static QgsTileMatrix fromWebMercator (int zoomLevel)
 Returns a tile matrix for the usual web mercator. More...
 

Friends

class QgsTileMatrixSet
 

Detailed Description

Defines a matrix of tiles for a single zoom level: it is defined by its size (width *.

height) and map extent that it covers.

Please note that we follow the XYZ convention of X/Y axes, i.e. top-left tile has [0,0] coordinate (which is different from TMS convention where bottom-left tile has [0,0] coordinate).

Since
QGIS 3.14

Definition at line 107 of file qgstiles.h.

Member Function Documentation

◆ crs()

QgsCoordinateReferenceSystem QgsTileMatrix::crs ( ) const
inline

Returns the crs of the tile matrix.

See also
setCrs()

Definition at line 131 of file qgstiles.h.

◆ extent()

QgsRectangle QgsTileMatrix::extent ( ) const
inline

Returns extent of the tile matrix.

Definition at line 163 of file qgstiles.h.

◆ fromCustomDef()

QgsTileMatrix QgsTileMatrix::fromCustomDef ( int  zoomLevel,
const QgsCoordinateReferenceSystem crs,
const QgsPointXY z0TopLeftPoint,
double  z0Dimension,
int  z0MatrixWidth = 1,
int  z0MatrixHeight = 1 
)
static

Returns a tile matrix for a specific CRS, top left point, zoom level 0 dimension in CRS units.

The z0Dimension argument must specify the dimension (width or height, in map units) of the root tiles in zoom level 0.

Definition at line 31 of file qgstiles.cpp.

◆ fromTileMatrix()

QgsTileMatrix QgsTileMatrix::fromTileMatrix ( int  zoomLevel,
const QgsTileMatrix tileMatrix 
)
static

Returns a tile matrix based on another one.

Definition at line 61 of file qgstiles.cpp.

◆ fromWebMercator()

QgsTileMatrix QgsTileMatrix::fromWebMercator ( int  zoomLevel)
static

Returns a tile matrix for the usual web mercator.

Definition at line 23 of file qgstiles.cpp.

◆ isRootTileMatrix()

bool QgsTileMatrix::isRootTileMatrix ( ) const
inline

Returns the root status of the tile matrix (zoom level == 0)

Definition at line 193 of file qgstiles.h.

◆ mapToTileCoordinates()

QPointF QgsTileMatrix::mapToTileCoordinates ( const QgsPointXY mapPoint) const

Returns row/column coordinates (floating point number) from the given point in map coordinates.

Definition at line 121 of file qgstiles.cpp.

◆ matrixHeight()

int QgsTileMatrix::matrixHeight ( ) const
inline

Returns number of rows of the tile matrix.

Definition at line 160 of file qgstiles.h.

◆ matrixWidth()

int QgsTileMatrix::matrixWidth ( ) const
inline

Returns number of columns of the tile matrix.

Definition at line 157 of file qgstiles.h.

◆ scale()

double QgsTileMatrix::scale ( ) const
inline

Returns scale denominator of the tile matrix.

See also
setScale()

Definition at line 170 of file qgstiles.h.

◆ setCrs()

void QgsTileMatrix::setCrs ( const QgsCoordinateReferenceSystem crs)
inline

Sets the crs of the tile matrix.

See also
crs()
Since
QGIS 3.22.6

Definition at line 139 of file qgstiles.h.

◆ setScale()

void QgsTileMatrix::setScale ( double  scale)
inline

Sets the scale denominator of the tile matrix.

See also
scale()
Since
QGIS 3.22.6

Definition at line 178 of file qgstiles.h.

◆ setZoomLevel()

void QgsTileMatrix::setZoomLevel ( int  level)
inline

Sets the zoom level of the tile matrix.

See also
zoomLevel()
Since
QGIS 3.22.6

Definition at line 154 of file qgstiles.h.

◆ tileCenter()

QgsPointXY QgsTileMatrix::tileCenter ( QgsTileXYZ  id) const

Returns center of the given tile in this matrix.

Definition at line 90 of file qgstiles.cpp.

◆ tileExtent()

QgsRectangle QgsTileMatrix::tileExtent ( QgsTileXYZ  id) const

Returns extent of the given tile in this matrix.

Definition at line 81 of file qgstiles.cpp.

◆ tileRangeFromExtent()

QgsTileRange QgsTileMatrix::tileRangeFromExtent ( const QgsRectangle mExtent) const

Returns tile range that fully covers the given extent.

Definition at line 97 of file qgstiles.cpp.

◆ zoomLevel()

int QgsTileMatrix::zoomLevel ( ) const
inline

Returns the zoom level of the tile matrix.

See also
setZoomLevel()

Definition at line 146 of file qgstiles.h.

Friends And Related Function Documentation

◆ QgsTileMatrixSet

friend class QgsTileMatrixSet
friend

Definition at line 213 of file qgstiles.h.


The documentation for this class was generated from the following files: