Class: QgsGridFileWriter

Handles interpolation to a grid and writes the results to a raster grid file.

Methods

creationOptions

Returns the list of data source creation options which will be used when creating the output raster file.

noDataValue

Returns no data value used for output file.

setCreationOptions

Sets a list of data source creation options to use when creating the output raster file.

setNoDataValue

Set no data value for output file.

writeFile

Writes the grid file.

class qgis.analysis.QgsGridFileWriter[source]

Bases: object

__init__(interpolator: QgsInterpolator | None, outputPath: str | None, extent: QgsRectangle, nCols: int, nRows: int)

Constructor for QgsGridFileWriter, for the specified interpolator.

The outputPath argument is used to set the output file path.

The extent and nCols, nRows arguments dictate the extent and size of the output raster.

Parameters:
__init__(a0: QgsGridFileWriter)
Parameters:

a0 (QgsGridFileWriter)

creationOptions(self) List[str][source]

Returns the list of data source creation options which will be used when creating the output raster file.

Added in version 3.44.

Return type:

List[str]

noDataValue(self) float[source]

Returns no data value used for output file.

See also

setNoDataValue()

Added in version 3.44.

Return type:

float

setCreationOptions(self, options: Iterable[str | None])[source]

Sets a list of data source creation options to use when creating the output raster file.

Added in version 3.44.

Parameters:

options (Iterable[Optional[str]])

setNoDataValue(self, noDataValue: float)[source]

Set no data value for output file.

See also

noDataValue()

Added in version 3.44.

Parameters:

noDataValue (float)

writeFile(self, feedback: QgsFeedback | None = None) int[source]

Writes the grid file.

An optional feedback object can be set for progress reports and cancellation support

Return type:

int

Returns:

0 in case of success

Parameters:

feedback (Optional[QgsFeedback] = None)