Skip to content

Commit

Permalink
Merge pull request #3238 from medspx/processing_g7_raster_tests
Browse files Browse the repository at this point in the history
[processing] more grass7 unit tests and their fixes
  • Loading branch information
alexbruy committed Jun 29, 2016
2 parents 0f6e8da + ef4a0d8 commit a12152c
Show file tree
Hide file tree
Showing 86 changed files with 2,484 additions and 106 deletions.
3 changes: 2 additions & 1 deletion ci/travis/linux/qt5/blacklist.txt
Expand Up @@ -13,4 +13,5 @@ PyQgsVirtualLayerDefinition
PyQgsVirtualLayerProvider PyQgsVirtualLayerProvider
qgis_composermapgridtest qgis_composermapgridtest
qgis_composerutils qgis_composerutils
ProcessingGrass7AlgorithmsTest ProcessingGrass7AlgorithmsImageryTest
ProcessingGrass7AlgorithmsRasterTest
8 changes: 0 additions & 8 deletions python/plugins/processing/algs/grass7/Grass7Algorithm.py
Expand Up @@ -472,11 +472,6 @@ def processOutputs(self):
self.commands.append(command) self.commands.append(command)
self.outputCommands.append(command) self.outputCommands.append(command)


command = 'r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW"'
command += ' input='
command += 'correctedoutput' + self.uniqueSufix
command += ' output="' + filename + '"'
elif self.grass7Name == 'r.composite':
command = 'r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW"' command = 'r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW"'
command += ' input=' command += ' input='
command += 'correctedoutput' + self.uniqueSufix command += 'correctedoutput' + self.uniqueSufix
Expand All @@ -487,9 +482,6 @@ def processOutputs(self):


if self.grass7Name == 'r.horizon': if self.grass7Name == 'r.horizon':
command += out.name + self.uniqueSufix + '_0' command += out.name + self.uniqueSufix + '_0'
elif self.grass7Name == 'r.composite':
self.commands.append(command)
self.outputCommands.append(command)
elif self.grass7Name == 'r.statistics': elif self.grass7Name == 'r.statistics':
self.commands.append(command) self.commands.append(command)
self.outputCommands.append(command) self.outputCommands.append(command)
Expand Down
@@ -1,9 +1,9 @@
r.slope.aspect r.slope.aspect
r.aspect - Generates raster maps of aspect from a elevation raster map. r.aspect - Generates raster maps of aspect from an elevation raster map.
Raster (r.*) Raster (r.*)
ParameterRaster|elevation|Elevation|False ParameterRaster|elevation|Elevation|False
ParameterSelection|precision|Data type|FCELL;CELL;DCELL ParameterSelection|precision|Data type|FCELL;CELL;DCELL|0
ParameterBoolean|-a|Do not align the current region to the elevation layer|True *ParameterBoolean|-a|Do not align the current region to the elevation layer|False
ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0 ParameterNumber|zscale|Multiplicative factor to convert elevation units to meters|None|None|1.0
ParameterNumber|min_slope|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0 ParameterNumber|min_slope|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0
OutputRaster|aspect|Aspect OutputRaster|aspect|Aspect
@@ -1,7 +1,11 @@
r.fillnulls r.fillnulls
Fills no-data areas in a raster layer using v.surf.rst splines interpolation or v.surf.bspline interpolation Fills no-data areas in raster maps using spline interpolation.
Raster (r.*) Raster (r.*)
ParameterRaster|input|Input raster layer to fill|False ParameterRaster|input|Input raster layer to fill|False
ParameterSelection|method|Interpolation method to use|bilinear;bicubic;rst|2
ParameterNumber|tension|Spline tension parameter|None|None|40.0 ParameterNumber|tension|Spline tension parameter|None|None|40.0
ParameterNumber|smooth|Spline smoothing parameter|None|None|0.1 ParameterNumber|smooth|Spline smoothing parameter|None|None|0.1
ParameterNumber|edge|Width of hole edge used for interpolation (in cells)|2|100|3|True
ParameterNumber|npmin|Minimum number of points for approximation in a segment (>segmax)|2|10000|600|True
ParameterNumber|segmax|Maximum number of points in a segment|2|10000|300|True
OutputRaster|output|Filled OutputRaster|output|Filled
Expand Up @@ -4,7 +4,7 @@ Raster (r.*)
ParameterRaster|hue|Hue|False ParameterRaster|hue|Hue|False
ParameterRaster|intensity|Intensity|False ParameterRaster|intensity|Intensity|False
ParameterRaster|saturation|Saturation|False ParameterRaster|saturation|Saturation|False
ParameterBoolean|-n|Respect NULL values while drawing|False ParameterBoolean|-c|Use colors from color tables for NULL values|False
OutputRaster|red|Red OutputRaster|red|Red
OutputRaster|green|Green OutputRaster|green|Green
OutputRaster|blue|Blue OutputRaster|blue|Blue
Expand Up @@ -4,5 +4,5 @@ Raster (r.*)
ParameterRaster|input|Name of input raster map|False ParameterRaster|input|Name of input raster map|False
ParameterString|config_txt|Landscape structure configuration|None|True|True ParameterString|config_txt|Landscape structure configuration|None|True|True
ParameterFile|config|Landscape structure configuration file|False|True ParameterFile|config|Landscape structure configuration file|False|True
ParameterFile|path|Name of file that contains the weight to calculate the index|False ParameterFile|path|Name of file that contains the weight to calculate the index|False|False
OutputFile|output|CWED OutputFile|output|CWED
Expand Up @@ -4,5 +4,5 @@ Raster (r.*)
ParameterRaster|input|Name of input raster map|False ParameterRaster|input|Name of input raster map|False
ParameterString|config_txt|Landscape structure configuration|None|True|True ParameterString|config_txt|Landscape structure configuration|None|True|True
ParameterFile|config|Landscape structure configuration file|False|True ParameterFile|config|Landscape structure configuration file|False|True
ParameterFile|path|Name of file that contains the weight to calculate the index|False ParameterFile|path|Name of file that contains the weight to calculate the index|False|False
OutputRaster|output|CWED OutputRaster|output|CWED
Expand Up @@ -4,5 +4,5 @@ Raster (r.*)
ParameterRaster|input|Name of input raster map|False ParameterRaster|input|Name of input raster map|False
ParameterString|config_txt|Landscape structure configuration|None|True|True ParameterString|config_txt|Landscape structure configuration|None|True|True
ParameterFile|config|Landscape structure configuration file|False|True ParameterFile|config|Landscape structure configuration file|False|True
ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|True ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|False
OutputFile|output|Renyi OutputFile|output|Renyi
Expand Up @@ -4,5 +4,5 @@ Raster (r.*)
ParameterRaster|input|Name of input raster map|False ParameterRaster|input|Name of input raster map|False
ParameterString|config_txt|Landscape structure configuration|None|True|True ParameterString|config_txt|Landscape structure configuration|None|True|True
ParameterFile|config|Landscape structure configuration file|False|True ParameterFile|config|Landscape structure configuration file|False|True
ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|True ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|False
OutputRaster|output|Renyi OutputRaster|output|Renyi
8 changes: 4 additions & 4 deletions python/plugins/processing/algs/grass7/description/r.slope.txt
@@ -1,9 +1,9 @@
r.slope.aspect r.slope.aspect
r.slope - Generates raster maps of slope from a elevation raster map. r.slope - Generates raster maps of slope from an elevation raster map.
Raster (r.*) Raster (r.*)
ParameterRaster|elevation|Elevation|False ParameterRaster|elevation|Elevation|False
ParameterSelection|precision|Data type|FCELL;CELL;DCELL ParameterSelection|precision|Data type|FCELL;CELL;DCELL|0
ParameterBoolean|-a|Do not align the current region to the elevation layer|True *ParameterBoolean|-a|Do not align the current region to the elevation layer|False
ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0 ParameterNumber|zscale|Multiplicative factor to convert elevation units to meters|None|None|1.0
ParameterNumber|min_slope|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0 ParameterNumber|min_slope|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0
OutputRaster|slope|Slope OutputRaster|slope|Slope
4 changes: 0 additions & 4 deletions python/plugins/processing/algs/grass7/description/r.sum.txt

This file was deleted.

Expand Up @@ -2,4 +2,4 @@ r.topidx
Creates topographic index layer from elevation raster layer Creates topographic index layer from elevation raster layer
Raster (r.*) Raster (r.*)
ParameterRaster|input|Input elevation layer|False ParameterRaster|input|Input elevation layer|False
OutputRaster|Topographic index OutputRaster|output|Topographic index
15 changes: 10 additions & 5 deletions python/plugins/processing/algs/grass7/description/r.viewshed.txt
Expand Up @@ -2,9 +2,14 @@ r.viewshed
Computes the viewshed of a point on an elevation raster map. Computes the viewshed of a point on an elevation raster map.
Raster (r.*) Raster (r.*)
ParameterRaster|input|Elevation|False ParameterRaster|input|Elevation|False
ParameterString|coordinates|Coordinate identifying the viewing position|0,0 ParameterString|coordinates|Coordinate identifying the viewing position|0,0|False|False
ParameterString|observer_elevation|Viewing position height above the ground|1.75 ParameterString|observer_elevation|Viewing elevation above the ground|1.75|False|False
ParameterString|target_elevation|Offset for target elevation above the ground|0.0 ParameterString|target_elevation|Offset for target elevation above the ground|0.0|False|False
ParameterString|max_distance|Maximum distance from the viewing point (meters)|10000 ParameterString|max_distance|Maximum distance from the viewing point (meters)|-1|False|False
ParameterBoolean|-c|Consider earth curvature (current ellipsoid)|False ParameterNumber|refraction_coeff|Refraction coefficient|0.0|1.0|0.14286|False
ParameterNumber|memory|Amount of memory to use in MB|1|None|500|False
*ParameterBoolean|-c|Consider earth curvature (current ellipsoid)|False
*ParameterBoolean|-r|Consider the effect of atmospheric refraction|False
*ParameterBoolean|-b|Output format is invisible = 0, visible = 1|False
*ParameterBoolean|-e|Output format is invisible = NULL, else current elev - viewpoint_elev|False
OutputRaster|output|Intervisibility OutputRaster|output|Intervisibility
@@ -1,7 +1,7 @@
r.volume r.volume
Calculates the volume of data "clumps". Calculates the volume of data "clumps".
Raster (r.*) Raster (r.*)
ParameterRaster|data|Layer representing data that will be summed within clumps|False ParameterRaster|input|Name of input raster map representing data that will be summed within clumps|False
ParameterRaster|clump|Clumps layer (preferably the output of r.clump)|False ParameterRaster|clump|Clumps layer (preferably the output of r.clump)|False
*ParameterBoolean|-f|Generate unformatted report|False *ParameterBoolean|-f|Generate unformatted report|False
OutputVector|centroids|Centroids OutputVector|centroids|Centroids
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_cwed.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_mpa.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_mps.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_padcv.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_padrange.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_padsd.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_patchnum.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_pielou.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_renyi.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_richness.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_shannon.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_shape.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_simpson.py
Expand Up @@ -29,7 +29,7 @@




def checkParameterValuesBeforeExecuting(alg): def checkParameterValuesBeforeExecuting(alg):
checkMovingWindow(alg) return checkMovingWindow(alg)




def processCommand(alg): def processCommand(alg):
Expand Down

0 comments on commit a12152c

Please sign in to comment.