QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
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. More... | |
QgsVectorTileMVTEncoder (QgsTileXYZ tileID, const QgsTileMatrix &tileMatrix) | |
Creates MVT encoder for the given tile coordinates and tile matrix. More... | |
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. More... | |
QByteArray | encode () const |
Encodes MVT using data stored previously with addLayer() calls. More... | |
int | resolution () const |
Returns resolution of coordinates of geometries within the tile. The default is 4096. More... | |
void | setResolution (int extent) |
Sets the resolution of coordinates of geometries within the tile. More... | |
void | setTileBuffer (int buffer) |
Sets size of the buffer zone around tile edges in integer tile coordinates. More... | |
void | setTransformContext (const QgsCoordinateTransformContext &transformContext) |
Sets coordinate transform context for transforms between layers and tile matrix CRS. More... | |
int | tileBuffer () const |
Returns size of the buffer zone around tile edges in integer tile coordinates. The default is 256 (~6%) More... | |
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 143 of file qgsvectortilemvtencoder.cpp.
|
explicit |
Creates MVT encoder for the given tile coordinates and tile matrix.
Definition at line 151 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 158 of file qgsvectortilemvtencoder.cpp.
QByteArray QgsVectorTileMVTEncoder::encode | ( | ) | const |
Encodes MVT using data stored previously with addLayer() calls.
Definition at line 379 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.