Skip to content

Commit

Permalink
Fix QgsProcessingParameterFile bad descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Médéric RIBREUX committed Dec 27, 2017
1 parent 433d376 commit 3fa9e3c
Show file tree
Hide file tree
Showing 73 changed files with 90 additions and 126 deletions.
5 changes: 2 additions & 3 deletions python/plugins/processing/algs/grass7/Grass7Algorithm.py
Expand Up @@ -626,7 +626,6 @@ def loadRasterLayerFromParameter(self, name, parameters, context, external=True,
:param band: imports only specified band. None for all bands.
"""
layer = self.parameterAsRasterLayer(parameters, name, context)
QgsMessageLog.logMessage('raster: {0}'.format(name), 'DEBUG', QgsMessageLog.INFO)
self.loadRasterLayer(name, layer, external, band)

def loadRasterLayer(self, name, layer, external=True, band=1):
Expand Down Expand Up @@ -723,7 +722,7 @@ def exportRasterLayersIntoDirectory(self, name, parameters, context, colorTable=
)
cmd.append("done")

def loadVectorLayerFromParameter(self, name, parameters, context, external=None):
def loadVectorLayerFromParameter(self, name, parameters, context, external=False):
"""
Creates a dedicated command to load a vector into
the temporary GRASS DB.
Expand All @@ -735,7 +734,7 @@ def loadVectorLayerFromParameter(self, name, parameters, context, external=None)
layer = self.parameterAsVectorLayer(parameters, name, context)
self.loadVectorLayer(name, layer, external)

def loadVectorLayer(self, name, layer, external=None):
def loadVectorLayer(self, name, layer, external=False):
"""
Creates a dedicated command to load a vector into
temporary GRASS DB.
Expand Down
16 changes: 5 additions & 11 deletions python/plugins/processing/algs/grass7/TODO.md
Expand Up @@ -5,24 +5,17 @@ QGIS3 Processing Port

* TODO Convert all ext scripts.
* Review i.py.
* Force projection in description file?
* Use a message band rather than a messageBox for errors on exclusives parameters.
* r_rgb.py
* r_blend_combine.py
* r_blend_rgb.py
* r_drain.py
* r_horizon.py
* r_mask.py
* r_mask_vect.py
* r_mask_rast.py
* r_null.py
* r_statistics.py
* v_voronoi.py
* v_build_polylines.py => TO delete.
* v_in_geonames.py.
* v_sample.py.
* v_to_3d.py.
* v_pack.py.
* v_what_vect.py => TO delete.
* v_what_rast_points.py.
* v_what_rast_centroids.py.
* v_vect_stats.py
Expand All @@ -41,6 +34,7 @@ QGIS3 Processing Port
* v_net_steiner.py
* v_net_visibility.py
* Things to do elsewhere
* TODO QgsProcessingParameterPoint can't be used anymore.
* TODO We need NULL QgsProcessingParameterPoint!
* TODO We need a QgsParameterMultipleInputLayers parameter for minimum and maximum number of layers.
* TODO Open all the files in a QgsProcessingOutputFolder at the end of the algorithm.
Expand All @@ -53,9 +47,6 @@ QGIS3 Processing Port
* TODO Improve unit tests.
* TODO Use prepareAlgorithm for algorithm preparation.
* TODO Support ParameterTable.
* TODO Support multiple output vector formats.
* TODO Try to use v.external.out on simple algorithms.
* TODO Add an optional/advanced 'format option' textbox if vector output is detected.
* TODO Support multiple input vector formats
* DONE create a general inputVectorLayer method.
* TODO Support database connections.
Expand All @@ -64,6 +55,9 @@ QGIS3 Processing Port
* GML.
* TODO Build a workaround for those formats (use v.in.ogr).

* DONE Fix ParameterFiles (use False instead of 0 value for file type).
* DONE Support multiple output vector formats.
* DONE Add an optional/advanced 'format option' textbox if vector output is detected.
* DONE Review all algorithm parameters.
* DONE Support multiple output file raster formats.
* DONE Add an optional/advanced 'format option' textbox if raster output is detected.
Expand Down
Expand Up @@ -5,7 +5,7 @@ QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterRange|range|Input imagery range [0,255]|0,255|True
QgsProcessingParameterRasterLayer|elevation|Input altitude raster map in m (optional)|None|True
QgsProcessingParameterRasterLayer|visibility|Input visibility raster map in km (optional)|None|True
QgsProcessingParameterFile|parameters|Name of input text file|0|txt|None|False
QgsProcessingParameterFile|parameters|Name of input text file|False|txt|None|False
QgsProcessingParameterRange|rescale|Rescale output raster map [0,255]|0,255|True
QgsProcessingParameterRasterDestination|output|Atmospheric correction
*QgsProcessingParameterBoolean|-i|Output raster map as integer|False
Expand Down
Expand Up @@ -2,5 +2,5 @@ i.cca
Canonical components analysis (CCA) program for image processing.
Imagery (i.*)
QgsProcessingParameterMultipleLayers|input|Input rasters (2 to 8)|3|None|False
QgsProcessingParameterFile|signature|File containing spectral signatures|0|txt|None|False
QgsProcessingParameterFile|signature|File containing spectral signatures|False|txt|None|False
QgsProcessingParameterFolderDestination|output|Output Directory
Expand Up @@ -3,7 +3,7 @@ Generates spectral signatures for land cover types in an image using a clusterin
Imagery (i.*)
QgsProcessingParameterMultipleLayers|input|Input rasters|3|None|False
QgsProcessingParameterNumber|classes|Initial number of classes (1-255)|QgsProcessingParameterNumber.Integer|None|False|1|255
QgsProcessingParameterFile|seed|Name of file containing initial signatures|0|txt|None|True
QgsProcessingParameterFile|seed|Name of file containing initial signatures|False|txt|None|True
QgsProcessingParameterString|sample|Sampling intervals (by row and col)|None|False|True
QgsProcessingParameterNumber|iterations|Maximum number of iterations|QgsProcessingParameterNumber.Integer|30|True|1|None
QgsProcessingParameterNumber|convergence|Percent convergence|QgsProcessingParameterNumber.Double|98.0|True|0.0|100.0
Expand Down
Expand Up @@ -2,7 +2,7 @@ i.landsat.toar
Calculates top-of-atmosphere radiance or reflectance and temperature for Landsat MSS/TM/ETM+/OLI
Imagery (i.*)
QgsProcessingParameterMultipleLayers|rasters|Landsat input rasters|3|None|False
QgsProcessingParameterFile|metfile|Name of Landsat metadata file (.met or MTL.txt)|0|met|None|True
QgsProcessingParameterFile|metfile|Name of Landsat metadata file (.met or MTL.txt)|False|met|None|True
QgsProcessingParameterEnum|sensor|Spacecraft sensor|mss1;mss2;mss3;mss4;mss5;tm4;tm5;tm7;oli8|False|7|True
QgsProcessingParameterEnum|method|Atmospheric correction method|uncorrected;dos1;dos2;dos2b;dos3;dos4|False|0|True
QgsProcessingParameterString|date|Image acquisition date (yyyy-mm-dd)|None|False|True
Expand Down
Expand Up @@ -2,6 +2,6 @@ i.maxlik
Classifies the cell spectral reflectances in imagery data.
Imagery (i.*)
QgsProcessingParameterMultipleLayers|input|Input rasters|3|None|False
QgsProcessingParameterFile|signaturefile|Name of input file containing signatures|0|txt|None|False
QgsProcessingParameterFile|signaturefile|Name of input file containing signatures|False|txt|None|False
QgsProcessingParameterRasterDestination|output|Classification|None|False
QgsProcessingParameterRasterDestination|reject|Reject Threshold|None|True
Expand Up @@ -2,7 +2,7 @@ i.rectify
Rectifies an image by computing a coordinate transformation for each pixel in the image based on the control points.
Imagery (i.*)
QgsProcessingParameterMultipleLayers|rasters|Name of raster maps to rectify|3|None|False
QgsProcessingParameterFile|gcp|Ground Control Points file|0|txt|None|False
QgsProcessingParameterFile|gcp|Ground Control Points file|False|txt|None|False
QgsProcessingParameterEnum|order|Rectification polynomial order|1;2;3|False|0|False
QgsProcessingParameterNumber|resolution|Target resolution|QgsProcessingParameterNumber.Double|None|True|None|None
QgsProcessingParameterNumber|memory|Amount of memory to use in MB|QgsProcessingParameterNumber.Integer|300|True|1|None
Expand Down
Expand Up @@ -2,7 +2,7 @@ i.smap
Performs contextual image classification using sequential maximum a posteriori (SMAP) estimation.
Imagery (i.*)
QgsProcessingParameterMultipleLayers|input|Input rasters|3|None|False
QgsProcessingParameterFile|signaturefile|Name of input file containing signatures|0|txt|None|False
QgsProcessingParameterFile|signaturefile|Name of input file containing signatures|False|txt|None|False
QgsProcessingParameterNumber|blocksize|Size of submatrix to process at one time|QgsProcessingParameterNumber.Integer|1024|True|1|None
*QgsProcessingParameterBoolean|-m|Use maximum likelihood estimation (instead of smap)|False
QgsProcessingParameterRasterDestination|output|Classification|None|False
Expand Down
@@ -1,7 +1,7 @@
m.cogo
A simple utility for converting bearing and distance measurements to coordinates and vice versa. It assumes a Cartesian coordinate system
Miscellaneous (m.*)
QgsProcessingParameterFile|input|Name of input file|0|txt|None|False
QgsProcessingParameterFile|input|Name of input file|False|txt|None|False
QgsProcessingParameterFileDestination|output|Output text file|Txt files (*.txt)|None|False
QgsProcessingParameterPoint|coordinates|Starting coordinate pair|0.0,0.0
*QgsProcessingParameterBoolean|-l|Lines are labelled|False
Expand Down
Expand Up @@ -3,7 +3,7 @@ Manages category values and labels associated with user-specified raster map lay
Raster (r.*)
QgsProcessingParameterRasterLayer|map|Name of raster map|None|False
QgsProcessingParameterString|separator|Field separator (Special characters: pipe, comma, space, tab, newline)|tab|False|True
QgsProcessingParameterFile|rules|File containing category label rules|0|txt|None|True
QgsProcessingParameterFile|rules|File containing category label rules|False|txt|None|True
QgsProcessingParameterString|txtrules|Inline category label rules|None|True|True
QgsProcessingParameterRasterLayer|raster|Raster map from which to copy category table|None|True
*QgsProcessingParameterString|format|Default label or format string for dynamic labeling. Used when no explicit label exists for the category|None|False|True
Expand Down
Expand Up @@ -4,7 +4,7 @@ Raster (r.*)
QgsProcessingParameterMultipleLayers|map|Name of raster maps(s)|3|None|False
QgsProcessingParameterEnum|color|Name of color table|not selected;aspect;aspectcolr;bcyr;bgyr;blues;byg;byr;celsius;corine;curvature;differences;elevation;etopo2;evi;fahrenheit;gdd;greens;grey;grey.eq;grey.log;grey1.0;grey255;gyr;haxby;kelvin;ndvi;ndwi;oranges;population;population_dens;precipitation;precipitation_daily;precipitation_monthly;rainbow;ramp;random;reds;rstcurv;ryb;ryg;sepia;slope;srtm;srtm_plus;terrain;wave|False|0|False
QgsProcessingParameterString|rules_txt|Color rules|None|True|True
QgsProcessingParameterFile|rules|Color rules file|0|txt|None|True
QgsProcessingParameterFile|rules|Color rules file|False|txt|None|True
QgsProcessingParameterRasterLayer|raster|Raster map from which to copy color table|None|True
QgsProcessingParameterBoolean|-r|Remove existing color table|False
QgsProcessingParameterBoolean|-w|Only write new color table if it does not already exist|False
Expand Down
@@ -1,7 +1,7 @@
r.in.lidar
r.in.lidar.info - Extract information from LAS file
Raster (r.*)
QgsProcessingParameterFile|input|LAS input file|0|txt|None|False
QgsProcessingParameterFile|input|LAS input file|False|txt|None|False
Hardcoded|-p
Hardcoded|-g
Hardcoded|-s
Expand Down
@@ -1,7 +1,7 @@
r.in.lidar
Creates a raster map from LAS LiDAR points using univariate statistics.
Raster (r.*)
QgsProcessingParameterFile|input|LAS input file|0|las|None|False
QgsProcessingParameterFile|input|LAS input file|False|las|None|False
QgsProcessingParameterEnum|method|Statistic to use for raster values|n;min;max;range;sum;mean;stddev;variance;coeff_var;median;percentile;skewness;trimmean|False|5|True
QgsProcessingParameterEnum|type|Storage type for resultant raster map|CELL;FCELL;DCELL|False|1|True
QgsProcessingParameterRasterLayer|base_raster|Subtract raster values from the Z coordinates|None|True
Expand Down
Expand Up @@ -3,6 +3,6 @@ r.li.cwed.ascii - Calculates contrast weighted edge density index on a raster ma
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|path|Name of file that contains the weight to calculate the index|0|txt|None|False
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterFile|path|Name of file that contains the weight to calculate the index|False|txt|None|False
QgsProcessingParameterFileDestination|output|CWED|Txt files (*.txt)|None|False
Expand Up @@ -3,6 +3,6 @@ Calculates contrast weighted edge density index on a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|path|Name of file that contains the weight to calculate the index|0|txt|None|False
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterFile|path|Name of file that contains the weight to calculate the index|False|txt|None|False
QgsProcessingParameterRasterDestination|output|CWED
Expand Up @@ -3,5 +3,5 @@ r.li.dominance.ascii - Calculates dominance's diversity index on a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterFileDestination|output|Dominance|Txt files (*.txt)|None|False
Expand Up @@ -3,5 +3,5 @@ Calculates dominance's diversity index on a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterRasterDestination|output|Dominance
Expand Up @@ -3,7 +3,7 @@ r.li.edgedensity.ascii - Calculates edge density index on a raster map, using a
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterString|patch_type|The value of the patch type|None|False|True
QgsProcessingParameterBoolean|-b|Exclude border edges|False
QgsProcessingParameterFileDestination|output|Edge Density|Txt files (*.txt)|None|False
Expand Up @@ -3,7 +3,7 @@ Calculates edge density index on a raster map, using a 4 neighbour algorithm
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterString|patch_type|The value of the patch type|None|False|True
QgsProcessingParameterBoolean|-b|Exclude border edges|False
QgsProcessingParameterRasterDestination|output|Edge Density
Expand Up @@ -3,5 +3,5 @@ r.li.mpa.ascii - Calculates mean pixel attribute index on a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterFileDestination|output|Mean Pixel Attribute|Txt files (*.txt)|None|False
Expand Up @@ -3,5 +3,5 @@ Calculates mean pixel attribute index on a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterRasterDestination|output|Mean Pixel Attribute
Expand Up @@ -3,5 +3,5 @@ r.li.mps.ascii - Calculates mean patch size index on a raster map, using a 4 nei
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None
QgsProcessingParameterFileDestination|output|Mean Patch Size|Txt files (*.txt)|None|False
Expand Up @@ -3,5 +3,5 @@ Calculates mean patch size index on a raster map, using a 4 neighbour algorithm
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterRasterDestination|output|Mean Patch Size
Expand Up @@ -3,5 +3,5 @@ r.li.padcv.ascii - Calculates coefficient of variation of patch area on a raster
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterFileDestination|output|PADCV|Txt files (*.txt)|None|False
Expand Up @@ -3,5 +3,5 @@ Calculates coefficient of variation of patch area on a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterRasterDestination|output|PADCV
Expand Up @@ -3,5 +3,5 @@ r.li.padrange.ascii - Calculates range of patch area size on a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterFileDestination|output|Pad Range|Txt files (*.txt)|None|False
Expand Up @@ -3,5 +3,5 @@ Calculates range of patch area size on a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterRasterDestination|output|Pad Range
Expand Up @@ -3,5 +3,5 @@ r.li.padsd.ascii - Calculates standard deviation of patch area a raster map
Raster (r.*)
QgsProcessingParameterRasterLayer|input|Name of input raster map|None|False
QgsProcessingParameterString|config_txt|Landscape structure configuration|None|True|True
QgsProcessingParameterFile|config|Landscape structure configuration file|0|txt|None|True
QgsProcessingParameterFile|config|Landscape structure configuration file|False|txt|None|True
QgsProcessingParameterFileDestination|output|Patch Area SD|Txt files (*.txt)|None|False

0 comments on commit 3fa9e3c

Please sign in to comment.