Class: QgsTileMatrix¶
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).
Added in version 3.14.
Methods
Returns the crs of the tile matrix. |
|
Returns extent of the tile matrix |
|
Returns the root status of the tile matrix (zoom level == 0) |
|
Returns row/column coordinates (floating point number) from the given point in map coordinates |
|
Returns number of rows of the tile matrix |
|
Returns number of columns of the tile matrix |
|
Returns scale denominator of the tile matrix. |
|
Sets the crs of the tile matrix. |
|
Sets the scale denominator of the tile matrix. |
|
Sets the zoom level of the tile matrix. |
|
Returns center of the given tile in this matrix |
|
Returns extent of the given tile in this matrix |
|
Returns tile range that fully covers the given extent |
|
Returns the zoom level of the tile matrix. |
Static Methods
Returns a tile matrix for a specific CRS, top left point, zoom level 0 dimension in CRS units. |
|
Returns a tile matrix based on another one |
|
Returns a tile matrix for the usual web mercator |
- class qgis.core.QgsTileMatrix[source]¶
Bases:
object
- crs(self) QgsCoordinateReferenceSystem [source]¶
Returns the crs of the tile matrix.
See also
- Return type:
- extent(self) QgsRectangle [source]¶
Returns extent of the tile matrix
- Return type:
- static fromCustomDef(zoomLevel: int, crs: QgsCoordinateReferenceSystem, z0TopLeftPoint: QgsPointXY, z0Dimension: float, z0MatrixWidth: int = 1, z0MatrixHeight: int = 1) QgsTileMatrix [source]¶
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.- Parameters:
zoomLevel (int)
z0TopLeftPoint (QgsPointXY)
z0Dimension (float)
z0MatrixWidth (int = 1)
z0MatrixHeight (int = 1)
- Return type:
- static fromTileMatrix(zoomLevel: int, tileMatrix: QgsTileMatrix) QgsTileMatrix [source]¶
Returns a tile matrix based on another one
- Parameters:
zoomLevel (int)
tileMatrix (QgsTileMatrix)
- Return type:
- static fromWebMercator(zoomLevel: int) QgsTileMatrix [source]¶
Returns a tile matrix for the usual web mercator
- Parameters:
zoomLevel (int)
- Return type:
- isRootTileMatrix(self) bool [source]¶
Returns the root status of the tile matrix (zoom level == 0)
- Return type:
bool
- mapToTileCoordinates(self, mapPoint: QgsPointXY) QPointF [source]¶
Returns row/column coordinates (floating point number) from the given point in map coordinates
- Parameters:
mapPoint (QgsPointXY)
- Return type:
QPointF
- scale(self) float [source]¶
Returns scale denominator of the tile matrix.
See also
- Return type:
float
- setCrs(self, crs: QgsCoordinateReferenceSystem)[source]¶
Sets the
crs
of the tile matrix.See also
Added in version 3.22.6.
- Parameters:
- setScale(self, scale: float)[source]¶
Sets the scale denominator of the tile matrix.
See also
Added in version 3.22.6.
- Parameters:
scale (float)
- setZoomLevel(self, level: int)[source]¶
Sets the zoom
level
of the tile matrix.See also
Added in version 3.22.6.
- Parameters:
level (int)
- tileCenter(self, id: QgsTileXYZ) QgsPointXY [source]¶
Returns center of the given tile in this matrix
- Parameters:
id (QgsTileXYZ)
- Return type:
- tileExtent(self, id: QgsTileXYZ) QgsRectangle [source]¶
Returns extent of the given tile in this matrix
- Parameters:
id (QgsTileXYZ)
- Return type:
- tileRangeFromExtent(self, mExtent: QgsRectangle) QgsTileRange [source]¶
Returns tile range that fully covers the given extent
- Parameters:
mExtent (QgsRectangle)
- Return type: