Skip to content

Commit

Permalink
[processing] improved SAGA multiple extents detection
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Jul 22, 2014
1 parent f2701cb commit f6bf4f1
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions python/plugins/processing/algs/saga/SagaAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down Expand Up @@ -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."



Expand Down

0 comments on commit f6bf4f1

Please sign in to comment.