Skip to content
Permalink
Browse files
[processing] improved SAGA multiple extents detection
  • Loading branch information
volaya committed Jul 22, 2014
1 parent f2701cb commit f6bf4f19db45ba9b51166733a5a14061d6bec423
Showing with 13 additions and 9 deletions.
  1. +13 −9 python/plugins/processing/algs/saga/SagaAlgorithm.py
@@ -80,9 +80,8 @@ def defineCharacteristicsFromFile(self):
self.undecoratedGroup = line
self.group = SagaGroupNameDecorator.getDecoratedName(
self.undecoratedGroup)
line = lines.readline().strip('\n').strip()
line = lines.readline().strip('\n').strip()
while line != '':
line = line.strip('\n').strip()
if line.startswith('Hardcoded'):
self.hardcodedStrings.append(line[len('Harcoded|') + 1:])
elif line.startswith('Parameter'):
@@ -371,19 +370,24 @@ def checkParameterValuesBeforeExecuting(self):
extent = None
for param in self.parameters:
if isinstance(param, ParameterRaster):
layer = dataobjects.getObjectFromUri(param.value)
files = [param.value]
elif isinstance(param, ParameterMultipleInput) and param.datatype == ParameterMultipleInput.TYPE_RASTER:
files = param.value.split(";")
for f in files:
layer = dataobjects.getObjectFromUri(f)
if layer is None:
continue
if layer.bandCount() > 1:
return 'Input layer ' + str(layer.name()) \
+ ' has more than one band.\n' \
+ 'Multiband layers are not supported by SAGA'
if extent is None:
extent = (layer.extent(), layer.height(), layer.width())
else:
extent2 = (layer.extent(), layer.height(), layer.width())
if extent != extent2:
return "Input layers do not have the same grid extent."
if not self.allowUnmatchingGridExtents:
if extent is None:
extent = (layer.extent(), layer.height(), layer.width())
else:
extent2 = (layer.extent(), layer.height(), layer.width())
if extent != extent2:
return "Input layers do not have the same grid extent."



0 comments on commit f6bf4f1

Please sign in to comment.