QGIS API Documentation 4.3.0-Master (0ff9723465c)
Loading...
Searching...
No Matches
qgsgpkgtiles.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgpkgtiles.h
3 --------------------------------------
4 Date : September 2026
5 Copyright : (C) 2026 by Nyall Dawson
6 Email : nyall.dawson@gmail.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 QGSGPKGTILES_H
17#define QGSGPKGTILES_H
18
19#include "qgis_core.h"
20#include "qgsrectangle.h"
21#include "qgssqliteutils.h"
22
23#define SIP_NO_FILE
24
26class QgsTileMatrix;
27
34class CORE_EXPORT QgsGeoPackageTiles
35{
36 public:
38 explicit QgsGeoPackageTiles( const QString &filename );
39
41
56 bool create( const QgsTileMatrix &z0matrix, const QgsRectangle &contentsExtent, int minZoom, int maxZoom, int tileWidth = 256, int tileHeight = 256 );
57
61 bool finalize();
62
66 struct TileData
67 {
68 int z = 0;
69 int x = 0;
70 int y = 0;
71 QByteArray data;
72 };
73
77 void setTileData( const QList<TileData> &tiles ) const;
78
82 bool close();
83
87 QString lastError() const { return mLastError; }
88
89 private:
90 QString mFilename;
92 mutable QString mLastError;
93};
94
95
96#endif // QGSGPKGTILES_H
Represents a coordinate reference system (CRS).
QgsGeoPackageTiles(const QString &filename)
Constructs the GeoPackage reader (but it does not open the file yet).
bool close()
Explicitly closes the database.
void setTileData(const QList< TileData > &tiles) const
Adds a batch of tile data within a single SQLite transaction.
bool finalize()
Finalizes the database after writing all tiles.
bool create(const QgsTileMatrix &z0matrix, const QgsRectangle &contentsExtent, int minZoom, int maxZoom, int tileWidth=256, int tileHeight=256)
Creates a new GeoPackage database and initializes it with metadata and tiles tables.
QString lastError() const
Returns the latest error message obtained from the database.
A rectangle specified with double values.
Defines a matrix of tiles for a single zoom level: it is defined by its size (width *.
Definition qgstiles.h:171
Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes o...
Struct representing a raw image tile.