QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
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
25
class
QgsCoordinateReferenceSystem
;
26
class
QgsTileMatrix
;
27
34
class
CORE_EXPORT
QgsGeoPackageTiles
35
{
36
public
:
38
explicit
QgsGeoPackageTiles
(
const
QString &filename );
39
40
~QgsGeoPackageTiles
();
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;
91
sqlite3_database_unique_ptr
mDatabase;
92
mutable
QString mLastError;
93
};
94
95
96
#endif
// QGSGPKGTILES_H
QgsCoordinateReferenceSystem
Represents a coordinate reference system (CRS).
Definition
qgscoordinatereferencesystem.h:216
QgsGeoPackageTiles::QgsGeoPackageTiles
QgsGeoPackageTiles(const QString &filename)
Constructs the GeoPackage reader (but it does not open the file yet).
Definition
qgsgpkgtiles.cpp:30
QgsGeoPackageTiles::close
bool close()
Explicitly closes the database.
Definition
qgsgpkgtiles.cpp:293
QgsGeoPackageTiles::setTileData
void setTileData(const QList< TileData > &tiles) const
Adds a batch of tile data within a single SQLite transaction.
Definition
qgsgpkgtiles.cpp:239
QgsGeoPackageTiles::finalize
bool finalize()
Finalizes the database after writing all tiles.
Definition
qgsgpkgtiles.cpp:39
QgsGeoPackageTiles::create
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.
Definition
qgsgpkgtiles.cpp:54
QgsGeoPackageTiles::lastError
QString lastError() const
Returns the latest error message obtained from the database.
Definition
qgsgpkgtiles.h:87
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
sqlite3_database_unique_ptr
Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes o...
Definition
qgssqliteutils.h:114
qgsrectangle.h
qgssqliteutils.h
QgsGeoPackageTiles::TileData
Struct representing a raw image tile.
Definition
qgsgpkgtiles.h:67
QgsGeoPackageTiles::TileData::y
int y
Definition
qgsgpkgtiles.h:70
QgsGeoPackageTiles::TileData::data
QByteArray data
Definition
qgsgpkgtiles.h:71
QgsGeoPackageTiles::TileData::z
int z
Definition
qgsgpkgtiles.h:68
QgsGeoPackageTiles::TileData::x
int x
Definition
qgsgpkgtiles.h:69
Generated on
for QGIS API Documentation by
1.17.0