/************************************************************************ * This file has been generated automatically from * * * * src/core/raster/qgsrasterfilewriter.h * * * * Do not edit manually ! Edit header and run scripts/sipify.py again * ************************************************************************/ class QgsRasterFileWriter { %Docstring(signature="appended") The raster file writer which allows you to save a raster to a new file. The writer defaults to creating GeoTIFF outputs using GDAL. Alternative formats and data providers can be used by calling :py:func:`~setOutputFormat` and :py:func:`~setOutputProviderKey`. %End %TypeHeaderCode #include "qgsrasterfilewriter.h" %End public: enum RasterFormatOption { SortRecommended, }; typedef QFlags RasterFormatOptions; QgsRasterFileWriter( const QString &outputUrl ); %Docstring Constructor for QgsRasterFileWriter, writing to the specified output URL/filename. %End QgsRasterDataProvider *createOneBandRaster( Qgis::DataType dataType, int width, int height, const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs ) /Factory/; %Docstring Create a raster file with one band without initializing the pixel data. Returned provider may be used to initialize the raster using :py:func:`~QgsRasterFileWriter.writeBlock` calls. Ownership of the returned provider is passed to the caller. :return: Instance of data provider in editing mode (on success) or ``None`` on error. .. note:: Does not work with tiled mode enabled. %End QgsRasterDataProvider *createMultiBandRaster( Qgis::DataType dataType, int width, int height, const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs, int nBands ) /Factory/; %Docstring Create a raster file with given number of bands without initializing the pixel data. Returned provider may be used to initialize the raster using :py:func:`~QgsRasterFileWriter.writeBlock` calls. Ownership of the returned provider is passed to the caller. :return: Instance of data provider in editing mode (on success) or ``None`` on error. .. note:: Does not work with tiled mode enabled. %End Qgis::RasterFileWriterResult writeRaster( const QgsRasterPipe *pipe, int nCols, int nRows, const QgsRectangle &outputExtent, const QgsCoordinateReferenceSystem &crs, QgsRasterBlockFeedback *feedback = 0 ) /Deprecated/; %Docstring Write raster file :param pipe: raster pipe :param nCols: number of output columns :param nRows: number of output rows (or -1 to automatically calculate row number to have square pixels) :param outputExtent: extent to output :param crs: crs to reproject to :param feedback: optional feedback object for progress reports .. deprecated:: 3.8 Use version with transformContext instead. %End Qgis::RasterFileWriterResult writeRaster( const QgsRasterPipe *pipe, int nCols, int nRows, const QgsRectangle &outputExtent, const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &transformContext, QgsRasterBlockFeedback *feedback = 0 ); %Docstring Write raster file :param pipe: raster pipe :param nCols: number of output columns :param nRows: number of output rows (or -1 to automatically calculate row number to have square pixels) :param outputExtent: extent to output :param crs: crs to reproject to :param transformContext: coordinate transform context :param feedback: optional feedback object for progress reports .. versionadded:: 3.8 %End QString outputUrl() const; %Docstring Returns the output URL (filename) for the raster. %End void setOutputFormat( const QString &format ); %Docstring Sets the output ``format``. For GDAL disk based outputs this should match the GDAL driver name, e.g. "GTiff" for GeoTiff exports. .. seealso:: :py:func:`outputFormat` %End QString outputFormat() const; %Docstring Returns the output format. For GDAL disk based outputs this will match the GDAL driver name, e.g. "GTiff" for GeoTiff exports. .. seealso:: :py:func:`setOutputFormat` %End void setOutputProviderKey( const QString &key ); %Docstring Sets the name of the data provider for the raster output. E.g. set to "gdal" to use GDAL to create disk based raster files. .. seealso:: :py:func:`outputProviderKey` %End QString outputProviderKey() const; %Docstring Returns the name of the data provider for the raster output. .. seealso:: :py:func:`setOutputProviderKey` %End void setTiledMode( bool t ); %Docstring Sets whether the output should be tiled. Tiled outputs will automatically split the raster into multiple parts, based on the :py:func:`~QgsRasterFileWriter.maxTileWidth` value. .. seealso:: :py:func:`tiledMode` %End bool tiledMode() const; %Docstring Returns whether the output will be tiled. .. seealso:: :py:func:`setTiledMode` %End void setMaxTileWidth( int w ); %Docstring Sets the maximum tile width (in pixels) for tiled outputs. .. seealso:: :py:func:`maxTileWidth` .. seealso:: :py:func:`setMaxTileHeight` .. seealso:: :py:func:`tiledMode` %End int maxTileWidth() const; %Docstring Returns the maximum tile width (in pixels) for tiled outputs. .. seealso:: :py:func:`maxTileHeight` .. seealso:: :py:func:`setMaxTileWidth` .. seealso:: :py:func:`tiledMode` %End Qgis::RasterBuildPyramidOption buildPyramidsFlag() const; %Docstring Returns the pyramid building option. .. seealso:: :py:func:`setBuildPyramidsFlag` %End void setBuildPyramidsFlag( Qgis::RasterBuildPyramidOption f ); %Docstring Sets the pyramid building option. .. seealso:: :py:func:`buildPyramidsFlag` %End QList< int > pyramidsList() const; %Docstring Returns the list of pyramids which will be created for the output file. .. seealso:: :py:func:`setPyramidsList` %End void setPyramidsList( const QList< int > &list ); %Docstring Sets the ``list`` of pyramids which will be created for the output file. .. seealso:: :py:func:`pyramidsList` %End QString pyramidsResampling() const; void setPyramidsResampling( const QString &str ); Qgis::RasterPyramidFormat pyramidsFormat() const; %Docstring Returns the raster pyramid format. .. seealso:: :py:func:`setPyramidsFormat` %End void setPyramidsFormat( Qgis::RasterPyramidFormat f ); %Docstring Sets the raster pyramid format. .. seealso:: :py:func:`pyramidsFormat` %End void setMaxTileHeight( int h ); %Docstring Sets the maximum tile height (in pixels) for tiled outputs. .. seealso:: :py:func:`maxTileHeight` .. seealso:: :py:func:`setMaxTileWidth` .. seealso:: :py:func:`tiledMode` %End int maxTileHeight() const; %Docstring Returns the maximum tile height (in pixels) for tiled outputs. .. seealso:: :py:func:`maxTileWidth` .. seealso:: :py:func:`setMaxTileHeight` .. seealso:: :py:func:`tiledMode` %End void setCreateOptions( const QStringList &list ); %Docstring Sets a list of data source creation options to use when creating the output raster file. .. seealso:: :py:func:`createOptions` %End QStringList createOptions() const; %Docstring Returns the list of data source creation options which will be used when creating the output raster file. .. seealso:: :py:func:`setCreateOptions` %End void setPyramidsConfigOptions( const QStringList &list ); %Docstring Sets a ``list`` of configuration options to use when creating the pyramids for the output raster file. .. seealso:: :py:func:`pyramidsConfigOptions` %End QStringList pyramidsConfigOptions() const; %Docstring Returns the list of configuration options used when creating the pyramids for the output raster file. .. seealso:: :py:func:`setPyramidsConfigOptions` %End static QString filterForDriver( const QString &driverName ); %Docstring Creates a filter for an GDAL driver key %End struct FilterFormatDetails { QString driverName; QString filterString; }; static QList< QgsRasterFileWriter::FilterFormatDetails > supportedFiltersAndFormats( RasterFormatOptions options = SortRecommended ); %Docstring 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. .. seealso:: :py:func:`supportedFormatExtensions` %End static QStringList supportedFormatExtensions( RasterFormatOptions options = SortRecommended ); %Docstring Returns a list of file extensions for supported formats. The ``options`` argument can be used to control the sorting and filtering of returned formats. .. seealso:: :py:func:`supportedFiltersAndFormats` %End static QString driverForExtension( const QString &extension ); %Docstring 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). %End static QStringList extensionsForFormat( const QString &format ); %Docstring 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). %End }; /************************************************************************ * This file has been generated automatically from * * * * src/core/raster/qgsrasterfilewriter.h * * * * Do not edit manually ! Edit header and run scripts/sipify.py again * ************************************************************************/