Skip to content

Commit

Permalink
[sextante] added multiband check in SAGA algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Mar 12, 2013
1 parent 34ce6f9 commit b53b7fe
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions python/plugins/sextante/saga/SagaAlgorithm.py
Expand Up @@ -47,9 +47,7 @@
from sextante.parameters.ParameterNumber import ParameterNumber
from sextante.parameters.ParameterSelection import ParameterSelection
from sextante.core.LayerExporter import LayerExporter
import subprocess
from sextante.parameters.ParameterExtent import ParameterExtent
from PyQt4 import QtGui
from sextante.parameters.ParameterFixedTable import ParameterFixedTable
from sextante.core.SextanteLog import SextanteLog

Expand Down Expand Up @@ -367,6 +365,17 @@ def exportRasterLayer(self, layer):

def checkBeforeOpeningParametersDialog(self):
return SagaUtils.checkSagaIsInstalled()


def checkParameterValuesBeforeExecuting(self):
'''We check that there are no multiband layers, which are not supported by SAGA'''
for param in self.parameters:
if isinstance(param, ParameterRaster):
value = param.value
layer = QGisLayers.getObjectFromUri(value)
if layer is not None and layer.bandCount() > 1:
return ("Input layer " + str(layer.name()) + " has more than one band.\n"
+ "Multiband layers are not supported by SAGA")


def helpFile(self):
Expand Down

0 comments on commit b53b7fe

Please sign in to comment.