Skip to content

Commit

Permalink
[processing] only pass needed raster entries in QgsRasterCalculator c…
Browse files Browse the repository at this point in the history
…onstructor
  • Loading branch information
nirvn committed Feb 9, 2018
1 parent 5fa5b86 commit 9562b9d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/plugins/processing/algs/qgis/RasterCalculator.py
Expand Up @@ -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)

Expand Down

0 comments on commit 9562b9d

Please sign in to comment.