Skip to content
Permalink
Browse files

Fix parameters and support empty default values for Enums

  • Loading branch information
Médéric RIBREUX
Médéric RIBREUX committed Dec 16, 2017
1 parent a8afd12 commit 5b86407338ad0f553ecfb00105c90060fa8bd085
@@ -10,7 +10,7 @@ QgsProcessingParameterRasterLayer|transport_coeff|Name of the transport capacity
QgsProcessingParameterRasterLayer|shear_stress|Name of the critical shear stress raster map [Pa]|None|False
QgsProcessingParameterRasterLayer|man|Name of the Mannings n raster map|None|True
QgsProcessingParameterNumber|man_value|Name of the Mannings n value|QgsProcessingParameterNumber.Double|0.1|True|None|None
QgsProcessingParameterVectorLayer|observation|Sampling locations vector points|None|True
QgsProcessingParameterVectorLayer|observation|Sampling locations vector points|0|None|True
QgsProcessingParameterNumber|nwalkers|Number of walkers|QgsProcessingParameterNumber.Integer|1|True|None|None
QgsProcessingParameterNumber|niterations|Time used for iterations [minutes]|QgsProcessingParameterNumber.Integer|10|True|None|None
QgsProcessingParameterNumber|output_step|Time interval for creating output maps [minutes]|QgsProcessingParameterNumber.Integer|2|True|None|None
@@ -11,7 +11,7 @@ QgsProcessingParameterNumber|infil_value|Runoff infiltration rate unique value [
QgsProcessingParameterRasterLayer|man|Name of the Mannings n raster map|None|True
QgsProcessingParameterNumber|man_value|Manning's n unique value|QgsProcessingParameterNumber.Double|0.1|True|None|None
QgsProcessingParameterRasterLayer|flow_control|Name of the flow controls raster map (permeability ratio 0-1)|None|False
QgsProcessingParameterVectorLayer|observation|Sampling locations vector points|None|True
QgsProcessingParameterVectorLayer|observation|Sampling locations vector points|0|None|True
QgsProcessingParameterNumber|nwalkers|Number of walkers, default is twice the number of cells|QgsProcessingParameterNumber.Integer|None|True|None|None
QgsProcessingParameterNumber|niterations|Time used for iterations [minutes]|QgsProcessingParameterNumber.Integer|10|True|None|None
QgsProcessingParameterNumber|output_step|Time interval for creating output maps [minutes]|QgsProcessingParameterNumber.Integer|2|True|None|None
@@ -4,13 +4,14 @@ Vector (v.*)
QgsProcessingParameterFile|input|LiDAR input files in LAS format (*.las or *.laz)|0|las|None|False
QgsProcessingParameterExtent|spatial|Import subregion only|None|True
QgsProcessingParameterRange|zrange|Filter range for z data|QgsProcessingParameterNumber.Double|None|True
QgsProcessingParameterEnum|return_filter|first;last;mid|True|None|True
QgsProcessingParameterString|return_filter|Only import points of selected return type (Options: first, last, mid)|None|False|True
QgsProcessingParameterEnum|return_filter|Only import points of selected return type|first;last;mid|True|None|True
QgsProcessingParameterString|class_filter|Only import points of selected class(es) (comma separated integers)|None|False|True
QgsProcessingParameterNumber|skip|Do not import every n-th point|QgsProcessingParameterNumber.Integer|0|True|1|None
QgsProcessingParameterNumber|preserve|Import only every n-th point|QgsProcessingParameterNumber.Integer|0|True|1|None
QgsProcessingParameterNumber|offset|Skip first n points|QgsProcessingParameterNumber.Integer|0|True|1|None
QgsProcessingParameterNumber|limit|Import only n points|QgsProcessingParameterNumber.Integer|1|True|1|None
*QgsProcessingParameterBoolean|-t|Do not create attribute table|False
*QgsProcessingParameterBoolean|-c|Do not automatically add unique ID as category to each point|False
*QgsProcessingParameterBoolean|-b|Do not build topology|False
Hardcoded|-o
QgsProcessingParameterVectorDestination|output|Lidar
@@ -10,6 +10,6 @@ QgsProcessingParameterField|start_off|Column containing offset from milepost for
QgsProcessingParameterField|end_mp|Column containing milepost position for the end of previous segment|None|points|0|False|False
QgsProcessingParameterField|end_off|Column containing offset from milepost for the end of previous segment|None|points|0|False|False
QgsProcessingParameterNumber|threshold|Maximum distance of point to line allowed|QgsProcessingParameterNumber.Double|1.0|True|0.0|None
QgsProcessingParameterVectorDestination|out_lines|LRS lines|-1|None|False
QgsProcessingParameterVectorDestination|err|LRS Errors|-1|None|False
QgsProcessingParameterVectorDestination|rstable|RS Table|4|None|False
QgsProcessingParameterVectorDestination|out_lines|LRS lines|QgsProcessing.TypeVectorAnyGeometry|None|False
QgsProcessingParameterVectorDestination|err|LRS Errors|QgsProcessing.TypeVectorAnyGeometry|None|False
QgsProcessingParameterVectorDestination|rstable|RS Table|QgsProcessing.TypeFile|None|False
@@ -2,7 +2,7 @@ v.out.ascii
Exports a vector map to a GRASS ASCII vector representation.
Vector (v.*)
QgsProcessingParameterVectorLayer|input|Name of input vector map|-1|None|False
QgsProcessingParameterEnum|type|Input feature type|point;line;boundary;centroid;area;face;kernel|False|0,1,2,3,4,5,6|True
QgsProcessingParameterEnum|type|Input feature type|point;line;boundary;centroid;area;face;kernel|True|0,1,2,3,4,5,6|True
QgsProcessingParameterField|columns|Name of attribute column(s) to be exported|None|input|-1|True|True
QgsProcessingParameterString|where|WHERE conditions of SQL statement without 'where' keyword|None|True|True
QgsProcessingParameterEnum|format|Output format|point;standard;wkt|False|0|False
@@ -12,5 +12,5 @@ QgsProcessingParameterEnum|solver|Type of solver which should solve the symmetri
QgsProcessingParameterNumber|maxit|Maximum number of iteration used to solve the linear equation system|QgsProcessingParameterNumber.Integer|10000|True|1|None
QgsProcessingParameterNumber|error|Error break criteria for iterative solver|QgsProcessingParameterNumber.Double|0.000001|True|0.0|None
QgsProcessingParameterNumber|memory|Maximum memory to be used (in MB)|QgsProcessingParameterNumber.Integer|300|True|1|None
QgsProcessingParameterVectorDestination|output|Output vector|-1|None|True
QgsProcessingParameterVectorDestination|output|Output vector|QgsProcessing.TypeVectorAnyGeometry|None|True
QgsProcessingParameterRasterDestination|raster_output|Interpolated spline|None|True
@@ -24,7 +24,7 @@ QgsProcessingParameterRasterDestination|aspect|Aspect|None|True
QgsProcessingParameterRasterDestination|pcurvature|Profile curvature|None|True
QgsProcessingParameterRasterDestination|tcurvature|Tangential curvature|None|True
QgsProcessingParameterRasterDestination|mcurvature|Mean curvature|None|True
QgsProcessingParameterVectorDestination|deviations|Deviations|-1|None|True
QgsProcessingParameterVectorDestination|cvdev|Cross Validation Errors|-1|None|True
QgsProcessingParameterVectorDestination|treeseg|Quadtree Segmentation|-1|None|True
QgsProcessingParameterVectorDestination|overwin|Overlapping Windows|-1|None|True
QgsProcessingParameterVectorDestination|deviations|Deviations|QgsProcessing.TypeVectorAnyGeometry|None|True
QgsProcessingParameterVectorDestination|cvdev|Cross Validation Errors|QgsProcessing.TypeVectorAnyGeometry|None|True
QgsProcessingParameterVectorDestination|treeseg|Quadtree Segmentation|QgsProcessing.TypeVectorAnyGeometry|None|True
QgsProcessingParameterVectorDestination|overwin|Overlapping Windows|QgsProcessing.TypeVectorAnyGeometry|None|True
@@ -108,9 +108,9 @@ def getParameterFromString(s):
if len(params) > 4:
# For multiple values; default value is a list of int
if params[3] == True:
params[4] = [int(v) for v in params[4].split(',')]
params[4] = [int(v) for v in params[4].split(',')] if params[4] is not None else None
else:
params[4] = int(params[4])
params[4] = int(params[4]) if params[4] is not None else None
if len(params) > 5:
params[5] = True if params[5].lower() == 'true' else False
elif clazz == QgsProcessingParameterFeatureSource:
@@ -179,6 +179,8 @@ def getParameterFromString(s):
params[2] = QgsProcessing.TypeVectorAnyGeometry
elif params[2].lower().endswith('vector'):
params[2] = QgsProcessing.TypeVector
elif params[2].lower().endswith('file'):
params[2] = QgsProcessing.TypeFile
if len(params) > 4:
params[4] = True if params[4].lower() == 'true' else False

0 comments on commit 5b86407

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