Skip to content
Permalink
Browse files

[processing][saga] Fix misleading 'layer could not be generated' error

after running algorithms which create raster files
  • Loading branch information
nyalldawson authored and github-actions committed Mar 24, 2021
1 parent 54329bf commit 20c6aa3d50d22b4303a67d7820ce304ce09ab312
Showing with 5 additions and 5 deletions.
  1. +5 −5 python/plugins/processing/algs/saga/SagaAlgorithm.py
@@ -328,11 +328,11 @@ def processAlgorithm(self, parameters, context, feedback):

# special treatment for RGB algorithm
# TODO: improve this and put this code somewhere else
for out in self.destinationParameterDefinitions():
if isinstance(out, QgsProcessingParameterRasterDestination):
filename = self.parameterAsOutputLayer(parameters, out.name(), context)
filename2 = os.path.splitext(filename)[0] + '.sgrd'
if self.cmdname == 'RGB Composite':
if self.cmdname == 'RGB Composite':
for out in self.destinationParameterDefinitions():
if isinstance(out, QgsProcessingParameterRasterDestination):
filename = self.parameterAsOutputLayer(parameters, out.name(), context)
filename2 = os.path.splitext(filename)[0] + '.sgrd'
commands.append('io_grid_image 0 -COLOURING 4 -GRID:"{}" -FILE:"{}"'.format(filename2, filename))

# 3: Run SAGA

0 comments on commit 20c6aa3

Please sign in to comment.