QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
vectortile
qgsvectortilemvtencoder.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsvectortilemvtencoder.h
3
--------------------------------------
4
Date : April 2020
5
Copyright : (C) 2020 by Martin Dobias
6
Email : wonder dot sk at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSVECTORTILEMVTENCODER_H
17
#define QGSVECTORTILEMVTENCODER_H
18
19
20
#include "
qgscoordinatetransform.h
"
21
#include "
qgstiles.h
"
22
#include "
qgsvectortilerenderer.h
"
23
#include "vector_tile.pb.h"
24
25
#define SIP_NO_FILE
26
41
class
CORE_EXPORT
QgsVectorTileMVTEncoder
42
{
43
public
:
45
explicit
QgsVectorTileMVTEncoder
(
QgsTileXYZ
tileID );
46
48
explicit
QgsVectorTileMVTEncoder
(
QgsTileXYZ
tileID,
const
QgsTileMatrix
&tileMatrix );
49
51
int
resolution
()
const
{
return
mResolution; }
53
void
setResolution
(
int
extent ) { mResolution = extent; }
54
56
int
tileBuffer
()
const
{
return
mBuffer; }
58
void
setTileBuffer
(
int
buffer ) { mBuffer = buffer; }
59
61
void
setTransformContext
(
const
QgsCoordinateTransformContext
&transformContext ) { mTransformContext = transformContext; }
62
68
void
addLayer(
QgsVectorLayer
*layer,
QgsFeedback
*feedback =
nullptr
, QString filterExpression = QString(), QString layerName = QString() );
69
71
QByteArray encode()
const
;
72
73
private
:
74
void
addFeature( vector_tile::Tile_Layer *tileLayer,
const
QgsFeature
&f );
75
76
private
:
77
QgsTileXYZ
mTileID;
78
int
mResolution = 4096;
79
int
mBuffer = 256;
80
QgsCoordinateTransformContext
mTransformContext;
81
82
QgsRectangle
mTileExtent;
83
QgsCoordinateReferenceSystem
mCrs;
84
85
QgsVectorTileFeatures
mFeatures;
86
87
vector_tile::Tile tile;
88
89
QMap<QVariant, int> mKnownValues;
90
};
91
92
#endif
// QGSVECTORTILEMVTENCODER_H
QgsCoordinateReferenceSystem
Represents a coordinate reference system (CRS).
Definition
qgscoordinatereferencesystem.h:216
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition
qgscoordinatetransformcontext.h:61
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:60
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition
qgsfeedback.h:44
QgsRectangle
A rectangle specified with double values.
Definition
qgsrectangle.h:47
QgsTileMatrix
Defines a matrix of tiles for a single zoom level: it is defined by its size (width *.
Definition
qgstiles.h:171
QgsTileXYZ
Stores coordinates of a tile in a tile matrix set.
Definition
qgstiles.h:43
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
QgsVectorTileMVTEncoder::resolution
int resolution() const
Returns resolution of coordinates of geometries within the tile. The default is 4096.
Definition
qgsvectortilemvtencoder.h:51
QgsVectorTileMVTEncoder::setTileBuffer
void setTileBuffer(int buffer)
Sets size of the buffer zone around tile edges in integer tile coordinates.
Definition
qgsvectortilemvtencoder.h:58
QgsVectorTileMVTEncoder::tileBuffer
int tileBuffer() const
Returns size of the buffer zone around tile edges in integer tile coordinates. The default is 256 (~6...
Definition
qgsvectortilemvtencoder.h:56
QgsVectorTileMVTEncoder::setResolution
void setResolution(int extent)
Sets the resolution of coordinates of geometries within the tile.
Definition
qgsvectortilemvtencoder.h:53
QgsVectorTileMVTEncoder::QgsVectorTileMVTEncoder
QgsVectorTileMVTEncoder(QgsTileXYZ tileID)
Creates MVT encoder for the given tile coordinates for Web Mercator.
Definition
qgsvectortilemvtencoder.cpp:130
QgsVectorTileMVTEncoder::setTransformContext
void setTransformContext(const QgsCoordinateTransformContext &transformContext)
Sets coordinate transform context for transforms between layers and tile matrix CRS.
Definition
qgsvectortilemvtencoder.h:61
qgscoordinatetransform.h
qgstiles.h
qgsvectortilerenderer.h
QgsVectorTileFeatures
QMap< QString, QVector< QgsFeature > > QgsVectorTileFeatures
Features of a vector tile, grouped by sub-layer names (key of the map).
Definition
qgsvectortilerenderer.h:32
Generated on
for QGIS API Documentation by
1.17.0