mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
add support for raster creation options to QgsNineCellFilter
This commit is contained in:
parent
a9fc31921e
commit
0fbaca4ce1
@ -58,6 +58,24 @@ mOutputFile
|
||||
double outputNodataValue() const;
|
||||
void setOutputNodataValue( double value );
|
||||
|
||||
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`
|
||||
|
||||
.. versionadded:: 3.44
|
||||
%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`
|
||||
|
||||
.. versionadded:: 3.44
|
||||
%End
|
||||
|
||||
virtual float processNineCellWindow( float *x11, float *x21, float *x31, float *x12, float *x22, float *x32, float *x13, float *x23, float *x33 ) = 0;
|
||||
%Docstring
|
||||
Calculates output value from nine input values. The input values and the
|
||||
|
@ -58,6 +58,24 @@ mOutputFile
|
||||
double outputNodataValue() const;
|
||||
void setOutputNodataValue( double value );
|
||||
|
||||
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`
|
||||
|
||||
.. versionadded:: 3.44
|
||||
%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`
|
||||
|
||||
.. versionadded:: 3.44
|
||||
%End
|
||||
|
||||
virtual float processNineCellWindow( float *x11, float *x21, float *x31, float *x12, float *x22, float *x32, float *x13, float *x23, float *x33 ) = 0;
|
||||
%Docstring
|
||||
Calculates output value from nine input values. The input values and the
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <QFileInfo>
|
||||
#include <iterator>
|
||||
|
||||
|
||||
QgsNineCellFilter::QgsNineCellFilter( const QString &inputFile, const QString &outputFile, const QString &outputFormat )
|
||||
: mInputFile( inputFile )
|
||||
, mOutputFile( outputFile )
|
||||
@ -129,7 +128,7 @@ gdal::dataset_unique_ptr QgsNineCellFilter::openOutputFile( GDALDatasetH inputDa
|
||||
const int ySize = GDALGetRasterYSize( inputDataset );
|
||||
|
||||
//open output file
|
||||
char **papszOptions = nullptr;
|
||||
char **papszOptions = QgsGdalUtils::papszFromStringList( mCreateOptions );
|
||||
gdal::dataset_unique_ptr outputDataset( GDALCreate( outputDriver, mOutputFile.toUtf8().constData(), xSize, ySize, 1, GDT_Float32, papszOptions ) );
|
||||
if ( !outputDataset )
|
||||
{
|
||||
|
@ -61,6 +61,22 @@ class ANALYSIS_EXPORT QgsNineCellFilter
|
||||
double outputNodataValue() const { return mOutputNodataValue; }
|
||||
void setOutputNodataValue( double value ) { mOutputNodataValue = value; }
|
||||
|
||||
/**
|
||||
* Sets a list of data source creation options to use when creating the output raster file.
|
||||
*
|
||||
* \see createOptions()
|
||||
* \since QGIS 3.44
|
||||
*/
|
||||
void setCreateOptions( const QStringList &list ) { mCreateOptions = list; }
|
||||
|
||||
/**
|
||||
* Returns the list of data source creation options which will be used when creating the output raster file.
|
||||
*
|
||||
* \see setCreateOptions()
|
||||
* \since QGIS 3.44
|
||||
*/
|
||||
QStringList createOptions() const { return mCreateOptions; }
|
||||
|
||||
/**
|
||||
* Calculates output value from nine input values. The input values and the output
|
||||
* value can be equal to the nodata value if not present or outside of the border.
|
||||
@ -138,6 +154,7 @@ class ANALYSIS_EXPORT QgsNineCellFilter
|
||||
QString mInputFile;
|
||||
QString mOutputFile;
|
||||
QString mOutputFormat;
|
||||
QStringList mCreateOptions;
|
||||
|
||||
double mCellSizeX = -1.0;
|
||||
double mCellSizeY = -1.0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user