Class: QgsVtpkTiles

class qgis.core.QgsVtpkTiles

Bases: sip.wrapper

Utility class for reading and writing ESRI VTPK files.

New in version 3.26.

QgsVtpkTiles(filename: str) Constructs VTPK reader (but it does not open the file yet)

Methods

crs

Returns the coordinate reference system of the tiles.

extent

Returns bounding box from metadata, given in the tiles crs().

isOpen

Returns whether the VTPK file is currently opened

layerMetadata

Reads layer metadata from the VTPK file.

matrixSet

Returns the vector tile matrix set representing the tiles.

metadata

Returns the VTPK metadata.

open

Tries to open the file, returns true on success

spriteDefinition

Returns the VTPK sprites definitions.

spriteImage

Returns the VTPK sprite image, if it exists.

styleDefinition

Returns the VTPK style definition.

tileData

Returns the raw tile data for the matching tile.

crs(self) QgsCoordinateReferenceSystem

Returns the coordinate reference system of the tiles.

Return type

QgsCoordinateReferenceSystem

extent(self, context: QgsCoordinateTransformContext) QgsRectangle

Returns bounding box from metadata, given in the tiles crs().

Parameters

context (QgsCoordinateTransformContext) –

Return type

QgsRectangle

isOpen(self) bool

Returns whether the VTPK file is currently opened

Return type

bool

layerMetadata(self) QgsLayerMetadata

Reads layer metadata from the VTPK file.

Return type

QgsLayerMetadata

matrixSet(self) QgsVectorTileMatrixSet

Returns the vector tile matrix set representing the tiles.

Return type

QgsVectorTileMatrixSet

metadata(self) Dict[str, Any]

Returns the VTPK metadata.

This method returns the contents of the “root.json” file.

Return type

Dict[str, Any]

open(self) bool

Tries to open the file, returns true on success

Return type

bool

spriteDefinition(self) Dict[str, Any]

Returns the VTPK sprites definitions.

Return type

Dict[str, Any]

spriteImage(self) QImage

Returns the VTPK sprite image, if it exists.

Return type

QImage

styleDefinition(self) Dict[str, Any]

Returns the VTPK style definition.

Return type

Dict[str, Any]

tileData(self, z: int, x: int, y: int) QByteArray

Returns the raw tile data for the matching tile.

Parameters
  • z (int) –

  • x (int) –

  • y (int) –

Return type

QByteArray