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 authored 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ PyQgsVirtualLayerDefinition
PyQgsVirtualLayerProvider
qgis_composermapgridtest
qgis_composerutils
ProcessingGrass7AlgorithmsTest
ProcessingGrass7AlgorithmsImageryTest
ProcessingGrass7AlgorithmsRasterTest
8 changes: 0 additions & 8 deletions python/plugins/processing/algs/grass7/Grass7Algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,6 @@ def processOutputs(self):
self.commands.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 += ' input='
command += 'correctedoutput' + self.uniqueSufix
Expand All @@ -487,9 +482,6 @@ def processOutputs(self):

if self.grass7Name == 'r.horizon':
command += out.name + self.uniqueSufix + '_0'
elif self.grass7Name == 'r.composite':
self.commands.append(command)
self.outputCommands.append(command)
elif self.grass7Name == 'r.statistics':
self.commands.append(command)
self.outputCommands.append(command)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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.*)
ParameterRaster|elevation|Elevation|False
ParameterSelection|precision|Data type|FCELL;CELL;DCELL
ParameterBoolean|-a|Do not align the current region to the elevation layer|True
ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0
ParameterSelection|precision|Data type|FCELL;CELL;DCELL|0
*ParameterBoolean|-a|Do not align the current region to the elevation layer|False
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
OutputRaster|aspect|Aspect
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
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.*)
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|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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Raster (r.*)
ParameterRaster|hue|Hue|False
ParameterRaster|intensity|Intensity|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|green|Green
OutputRaster|blue|Blue
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Raster (r.*)
ParameterRaster|input|Name of input raster map|False
ParameterString|config_txt|Landscape structure configuration|None|True|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
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Raster (r.*)
ParameterRaster|input|Name of input raster map|False
ParameterString|config_txt|Landscape structure configuration|None|True|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
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Raster (r.*)
ParameterRaster|input|Name of input raster map|False
ParameterString|config_txt|Landscape structure configuration|None|True|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
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Raster (r.*)
ParameterRaster|input|Name of input raster map|False
ParameterString|config_txt|Landscape structure configuration|None|True|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
8 changes: 4 additions & 4 deletions python/plugins/processing/algs/grass7/description/r.slope.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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.*)
ParameterRaster|elevation|Elevation|False
ParameterSelection|precision|Data type|FCELL;CELL;DCELL
ParameterBoolean|-a|Do not align the current region to the elevation layer|True
ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0
ParameterSelection|precision|Data type|FCELL;CELL;DCELL|0
*ParameterBoolean|-a|Do not align the current region to the elevation layer|False
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
OutputRaster|slope|Slope
4 changes: 0 additions & 4 deletions python/plugins/processing/algs/grass7/description/r.sum.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ r.topidx
Creates topographic index layer from elevation raster layer
Raster (r.*)
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ r.viewshed
Computes the viewshed of a point on an elevation raster map.
Raster (r.*)
ParameterRaster|input|Elevation|False
ParameterString|coordinates|Coordinate identifying the viewing position|0,0
ParameterString|observer_elevation|Viewing position height above the ground|1.75
ParameterString|target_elevation|Offset for target elevation above the ground|0.0
ParameterString|max_distance|Maximum distance from the viewing point (meters)|10000
ParameterBoolean|-c|Consider earth curvature (current ellipsoid)|False
ParameterString|coordinates|Coordinate identifying the viewing position|0,0|False|False
ParameterString|observer_elevation|Viewing elevation above the ground|1.75|False|False
ParameterString|target_elevation|Offset for target elevation above the ground|0.0|False|False
ParameterString|max_distance|Maximum distance from the viewing point (meters)|-1|False|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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
r.volume
Calculates the volume of data "clumps".
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
*ParameterBoolean|-f|Generate unformatted report|False
OutputVector|centroids|Centroids
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/ext/r_li_cwed.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


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


def processCommand(alg):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


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


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


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


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


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


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


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


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


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


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


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


def processCommand(alg):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


def processCommand(alg):
Expand Down
Loading

0 comments on commit a12152c

Please sign in to comment.