Skip to content

Commit 2dbc903

Browse files
author
cpolymeris@gmail.com
committed
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
1 parent 180e692 commit 2dbc903

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sextante/otb/OTBAlgorithm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ def defineCharacteristicsFromFile(self):
6767
param.default = OTBUtils.otbGeoidPath()
6868
self.addParameter(param)
6969
elif line.startswith("Extent"):
70-
self.extentParamNames = line[6:].strip().split(" ")
7170
self.addParameter(ParameterExtent(self.REGION_OF_INTEREST, "Region of interest", "0,1,0,1"))
72-
self.roiFile = SextanteUtils.getTempFilename('tif')
7371
else:
7472
self.addOutput(OutputFactory.getFromString(line))
7573
line = lines.readline().strip("\n").strip()
@@ -88,6 +86,7 @@ def processAlgorithm(self, progress):
8886
commands = []
8987
commands.append(path + os.sep + self.cliName)
9088

89+
self.roiRasters = {}
9190
for param in self.parameters:
9291
if param.value == None or param.value == "":
9392
continue
@@ -97,8 +96,9 @@ def processAlgorithm(self, progress):
9796
if isinstance(param, ParameterRaster):
9897
commands.append(param.name)
9998
if self.roiFile:
100-
commands.append(self.roiFile)
101-
self.roiInput = param.value
99+
roiFile = SextanteUtils.getTempFilename('tif')
100+
commands.append(roiFile)
101+
self.roiRasters[param.value] = roiFile
102102
else:
103103
commands.append(param.value)
104104
elif isinstance(param, ParameterMultipleInput):
@@ -122,7 +122,7 @@ def processAlgorithm(self, progress):
122122
commands.append(out.name)
123123
commands.append(out.value)
124124

125-
if self.roiFile:
125+
for roiInput, roiFile in self.roiRasters.items():
126126
startX, startY = float(self.roiValues[0]), float(self.roiValues[1])
127127
sizeX = float(self.roiValues[2]) - startX
128128
sizeY = float(self.roiValues[3]) - startY

0 commit comments

Comments
 (0)