42 explicit QgsMbTiles(
const QString &filename );
69 bool create(
bool deferIndexCreation =
false );
84 QByteArray
tileData(
int z,
int x,
int y )
const;
93 void setTileData(
int z,
int x,
int y,
const QByteArray &data )
const;
112 void setTileData(
const QList<TileData> &tiles )
const;
124 bool mDeferredIndexCreation =
false;
125 mutable QString mLastError;
QgsMbTiles(const QString &filename)
Constructs MBTiles reader (but it does not open the file yet).
QString metadataValue(const QString &key) const
Requests metadata value for the given key.
bool open()
Tries to open the file, returns true on success.
QImage tileDataAsImage(int z, int x, int y) const
Returns tile decoded as a raster image (if stored in a known format like JPG or PNG).
bool finalize()
Finalizes the database after writing all tiles.
QByteArray tileData(int z, int x, int y) const
Returns raw tile data for given tile.
void setMetadataValue(const QString &key, const QString &value) const
Sets metadata value for the given key.
bool isOpen() const
Returns whether the MBTiles file is currently opened.
void setTileData(int z, int x, int y, const QByteArray &data) const
Adds tile data for the given tile coordinates.
QString lastError() const
Returns the latest error message obtained from the database.
bool create(bool deferIndexCreation=false)
Creates a new MBTiles file and initializes it with metadata and tiles tables.
QgsRectangle extent() const
Returns bounding box from metadata, given in WGS 84 (if available).
A rectangle specified with double values.
Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes o...
Struct representing a raw image tile.