mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[processing] only pass needed raster entries in QgsRasterCalculator constructor
This commit is contained in:
parent
5fa5b868f8
commit
9562b9dad2
@ -165,11 +165,13 @@ class RasterCalculator(QgisAlgorithm):
|
||||
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user