Skip to content
Permalink
Browse files

[processing] only pass needed raster entries in QgsRasterCalculator c…

…onstructor
  • Loading branch information
nirvn committed Feb 9, 2018
1 parent 5fa5b86 commit 9562b9dad2759c44043b7994647bdb2a0b35b355
Showing with 7 additions and 5 deletions.
  1. +7 −5 python/plugins/processing/algs/qgis/RasterCalculator.py
@@ -165,11 +165,13 @@ def _cellsize(layer):
entries = []
for name, lyr in layersDict.items():
for n in range(lyr.bandCount()):
entry = QgsRasterCalculatorEntry()
entry.ref = '{:s}@{:d}'.format(name, n + 1)
entry.raster = lyr
entry.bandNumber = n + 1
entries.append(entry)
ref = '{:s}@{:d}'.format(name, n + 1)
if ref in expression:
entry = QgsRasterCalculatorEntry()
entry.ref = ref
entry.raster = lyr
entry.bandNumber = n + 1
entries.append(entry)

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

0 comments on commit 9562b9d

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