Skip to content
Permalink
Browse files

Merge pull request #3238 from medspx/processing_g7_raster_tests

[processing] more grass7 unit tests and their fixes
  • Loading branch information
alexbruy committed Jun 29, 2016
2 parents 0f6e8da + ef4a0d8 commit a12152c72449c56dde7b10a65c9e347c28bc7632
Showing with 2,484 additions and 106 deletions.
  1. +2 −1 ci/travis/linux/qt5/blacklist.txt
  2. +0 −8 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  3. +4 −4 python/plugins/processing/algs/grass7/description/r.aspect.txt
  4. +5 −1 python/plugins/processing/algs/grass7/description/r.fillnulls.txt
  5. +1 −1 python/plugins/processing/algs/grass7/description/r.his.txt
  6. +1 −1 python/plugins/processing/algs/grass7/description/r.li.cwed.ascii.txt
  7. +1 −1 python/plugins/processing/algs/grass7/description/r.li.cwed.txt
  8. +1 −1 python/plugins/processing/algs/grass7/description/r.li.renyi.ascii.txt
  9. +1 −1 python/plugins/processing/algs/grass7/description/r.li.renyi.txt
  10. +4 −4 python/plugins/processing/algs/grass7/description/r.slope.txt
  11. +0 −4 python/plugins/processing/algs/grass7/description/r.sum.txt
  12. +1 −1 python/plugins/processing/algs/grass7/description/r.topidx.txt
  13. +10 −5 python/plugins/processing/algs/grass7/description/r.viewshed.txt
  14. +1 −1 python/plugins/processing/algs/grass7/description/r.volume.txt
  15. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_cwed.py
  16. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py
  17. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_mpa.py
  18. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_mps.py
  19. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_padcv.py
  20. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_padrange.py
  21. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_padsd.py
  22. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_patchdensity.py
  23. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_patchnum.py
  24. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_pielou.py
  25. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_renyi.py
  26. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_richness.py
  27. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_shannon.py
  28. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_shape.py
  29. +1 −1 python/plugins/processing/algs/grass7/ext/r_li_simpson.py
  30. +65 −32 python/plugins/processing/gui/TestTools.py
  31. +2 −1 python/plugins/processing/tests/CMakeLists.txt
  32. +58 −0 python/plugins/processing/tests/Grass7AlgorithmsImageryTest.py
  33. +4 −4 python/plugins/processing/tests/{Grass7AlgorithmsTest.py → Grass7AlgorithmsRasterTest.py}
  34. +103 −0 python/plugins/processing/tests/grass7_todo.md
  35. +0 −20 python/plugins/processing/tests/testdata/custom/grass7/float_raster.tif.aux.xml
  36. BIN python/plugins/processing/tests/testdata/custom/grass7/points.dbf
  37. +1 −0 python/plugins/processing/tests/testdata/custom/grass7/points.prj
  38. +1 −0 python/plugins/processing/tests/testdata/custom/grass7/points.qpj
  39. BIN python/plugins/processing/tests/testdata/custom/grass7/points.shp
  40. BIN python/plugins/processing/tests/testdata/custom/grass7/points.shx
  41. BIN python/plugins/processing/tests/testdata/custom/grass7/points2.dbf
  42. +1 −0 python/plugins/processing/tests/testdata/custom/grass7/points2.prj
  43. +1 −0 python/plugins/processing/tests/testdata/custom/grass7/points2.qpj
  44. BIN python/plugins/processing/tests/testdata/custom/grass7/points2.shp
  45. BIN python/plugins/processing/tests/testdata/custom/grass7/points2.shx
  46. BIN python/plugins/processing/tests/testdata/custom/grass7/raster_1class.tif
  47. +2 −0 python/plugins/processing/tests/testdata/custom/grass7/rliconfig
  48. +3 −0 python/plugins/processing/tests/testdata/custom/grass7/rliconfigmoving
  49. +4 −0 python/plugins/processing/tests/testdata/custom/grass7/weighted.csv
  50. +5 −0 python/plugins/processing/tests/testdata/expected/grass7/r.category.out.txt
  51. +35 −0 python/plugins/processing/tests/testdata/expected/grass7/r.coin.txt
  52. +4 −0 python/plugins/processing/tests/testdata/expected/grass7/r.colors.out.txt
  53. +4 −0 python/plugins/processing/tests/testdata/expected/grass7/r.covar.txt
  54. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.describe.txt
  55. +4 −0 python/plugins/processing/tests/testdata/expected/grass7/r.distance.txt
  56. +29 −0 python/plugins/processing/tests/testdata/expected/grass7/r.info.txt
  57. +59 −0 python/plugins/processing/tests/testdata/expected/grass7/r.kappa.txt
  58. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.cwed.ascii.txt
  59. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.dominance.ascii.txt
  60. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.edgedensity.ascii.txt
  61. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.mpa.ascii.txt
  62. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.mps.ascii.txt
  63. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.padcv.ascii.txt
  64. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.padrange.ascii.txt
  65. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.padsd.ascii.txt
  66. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.patchdensity.ascii.txt
  67. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.patchnum.ascii.txt
  68. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.pielou.ascii.txt
  69. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.renyi.ascii.txt
  70. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.richness.ascii.txt
  71. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.shannon.ascii.txt
  72. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.shape.ascii.txt
  73. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.li.simpson.ascii.txt
  74. +30 −0 python/plugins/processing/tests/testdata/expected/grass7/r.stats.quantile.txt
  75. +188 −0 python/plugins/processing/tests/testdata/expected/grass7/r.stats.txt
  76. +6 −0 python/plugins/processing/tests/testdata/expected/grass7/r.surf.area.txt
  77. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.terraflow.txt
  78. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.tileset.txt
  79. +30 −0 python/plugins/processing/tests/testdata/expected/grass7/r.topomodel.topidxstats.txt
  80. +10 −0 python/plugins/processing/tests/testdata/expected/grass7/r.transect.txt
  81. +2 −0 python/plugins/processing/tests/testdata/expected/grass7/r.univar.txt
  82. +2 −0 python/plugins/processing/tests/testdata/expected/grass7/r.what.colors.txt
  83. +1 −0 python/plugins/processing/tests/testdata/expected/grass7/r.what.coords.txt
  84. +3 −0 python/plugins/processing/tests/testdata/expected/grass7/r.what.points.txt
  85. 0 ...ns/processing/tests/testdata/{grass7_algorithm_tests.yaml → grass7_algorithms_imagery_tests.yaml}
  86. +1,761 −0 python/plugins/processing/tests/testdata/grass7_algorithms_raster_tests.yaml
@@ -13,4 +13,5 @@ PyQgsVirtualLayerDefinition
PyQgsVirtualLayerProvider
qgis_composermapgridtest
qgis_composerutils
ProcessingGrass7AlgorithmsTest
ProcessingGrass7AlgorithmsImageryTest
ProcessingGrass7AlgorithmsRasterTest
@@ -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
@@ -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)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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

This file was deleted.

@@ -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
@@ -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
@@ -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
@@ -29,7 +29,7 @@


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


def processCommand(alg):

0 comments on commit a12152c

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