Skip to content
Permalink
Browse files

fixed bad behaviour with fixed tables

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@225 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf
volayaf committed Jun 5, 2012
1 parent 5d95354 commit 69e588c930a9660d0e7fd855a8ea7a2c62d89e17
@@ -26,6 +26,7 @@
import subprocess
from sextante.parameters.ParameterExtent import ParameterExtent
from PyQt4 import QtGui
from sextante.parameters.ParameterFixedTable import ParameterFixedTable

class SagaAlgorithm(GeoAlgorithm):

@@ -220,6 +221,16 @@ def processAlgorithm(self, progress):
elif isinstance(param, ParameterBoolean):
if param.value:
command+=(" -" + param.name);
elif isinstance(param, ParameterFixedTable):
tempTableFile = SextanteUtils.getTempFilename("txt")
f = open(tempTableFile, "w")
f.write('\t'.join([col for col in param.cols]) + "\n")
values = param.value.split(",")
for i in range(0, len(values), 3):
s = values[i] + "\t" + values[i+1] + "\t" + values[i+2] + "\n"
f.write(s)
f.close()
command+=( " -" + param.name + " " + tempTableFile)
elif isinstance(param, ParameterExtent):
values = param.value.split(",")
for i in range(4):
@@ -2,5 +2,5 @@ Change Grid Values
grid_tools
ParameterRaster|GRID_IN|Grid|False
ParameterSelection|METHOD|Replace Condition|[0] Grid value equals low value;[1] Low value < grid value < high value;[2] Low value <= grid value < high value
ParameterFixedTable|LOOKUP|Lookup Table|3| Low Value; High Value; Replace with|False
ParameterFixedTable|LOOKUP|Lookup Table|3|Low Value;High Value;Replace with|False
OutputRaster|GRID_OUT|Changed Grid
@@ -2,5 +2,5 @@ Combine Grids
grid_tools
ParameterRaster|GRID1|Grid 1|False
ParameterRaster|GRID2|Grid 2|False
ParameterFixedTable|LOOKUP|LookUp Table|3| Value in Grid 1; Value in Grid 2; Resulting Value|False
ParameterFixedTable|LOOKUP|LookUp Table|3|Value in Grid 1;Value in Grid 2;Resulting Value|False
OutputRaster|RESULT|Result
@@ -1,5 +1,5 @@
Ordered Weighted Averaging (OWA)
grid_analysis
ParameterMultipleInput|GRIDS|Input Grids|3|False
ParameterFixedTable|WEIGHTS|Weights|3| Weight|False
ParameterFixedTable|WEIGHTS|Weights|3|Weight|False
OutputRaster|OUTPUT|Output Grid
@@ -2,7 +2,7 @@ Polynomial Trend from Grids
grid_calculus
ParameterMultipleInput|GRIDS|Dependent Variables|3.0|False
ParameterMultipleInput|Y_GRIDS|Independent Variable (per Grid and Cell)|3.0|True
ParameterFixedTable|Y_TABLE|Independent Variable (per Grid)|3| Value|False
ParameterFixedTable|Y_TABLE|Independent Variable (per Grid)|3|Value|False
ParameterSelection|POLYNOM|Type of Approximated Function|[0] first order polynom (linear regression);[1] second order polynom;[2] third order polynom;[3] fourth order polynom;[4] fifth order polynom
OutputRaster|PARMS|Polynomial Coefficients
OutputRaster|QUALITY|Coefficient of Determination
@@ -9,7 +9,7 @@ ParameterNumber|MIN|minimum value (for range)|None|None|0
ParameterNumber|MAX|maximum value (for range)|None|None|1
ParameterNumber|RNEW|new value(for range)|None|None|2
ParameterSelection|ROPERATOR|operator (for range)|[0] <=;[1] <
ParameterFixedTable|RETAB|Lookup Table|3| minimum; maximum; new|False
ParameterFixedTable|RETAB|Lookup Table|3|minimum;maximum;new|False
ParameterSelection|TOPERATOR|operator (for table)|[0] min <= value < max;[1] min <= value <= max;[2] min < value <= max;[3] min < value < max
ParameterBoolean|NODATAOPT |replace no data values|True
ParameterNumber|NODATA|new value for no data values|None|None|0
@@ -2,5 +2,5 @@ User Defined Filter
grid_filter
ParameterRaster|INPUT|Grid|False
ParameterTable|FILTER|Filter Matrix|True
ParameterFixedTable|FILTER_3X3|Default Filter Matrix (3x3)|3| 1; 2; 3|True
ParameterFixedTable|FILTER_3X3|Default Filter Matrix (3x3)|3|1;2;3|True
OutputRaster|RESULT|Filtered Grid

0 comments on commit 69e588c

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