Class: QgsVtpkTiles¶
Utility class for reading and writing ESRI VTPK files.
Added in version 3.26.
- class qgis.core.QgsVtpkTiles[source]¶
Bases:
object- __init__(filename: str | None)
Constructs VTPK reader (but it does not open the file yet)
- Parameters:
filename (Optional[str])
- crs(self) QgsCoordinateReferenceSystem[source]¶
Returns the coordinate reference system of the tiles.
- Return type:
- extent(self, context: QgsCoordinateTransformContext) QgsRectangle[source]¶
Returns bounding box from metadata, given in the tiles
crs().- Parameters:
context (QgsCoordinateTransformContext)
- Return type:
- layerMetadata(self) QgsLayerMetadata[source]¶
Reads layer metadata from the VTPK file.
- Return type:
- matrixSet(self) QgsVectorTileMatrixSet[source]¶
Returns the vector tile matrix set representing the tiles.
- Return type:
- metadata(self) Dict[str, Any][source]¶
Returns the VTPK metadata.
This method returns the contents of the “root.json” file.
- Return type:
Dict[str, Any]
- rootTileMap(self) Dict[str, Any][source]¶
Returns the root tilemap content, if it exists.
This method returns the contents of the “tilemap/root.json” file.
Added in version 3.32.
- Return type:
Dict[str, Any]
- spriteDefinition(self) Dict[str, Any][source]¶
Returns the VTPK sprites definitions.
- Return type:
Dict[str, Any]
- styleDefinition(self) Dict[str, Any][source]¶
Returns the VTPK style definition.
- Return type:
Dict[str, Any]
- tileData(self, z: int, x: int, y: int) QByteArray[source]¶
Returns the raw tile data for the matching tile.
Returns a null byte array if the requested tile does not exist.
Will return an empty byte array (as opposed to a null byte array) if the tile exists but has a zero size.
- Parameters:
z (int)
x (int)
y (int)
- Return type:
QByteArray