Skip to content
Permalink
Browse files
[Processing] Hide some OTB params under Advanced button and improve h…
…andling of advanced parameters
  • Loading branch information
Rado Guzinski committed Jul 22, 2014
1 parent 2f32e78 commit f511bf95b798c885948138857735331d61b4c6a7
@@ -146,18 +146,18 @@ def defineCharacteristicsFromFile(self):

for line in the_result:
try:
if line.startswith("Parameter"):
param = getParameterFromString(line)
if line.startswith("Parameter") or line.startswith("*Parameter"):
if line.startswith("*Parameter"):
param = ParameterFactory.getFromString(line[1:])
param.isAdvanced = True
else:
param = getParameterFromString(line)
# Hack for initializing the elevation parameters from Processing configuration
if param.name == "-elev.dem.path" or param.name == "-elev.dem" or "elev.dem" in param.name:
param.default = OTBUtils.otbSRTMPath()
elif param.name == "-elev.dem.geoid" or param.name == "-elev.geoid" or "elev.geoid" in param.name:
param.default = OTBUtils.otbGeoidPath()
self.addParameter(param)
elif line.startswith("*Parameter"):
param = getParameterFromString(line[1:])
param.isAdvanced = True
self.addParameter(param)
elif line.startswith("Extent"):
self.addParameter(ParameterExtent(self.REGION_OF_INTEREST, "Region of interest", "0,1,0,1"))
self.hasROI = True
@@ -43,7 +43,7 @@
<hidden />
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
<key>elev.default</key>
<name>Default elevation</name>
<description>This parameter allows setting the default height above ellipsoid when there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles, and no geoid file has been set. This is also used by some application as an average elevation value.</description>
@@ -52,7 +52,7 @@
<default>0</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Int">ParameterNumber</parameter_type>
<parameter_type source_parameter_type="ParameterType_Int">*ParameterNumber</parameter_type>
<key>sample.mt</key>
<name>Maximum training sample size per class</name>
<description>Maximum size per class (in pixels) of the training sample list (default = 1000) (no limit = -1). If equal to -1, then the maximal size of the available training sample list per class will be equal to the surface area of the smallest class multiplied by the training sample ratio.</description>
@@ -61,7 +61,7 @@
<default>1000</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Int">ParameterNumber</parameter_type>
<parameter_type source_parameter_type="ParameterType_Int">*ParameterNumber</parameter_type>
<key>sample.mv</key>
<name>Maximum validation sample size per class</name>
<description>Maximum size per class (in pixels) of the validation sample list (default = 1000) (no limit = -1). If equal to -1, then the maximal size of the available validation sample list per class will be equal to the surface area of the smallest class multiplied by the validation sample ratio.</description>
@@ -70,7 +70,7 @@
<default>1000</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Empty">ParameterBoolean</parameter_type>
<parameter_type source_parameter_type="ParameterType_Empty">*ParameterBoolean</parameter_type>
<key>sample.edg</key>
<name>On edge pixel inclusion</name>
<description>Takes pixels on polygon edge into consideration when building training and validation samples.</description>
@@ -107,7 +107,7 @@
<default>0</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Choice">ParameterSelection</parameter_type>
<parameter_type source_parameter_type="ParameterType_Choice">*ParameterSelection</parameter_type>
<key>classifier.svm.m</key>
<name>SVM Model Type</name>
<description>Type of SVM formulation.</description>
@@ -145,7 +145,7 @@
<default>1</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
<key>classifier.svm.nu</key>
<name>Parameter nu of a SVM optimization problem (NU_SVC / ONE_CLASS)</name>
<description>Parameter nu of a SVM optimization problem.</description>
@@ -154,7 +154,7 @@
<default>0</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
<key>classifier.svm.coef0</key>
<name>Parameter coef0 of a kernel function (POLY / SIGMOID)</name>
<description>Parameter coef0 of a kernel function (POLY / SIGMOID).</description>
@@ -163,7 +163,7 @@
<default>0</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
<key>classifier.svm.gamma</key>
<name>Parameter gamma of a kernel function (POLY / RBF / SIGMOID)</name>
<description>Parameter gamma of a kernel function (POLY / RBF / SIGMOID).</description>
@@ -172,7 +172,7 @@
<default>1</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Float">ParameterNumber</parameter_type>
<parameter_type source_parameter_type="ParameterType_Float">*ParameterNumber</parameter_type>
<key>classifier.svm.degree</key>
<name>Parameter degree of a kernel function (POLY)</name>
<description>Parameter degree of a kernel function (POLY).</description>
@@ -191,7 +191,7 @@
<default>True</default>
</parameter>
<parameter>
<parameter_type source_parameter_type="ParameterType_Int">ParameterNumber</parameter_type>
<parameter_type source_parameter_type="ParameterType_Int">*ParameterNumber</parameter_type>
<key>rand</key>
<name>set user defined seed</name>
<description>Set specific seed. with integer value.</description>

0 comments on commit f511bf9

Please sign in to comment.