QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
qgsvtpktiles.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvtpktiles.h
3 --------------------------------------
4 Date : March 2022
5 Copyright : (C) 2022 by Nyall Dawson
6 Email : nyall dot dawson 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 QGSVTPKTILES_H
17#define QGSVTPKTILES_H
18
19#include <sqlite3.h>
20
21#include "qgis_core.h"
23
24#include <QVariantMap>
25
26class QImage;
27class QgsRectangle;
30
37class CORE_EXPORT QgsVtpkTiles
38{
39 public:
41 explicit QgsVtpkTiles( const QString &filename );
42
43#ifndef SIP_RUN
44 QgsVtpkTiles( const QgsVtpkTiles &other ) = delete;
45 QgsVtpkTiles &operator=( const QgsVtpkTiles &other ) = delete;
46#endif
48
50 bool open();
51
53 bool isOpen() const;
54
60 QVariantMap metadata() const;
61
65 QVariantMap styleDefinition() const;
66
70 QVariantMap spriteDefinition() const;
71
75 QImage spriteImage() const;
76
81
89 QVariantMap rootTileMap() const;
90
95
100
104 QgsRectangle extent( const QgsCoordinateTransformContext &context ) const;
105
114 QByteArray tileData( int z, int x, int y );
115
116 private:
117
118#ifdef SIP_RUN
119 QgsVtpkTiles( const QgsVtpkTiles &other );
120#endif
121
122 QString mFilename;
123 struct zip *mZip = nullptr;
124 mutable QVariantMap mMetadata;
125 mutable QgsVectorTileMatrixSet mMatrixSet;
126 mutable QString mTileMapPath;
127 mutable bool mHasReadTileMap = false;
128 mutable QVariantMap mRootTileMap;
129 mutable int mPacketSize = -1;
130};
131
132
133#endif // QGSVTPKTILES_H
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
A structured metadata store for a map layer.
A rectangle specified with double values.
Encapsulates properties of a vector tile matrix set, including tile origins and scaling information.
QByteArray tileData(int z, int x, int y)
Returns the raw tile data for the matching tile.
QgsRectangle extent(const QgsCoordinateTransformContext &context) const
Returns bounding box from metadata, given in the tiles crs().
QgsVtpkTiles(const QgsVtpkTiles &other)=delete
bool isOpen() const
Returns whether the VTPK file is currently opened.
QgsVtpkTiles & operator=(const QgsVtpkTiles &other)=delete
QVariantMap rootTileMap() const
Returns the root tilemap content, if it exists.
QVariantMap spriteDefinition() const
Returns the VTPK sprites definitions.
QgsCoordinateReferenceSystem crs() const
Returns the coordinate reference system of the tiles.
QgsLayerMetadata layerMetadata() const
Reads layer metadata from the VTPK file.
bool open()
Tries to open the file, returns true on success.
QgsVtpkTiles(const QString &filename)
Constructs VTPK reader (but it does not open the file yet).
QgsVectorTileMatrixSet matrixSet() const
Returns the vector tile matrix set representing the tiles.
QVariantMap styleDefinition() const
Returns the VTPK style definition.
QVariantMap metadata() const
Returns the VTPK metadata.
QImage spriteImage() const
Returns the VTPK sprite image, if it exists.