Skip to content

Commit b53b7fe

Browse files
committedMar 12, 2013
[sextante] added multiband check in SAGA algorithms
1 parent 34ce6f9 commit b53b7fe

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed
 

‎python/plugins/sextante/saga/SagaAlgorithm.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
from sextante.parameters.ParameterNumber import ParameterNumber
4848
from sextante.parameters.ParameterSelection import ParameterSelection
4949
from sextante.core.LayerExporter import LayerExporter
50-
import subprocess
5150
from sextante.parameters.ParameterExtent import ParameterExtent
52-
from PyQt4 import QtGui
5351
from sextante.parameters.ParameterFixedTable import ParameterFixedTable
5452
from sextante.core.SextanteLog import SextanteLog
5553

@@ -367,6 +365,17 @@ def exportRasterLayer(self, layer):
367365

368366
def checkBeforeOpeningParametersDialog(self):
369367
return SagaUtils.checkSagaIsInstalled()
368+
369+
370+
def checkParameterValuesBeforeExecuting(self):
371+
'''We check that there are no multiband layers, which are not supported by SAGA'''
372+
for param in self.parameters:
373+
if isinstance(param, ParameterRaster):
374+
value = param.value
375+
layer = QGisLayers.getObjectFromUri(value)
376+
if layer is not None and layer.bandCount() > 1:
377+
return ("Input layer " + str(layer.name()) + " has more than one band.\n"
378+
+ "Multiband layers are not supported by SAGA")
370379

371380

372381
def helpFile(self):

0 commit comments

Comments
 (0)
Please sign in to comment.