QGIS API Documentation 4.3.0-Master (0ff9723465c)
Loading...
Searching...
No Matches
QgsGeoPackageTiles Class Reference

Utility class for creating GeoPackage raster tile databases. More...

#include <qgsgpkgtiles.h>

Classes

struct  TileData
 Struct representing a raw image tile. More...

Public Member Functions

 QgsGeoPackageTiles (const QString &filename)
 Constructs the GeoPackage reader (but it does not open the file yet).
 ~QgsGeoPackageTiles ()
bool close ()
 Explicitly closes the database.
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.
bool finalize ()
 Finalizes the database after writing all tiles.
QString lastError () const
 Returns the latest error message obtained from the database.
void setTileData (const QList< TileData > &tiles) const
 Adds a batch of tile data within a single SQLite transaction.

Detailed Description

Utility class for creating GeoPackage raster tile databases.

Since
QGIS 4.4

Definition at line 34 of file qgsgpkgtiles.h.

Constructor & Destructor Documentation

◆ QgsGeoPackageTiles()

QgsGeoPackageTiles::QgsGeoPackageTiles ( const QString & filename)
explicit

Constructs the GeoPackage reader (but it does not open the file yet).

Definition at line 30 of file qgsgpkgtiles.cpp.

◆ ~QgsGeoPackageTiles()

QgsGeoPackageTiles::~QgsGeoPackageTiles ( )

Definition at line 34 of file qgsgpkgtiles.cpp.

Member Function Documentation

◆ close()

bool QgsGeoPackageTiles::close ( )

Explicitly closes the database.

Definition at line 293 of file qgsgpkgtiles.cpp.

◆ create()

bool QgsGeoPackageTiles::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.

Parameters
z0matrixzoom level 0 tile matrix
contentsExtentactual bounding box of data stored in gpkg_contents, specified in coordinates of the target crs.
minZoomminimum zoom level.
maxZoommaximum zoom level.
tileWidthpixel width of individual tiles.
tileHeightpixel height of individual tiles.
Returns
true on success. If the file exists already, returns false.
Note
finalize() must be called after creating the database.

Definition at line 54 of file qgsgpkgtiles.cpp.

◆ finalize()

bool QgsGeoPackageTiles::finalize ( )

Finalizes the database after writing all tiles.

Definition at line 39 of file qgsgpkgtiles.cpp.

◆ lastError()

QString QgsGeoPackageTiles::lastError ( ) const
inline

Returns the latest error message obtained from the database.

Definition at line 87 of file qgsgpkgtiles.h.

◆ setTileData()

void QgsGeoPackageTiles::setTileData ( const QList< TileData > & tiles) const

Adds a batch of tile data within a single SQLite transaction.

Definition at line 239 of file qgsgpkgtiles.cpp.


The documentation for this class was generated from the following files: