Skip to content

Commit

Permalink
OTB ROI: support multiple input rasters
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@259 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com committed Jun 22, 2012
1 parent 180e692 commit 2dbc903
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/sextante/otb/OTBAlgorithm.py
Expand Up @@ -67,9 +67,7 @@ def defineCharacteristicsFromFile(self):
param.default = OTBUtils.otbGeoidPath()
self.addParameter(param)
elif line.startswith("Extent"):
self.extentParamNames = line[6:].strip().split(" ")
self.addParameter(ParameterExtent(self.REGION_OF_INTEREST, "Region of interest", "0,1,0,1"))
self.roiFile = SextanteUtils.getTempFilename('tif')
else:
self.addOutput(OutputFactory.getFromString(line))
line = lines.readline().strip("\n").strip()
Expand All @@ -88,6 +86,7 @@ def processAlgorithm(self, progress):
commands = []
commands.append(path + os.sep + self.cliName)

self.roiRasters = {}
for param in self.parameters:
if param.value == None or param.value == "":
continue
Expand All @@ -97,8 +96,9 @@ def processAlgorithm(self, progress):
if isinstance(param, ParameterRaster):
commands.append(param.name)
if self.roiFile:
commands.append(self.roiFile)
self.roiInput = param.value
roiFile = SextanteUtils.getTempFilename('tif')
commands.append(roiFile)
self.roiRasters[param.value] = roiFile
else:
commands.append(param.value)
elif isinstance(param, ParameterMultipleInput):
Expand All @@ -122,7 +122,7 @@ def processAlgorithm(self, progress):
commands.append(out.name)
commands.append(out.value)

if self.roiFile:
for roiInput, roiFile in self.roiRasters.items():
startX, startY = float(self.roiValues[0]), float(self.roiValues[1])
sizeX = float(self.roiValues[2]) - startX
sizeY = float(self.roiValues[3]) - startY
Expand Down

0 comments on commit 2dbc903

Please sign in to comment.