Skip to content

Commit

Permalink
[processing] Fix create constant raster layer modifies pixel size
Browse files Browse the repository at this point in the history
Fixes #18446
  • Loading branch information
nyalldawson committed Jun 5, 2018
1 parent d9336c2 commit 8c689b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/CreateConstantRaster.py
Expand Up @@ -87,8 +87,8 @@ def processAlgorithm(self, parameters, context, feedback):
outputFile = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
outputFormat = QgsRasterFileWriter.driverForExtension(os.path.splitext(outputFile)[1])

rows = max([math.ceil(extent.height() / pixelSize) + 1, 1.0])
cols = max([math.ceil(extent.width() / pixelSize) + 1, 1.0])
rows = max([math.ceil(extent.height() / pixelSize), 1.0])
cols = max([math.ceil(extent.width() / pixelSize), 1.0])

writer = QgsRasterFileWriter(outputFile)
writer.setOutputProviderKey('gdal')
Expand Down
Expand Up @@ -1652,7 +1652,7 @@ tests:
NUMBER: 3.0
results:
OUTPUT:
hash: e453e9e36ce314d5197963ac27872a0cc3dfe43764ed586a334c66f0
hash: 56172fe81f40efba9fadcaeccdbab247e99c8725990a94d9609769f6
type: rasterhash

- algorithm: native:lineintersections
Expand Down

0 comments on commit 8c689b2

Please sign in to comment.