The raster file writer which allows you to save a raster to a new file.
More...
#include <qgsrasterfilewriter.h>
|
| QgsRasterFileWriter (const QString &outputUrl) |
|
QgsRaster::RasterBuildPyramids | buildPyramidsFlag () const |
|
QgsRasterDataProvider * | createMultiBandRaster (Qgis::DataType dataType, int width, int height, const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs, int nBands) |
| Create a raster file with given number of bands without initializing the pixel data. More...
|
|
QgsRasterDataProvider * | createOneBandRaster (Qgis::DataType dataType, int width, int height, const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs) |
| Create a raster file with one band without initializing the pixel data. More...
|
|
QStringList | createOptions () const |
|
int | maxTileHeight () const |
|
int | maxTileWidth () const |
|
QString | outputFormat () const |
|
QString | outputProviderKey () const |
|
QString | outputUrl () const |
| Returns the output URL for the raster. More...
|
|
QStringList | pyramidsConfigOptions () const |
|
QgsRaster::RasterPyramidsFormat | pyramidsFormat () const |
|
QList< int > | pyramidsList () const |
|
QString | pyramidsResampling () const |
|
void | setBuildPyramidsFlag (QgsRaster::RasterBuildPyramids f) |
|
void | setCreateOptions (const QStringList &list) |
|
void | setMaxTileHeight (int h) |
|
void | setMaxTileWidth (int w) |
|
void | setOutputFormat (const QString &format) |
|
void | setOutputProviderKey (const QString &key) |
|
void | setPyramidsConfigOptions (const QStringList &list) |
|
void | setPyramidsFormat (QgsRaster::RasterPyramidsFormat f) |
|
void | setPyramidsList (const QList< int > &list) |
|
void | setPyramidsResampling (const QString &str) |
|
void | setTiledMode (bool t) |
|
bool | tiledMode () const |
|
WriterError | writeRaster (const QgsRasterPipe *pipe, int nCols, int nRows, const QgsRectangle &outputExtent, const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &transformContext, QgsRasterBlockFeedback *feedback=nullptr) |
| Write raster file. More...
|
|
Q_DECL_DEPRECATED WriterError | writeRaster (const QgsRasterPipe *pipe, int nCols, int nRows, const QgsRectangle &outputExtent, const QgsCoordinateReferenceSystem &crs, QgsRasterBlockFeedback *feedback=nullptr) |
| Write raster file. More...
|
|
The raster file writer which allows you to save a raster to a new file.
Definition at line 39 of file qgsrasterfilewriter.h.
◆ Mode
◆ RasterFormatOption
Options for sorting and filtering raster formats.
- Since
- QGIS 3.0
Enumerator |
---|
SortRecommended | Use recommended sort order, with extremely commonly used formats listed first.
|
Definition at line 62 of file qgsrasterfilewriter.h.
◆ WriterError
Enumerator |
---|
NoError | |
SourceProviderError | |
DestProviderError | |
CreateDatasourceError | |
WriteError | |
NoDataConflict | Internal error if a value used for 'no data' was found in input.
|
WriteCanceled | Writing was manually canceled.
|
Definition at line 47 of file qgsrasterfilewriter.h.
◆ QgsRasterFileWriter()
QgsRasterFileWriter::QgsRasterFileWriter |
( |
const QString & |
outputUrl | ) |
|
◆ buildPyramidsFlag()
◆ createMultiBandRaster()
Create a raster file with given number of bands without initializing the pixel data.
Returned provider may be used to initialize the raster using writeBlock() calls. Ownership of the returned provider is passed to the caller.
- Returns
- Instance of data provider in editing mode (on success) or
nullptr
on error.
- Note
- Does not work with tiled mode enabled.
- Since
- QGIS 3.0
Definition at line 53 of file qgsrasterfilewriter.cpp.
◆ createOneBandRaster()
Create a raster file with one band without initializing the pixel data.
Returned provider may be used to initialize the raster using writeBlock() calls. Ownership of the returned provider is passed to the caller.
- Returns
- Instance of data provider in editing mode (on success) or
nullptr
on error.
- Note
- Does not work with tiled mode enabled.
- Since
- QGIS 3.0
Definition at line 41 of file qgsrasterfilewriter.cpp.
◆ createOptions()
QStringList QgsRasterFileWriter::createOptions |
( |
| ) |
const |
|
inline |
◆ driverForExtension()
QString QgsRasterFileWriter::driverForExtension |
( |
const QString & |
extension | ) |
|
|
static |
Returns the GDAL driver name for a specified file extension.
E.g. the driver name for the ".tif" extension is "GTiff". If no suitable drivers are found then an empty string is returned.
Note that this method works for all GDAL drivers, including those without create support (and which are not supported by QgsRasterFileWriter).
- Since
- QGIS 3.0
Definition at line 1064 of file qgsrasterfilewriter.cpp.
◆ extensionsForFormat()
QStringList QgsRasterFileWriter::extensionsForFormat |
( |
const QString & |
format | ) |
|
|
static |
Returns a list of known file extensions for the given GDAL driver format.
E.g. returns "tif", "tiff" for the format "GTiff".
If no matching format driver is found an empty list will be returned.
Note that this method works for all GDAL drivers, including those without create support (and which are not supported by QgsRasterFileWriter).
- Since
- QGIS 3.0
Definition at line 1099 of file qgsrasterfilewriter.cpp.
◆ filterForDriver()
QString QgsRasterFileWriter::filterForDriver |
( |
const QString & |
driverName | ) |
|
|
static |
◆ maxTileHeight()
int QgsRasterFileWriter::maxTileHeight |
( |
| ) |
const |
|
inline |
◆ maxTileWidth()
int QgsRasterFileWriter::maxTileWidth |
( |
| ) |
const |
|
inline |
◆ outputFormat()
QString QgsRasterFileWriter::outputFormat |
( |
| ) |
const |
|
inline |
◆ outputProviderKey()
QString QgsRasterFileWriter::outputProviderKey |
( |
| ) |
const |
|
inline |
◆ outputUrl()
QString QgsRasterFileWriter::outputUrl |
( |
| ) |
const |
|
inline |
◆ pyramidsConfigOptions()
QStringList QgsRasterFileWriter::pyramidsConfigOptions |
( |
| ) |
const |
|
inline |
◆ pyramidsFormat()
◆ pyramidsList()
QList< int > QgsRasterFileWriter::pyramidsList |
( |
| ) |
const |
|
inline |
◆ pyramidsResampling()
QString QgsRasterFileWriter::pyramidsResampling |
( |
| ) |
const |
|
inline |
◆ setBuildPyramidsFlag()
◆ setCreateOptions()
void QgsRasterFileWriter::setCreateOptions |
( |
const QStringList & |
list | ) |
|
|
inline |
◆ setMaxTileHeight()
void QgsRasterFileWriter::setMaxTileHeight |
( |
int |
h | ) |
|
|
inline |
◆ setMaxTileWidth()
void QgsRasterFileWriter::setMaxTileWidth |
( |
int |
w | ) |
|
|
inline |
◆ setOutputFormat()
void QgsRasterFileWriter::setOutputFormat |
( |
const QString & |
format | ) |
|
|
inline |
◆ setOutputProviderKey()
void QgsRasterFileWriter::setOutputProviderKey |
( |
const QString & |
key | ) |
|
|
inline |
◆ setPyramidsConfigOptions()
void QgsRasterFileWriter::setPyramidsConfigOptions |
( |
const QStringList & |
list | ) |
|
|
inline |
◆ setPyramidsFormat()
◆ setPyramidsList()
void QgsRasterFileWriter::setPyramidsList |
( |
const QList< int > & |
list | ) |
|
|
inline |
◆ setPyramidsResampling()
void QgsRasterFileWriter::setPyramidsResampling |
( |
const QString & |
str | ) |
|
|
inline |
◆ setTiledMode()
void QgsRasterFileWriter::setTiledMode |
( |
bool |
t | ) |
|
|
inline |
◆ supportedFiltersAndFormats()
Returns a list or pairs, with format filter string as first element and GDAL format key as second element.
Relies on GDAL_DMD_EXTENSIONS metadata, if it is empty corresponding driver will be skipped even if supported.
The options argument can be used to control the sorting and filtering of returned formats.
- See also
- supportedFormatExtensions()
Definition at line 1137 of file qgsrasterfilewriter.cpp.
◆ supportedFormatExtensions()
QStringList QgsRasterFileWriter::supportedFormatExtensions |
( |
RasterFormatOptions |
options = SortRecommended | ) |
|
|
static |
◆ tiledMode()
bool QgsRasterFileWriter::tiledMode |
( |
| ) |
const |
|
inline |
◆ writeRaster() [1/2]
Write raster file.
- Parameters
-
pipe | raster pipe |
nCols | number of output columns |
nRows | number of output rows (or -1 to automatically calculate row number to have square pixels) |
outputExtent | extent to output |
crs | crs to reproject to |
transformContext | coordinate transform context |
feedback | optional feedback object for progress reports |
- Since
- QGIS 3.8
Definition at line 84 of file qgsrasterfilewriter.cpp.
◆ writeRaster() [2/2]
Write raster file.
- Parameters
-
pipe | raster pipe |
nCols | number of output columns |
nRows | number of output rows (or -1 to automatically calculate row number to have square pixels) |
outputExtent | extent to output |
crs | crs to reproject to |
feedback | optional feedback object for progress reports |
- Deprecated:
- since QGIS 3.8, use version with transformContext instead
Definition at line 78 of file qgsrasterfilewriter.cpp.
The documentation for this class was generated from the following files: