Skip to content
Permalink
Browse files
Merge pull request #1512 from radosuav/small_processing_fixes_3
[Processing] Small fixes
  • Loading branch information
volaya committed Jul 22, 2014
2 parents 8f0b898 + 38390bf commit 080f2523787d4af3db472f8c6445e6452302fb92
@@ -2,6 +2,7 @@ r.fillnulls
r.fillnulls - Fills no-data areas in a raster layer using v.surf.rst splines interpolation or v.surf.bspline interpolation
Raster (r.*)
ParameterRaster|input|Input raster layer to fill|False
ParameterSelection|method|Method|bilinear;bicubic;rst|2
ParameterNumber|tension|Spline tension parameter|None|None|40.0
ParameterNumber|smooth|Spline smoothing parameter|None|None|0.1
OutputRaster|output|Filled layer
@@ -0,0 +1,10 @@
r.univar
r.univar - Calculates univariate statistics from the non-null cells of a raster map.
Raster (r.*)
ParameterMultipleInput|map|Name of input raster map(s)|3.0|False
ParameterRaster|zones|Raster map used for zoning, must be of type CELL|True
*ParameterBoolean|-e|Calculate extended statistics|False
*ParameterBoolean|-g|Print the stats in shell script style|False
*ParameterBoolean|-t|Table output format instead of standard output format|False
*ParameterNumber|percentile|Percentile to calculate (requires extended statistics flag)|0.0|100.0|90
OutputFile|output|Name for output text file
@@ -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
@@ -340,9 +340,9 @@ def processAlgorithm(self, progress):
if not found:
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, "Adapter for %s not found" % the_key)

frames = inspect.getouterframes(inspect.currentframe())[1:]
for a_frame in frames:
frame,filename,line_number,function_name,lines,index = a_frame
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, "%s %s %s %s %s %s" % (frame,filename,line_number,function_name,lines,index))
#frames = inspect.getouterframes(inspect.currentframe())[1:]
#for a_frame in frames:
# frame,filename,line_number,function_name,lines,index = a_frame
# ProcessingLog.addToLog(ProcessingLog.LOG_INFO, "%s %s %s %s %s %s" % (frame,filename,line_number,function_name,lines,index))

OTBUtils.executeOtb(commands, progress)
@@ -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>
@@ -115,7 +115,7 @@ def showFileSelectionDialog(self):
path = ''

ret = QtGui.QFileDialog.getOpenFileNames(self, 'Open file', path,
self.param.getFileFilter())
'All files(*.*);;' + self.param.getFileFilter())
if ret:
files = list(ret)
if len(files) == 1:
@@ -256,9 +256,7 @@ def processAlgorithm(self, progress):
ns = {}
ns['progress'] = progress

print self.parameters
for param in self.parameters:
print param.name
ns[param.name] = param.value

for out in self.outputs:

0 comments on commit 080f252

Please sign in to comment.