Skip to content
Permalink
Browse files

OTB ROI: support multiple input rasters

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
cpolymeris@gmail.com committed Jun 22, 2012
1 parent 180e692 commit 2dbc903289c64c5e6a112fbed6e4181cd04934f5
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/sextante/otb/OTBAlgorithm.py
@@ -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()
@@ -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
@@ -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):
@@ -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

0 comments on commit 2dbc903

Please sign in to comment.
You can’t perform that action at this time.