mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Update CreateConstantRaster.py
Cast cols (and rows) to int to fix the error. Fixes: #32827
This commit is contained in:
parent
f67369cc26
commit
59292b47c7
@ -84,8 +84,8 @@ class CreateConstantRaster(QgisAlgorithm):
|
|||||||
outputFile = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
|
outputFile = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
|
||||||
outputFormat = QgsRasterFileWriter.driverForExtension(os.path.splitext(outputFile)[1])
|
outputFormat = QgsRasterFileWriter.driverForExtension(os.path.splitext(outputFile)[1])
|
||||||
|
|
||||||
rows = max([math.ceil(extent.height() / pixelSize), 1.0])
|
rows = int(max([math.ceil(extent.height() / pixelSize), 1.0]))
|
||||||
cols = max([math.ceil(extent.width() / pixelSize), 1.0])
|
cols = int(max([math.ceil(extent.width() / pixelSize), 1.0]))
|
||||||
|
|
||||||
writer = QgsRasterFileWriter(outputFile)
|
writer = QgsRasterFileWriter(outputFile)
|
||||||
writer.setOutputProviderKey('gdal')
|
writer.setOutputProviderKey('gdal')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user