QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
Handles conversion of vector features to Mapbox vector tiles encoding. More...
#include <qgsvectortilemvtencoder.h>
Public Member Functions | |
QgsVectorTileMVTEncoder (QgsTileXYZ tileID) | |
Creates MVT encoder for the given tile coordinates for Web Mercator. | |
QgsVectorTileMVTEncoder (QgsTileXYZ tileID, const QgsTileMatrix &tileMatrix) | |
Creates MVT encoder for the given tile coordinates and tile matrix. | |
void | addLayer (QgsVectorLayer *layer, QgsFeedback *feedback=nullptr, QString filterExpression=QString(), QString layerName=QString()) |
Fetches data from vector layer for the given tile, does reprojection and clipping. | |
QByteArray | encode () const |
Encodes MVT using data stored previously with addLayer() calls. | |
int | resolution () const |
Returns resolution of coordinates of geometries within the tile. The default is 4096. | |
void | setResolution (int extent) |
Sets the resolution of coordinates of geometries within the tile. | |
void | setTileBuffer (int buffer) |
Sets size of the buffer zone around tile edges in integer tile coordinates. | |
void | setTransformContext (const QgsCoordinateTransformContext &transformContext) |
Sets coordinate transform context for transforms between layers and tile matrix CRS. | |
int | tileBuffer () const |
Returns size of the buffer zone around tile edges in integer tile coordinates. The default is 256 (~6%) | |
Handles conversion of vector features to Mapbox vector tiles encoding.
Geometries are stored as a series of MoveTo / LineTo / ClosePath commands with coordinates in integer values (see resolution(), called "extent" in the spec). Attributes are stored as key-value pairs of tags: keys are always strings, values can be integers, floating point numbers, booleans or strings.
See the specification for details: https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md
Definition at line 40 of file qgsvectortilemvtencoder.h.
|
explicit |
Creates MVT encoder for the given tile coordinates for Web Mercator.
Definition at line 145 of file qgsvectortilemvtencoder.cpp.
|
explicit |
Creates MVT encoder for the given tile coordinates and tile matrix.
Definition at line 153 of file qgsvectortilemvtencoder.cpp.
void QgsVectorTileMVTEncoder::addLayer | ( | QgsVectorLayer * | layer, |
QgsFeedback * | feedback = nullptr , |
||
QString | filterExpression = QString() , |
||
QString | layerName = QString() |
||
) |
Fetches data from vector layer for the given tile, does reprojection and clipping.
Optional feedback object may be provided to support cancellation.
Definition at line 160 of file qgsvectortilemvtencoder.cpp.
QByteArray QgsVectorTileMVTEncoder::encode | ( | ) | const |
Encodes MVT using data stored previously with addLayer() calls.
Definition at line 381 of file qgsvectortilemvtencoder.cpp.
|
inline |
Returns resolution of coordinates of geometries within the tile. The default is 4096.
Definition at line 50 of file qgsvectortilemvtencoder.h.
|
inline |
Sets the resolution of coordinates of geometries within the tile.
Definition at line 52 of file qgsvectortilemvtencoder.h.
|
inline |
Sets size of the buffer zone around tile edges in integer tile coordinates.
Definition at line 57 of file qgsvectortilemvtencoder.h.
|
inline |
Sets coordinate transform context for transforms between layers and tile matrix CRS.
Definition at line 60 of file qgsvectortilemvtencoder.h.
|
inline |
Returns size of the buffer zone around tile edges in integer tile coordinates. The default is 256 (~6%)
Definition at line 55 of file qgsvectortilemvtencoder.h.