/************************************************************************ * This file has been generated automatically from * * * * src/core/vectortile/qgsvectortilelayer.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/ class QgsVectorTileLayer : QgsMapLayer { %Docstring Implements a map layer that is dedicated to rendering of vector tiles. Vector tiles compared to "ordinary" vector layers are pre-processed data optimized for fast rendering. A dataset is provided with a series of zoom levels for different map scales. Each zoom level has a matrix of tiles that contain actual data. A single vector tile may be a a file stored on a local drive, requested over HTTP request or retrieved from a database. Content of a vector tile is divided into one or more named sub-layers. Each such sub-layer may contain many features which consist of geometry and attributes. Contrary to traditional vector layers, these sub-layers do not need to have a rigid schema where geometry type and attributes are the same for all features. A single sub-layer may have multiple geometry types in a single tile or have some attributes defined only at particular zoom levels. Vector tile layer currently does not use the concept of data providers that other layer types use. The process of rendering of vector tiles looks like this: +--------+ +------+ +---------+ | DATA | | RAW | | DECODED | | | --> LOADER --> | | --> DECODER --> | | --> RENDERER | SOURCE | | TILE | | TILE | +--------+ +------+ +---------+ Data source is a place from where tiles are fetched from (URL for HTTP access, local files, MBTiles file, GeoPackage file or others. Loader (QgsVectorTileLoader) class takes care of loading data from the data source. The "raw tile" data is just a blob (QByteArray) that is encoded in some way. There are multiple ways how vector tiles are encoded just like there are different formats how to store images. For example, tiles can be encoded using Mapbox Vector Tiles (MVT) format or in GeoJSON. Decoder (QgsVectorTileDecoder) takes care of decoding raw tile data into QgsFeature objects. A decoded tile is essentially an array of vector features for each sub-layer found in the tile - this is what vector tile renderer (QgsVectorTileRenderer) expects and does the map rendering. To construct a vector tile layer, it is best to use QgsDataSourceUri class and set the following parameters to get a valid encoded URI: - "type" - what kind of data source will be used - "url" - URL or path of the data source (specific to each data source type, see below) Currently supported data source types: - "xyz" - the "url" should be a template like http://example.com/{z}/{x}/{y}.pbf where {x},{y},{z} will be replaced by tile coordinates - "mbtiles" - tiles read from a MBTiles file (a SQLite database) Currently supported decoders: - MVT - following Mapbox Vector Tiles specification .. versionadded:: 3.14 %End %TypeHeaderCode #include "qgsvectortilelayer.h" %End public: explicit QgsVectorTileLayer( const QString &path = QString(), const QString &baseName = QString() ); %Docstring Constructs a new vector tile layer %End ~QgsVectorTileLayer(); SIP_PYOBJECT __repr__(); %MethodCode QString str = QStringLiteral( "" ).arg( sipCpp->name() ); sipRes = PyUnicode_FromString( str.toUtf8().constData() ); %End virtual QgsVectorTileLayer *clone() const /Factory/; virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) /Factory/; virtual bool readXml( const QDomNode &layerNode, QgsReadWriteContext &context ); virtual bool writeXml( QDomNode &layerNode, QDomDocument &doc, const QgsReadWriteContext &context ) const; virtual bool readSymbology( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ); virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const; virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ); virtual QString loadDefaultStyle( bool &resultFlag /Out/ ); virtual QString loadDefaultMetadata( bool &resultFlag /Out/ ); virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const ${SIP_FINAL}; virtual QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const ${SIP_FINAL}; virtual QString htmlMetadata() const; QString sourceType() const; %Docstring Returns type of the data source %End QString sourcePath() const; %Docstring Returns URL/path of the data source (syntax different to each data source type) %End int sourceMinZoom() const; %Docstring Returns minimum zoom level at which source has any valid tiles (negative = unconstrained) %End int sourceMaxZoom() const; %Docstring Returns maximum zoom level at which source has any valid tiles (negative = unconstrained) %End void setRenderer( QgsVectorTileRenderer *r /Transfer/ ); %Docstring Sets renderer for the map layer. .. note:: Takes ownership of the passed renderer %End QgsVectorTileRenderer *renderer() const; %Docstring Returns currently assigned renderer %End void setLabeling( QgsVectorTileLabeling *labeling /Transfer/ ); %Docstring Sets labeling for the map layer. .. note:: Takes ownership of the passed labeling %End QgsVectorTileLabeling *labeling() const; %Docstring Returns currently assigned labeling %End void setTileBorderRenderingEnabled( bool enabled ); %Docstring Sets whether to render also borders of tiles (useful for debugging) %End bool isTileBorderRenderingEnabled() const; %Docstring Returns whether to render also borders of tiles (useful for debugging) %End }; /************************************************************************ * This file has been generated automatically from * * * * src/core/vectortile/qgsvectortilelayer.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/