Skip to content
Permalink
Browse files

Fix rounding error while calculating output raster dimensions

This was creating artifacts in some situations (missing line
in the middle).
  • Loading branch information
elpaso committed Nov 28, 2018
1 parent e01cb7c commit 55017d7800df56acb1db087337e2d894229c7e90
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/plugins/processing/algs/qgis/RasterCalculator.py
@@ -168,8 +168,8 @@ def _cellsize(layer):

output = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)

width = math.floor((bbox.xMaximum() - bbox.xMinimum()) / cellsize)
height = math.floor((bbox.yMaximum() - bbox.yMinimum()) / cellsize)
width = round((bbox.xMaximum() - bbox.xMinimum()) / cellsize)
height = round((bbox.yMaximum() - bbox.yMinimum()) / cellsize)
driverName = GdalUtils.getFormatShortNameFromFilename(output)

calc = QgsRasterCalculator(expression,

0 comments on commit 55017d7

Please sign in to comment.
You can’t perform that action at this time.