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 committed Mar 24, 2021
1 parent 3660249 commit 286fd207c42b11b4b8cc980f446088201ec1a5fa
Showing with 5 additions and 5 deletions.
  1. +5 −5 python/plugins/processing/algs/saga/SagaAlgorithm.py
@@ -327,11 +327,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 286fd20

Please sign in to comment.