Skip to content

Commit a12152c

Browse files
authored
Merge pull request #3238 from medspx/processing_g7_raster_tests
[processing] more grass7 unit tests and their fixes
2 parents 0f6e8da + ef4a0d8 commit a12152c

File tree

86 files changed

+2484
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2484
-106
lines changed

ci/travis/linux/qt5/blacklist.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ PyQgsVirtualLayerDefinition
1313
PyQgsVirtualLayerProvider
1414
qgis_composermapgridtest
1515
qgis_composerutils
16-
ProcessingGrass7AlgorithmsTest
16+
ProcessingGrass7AlgorithmsImageryTest
17+
ProcessingGrass7AlgorithmsRasterTest

python/plugins/processing/algs/grass7/Grass7Algorithm.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,6 @@ def processOutputs(self):
472472
self.commands.append(command)
473473
self.outputCommands.append(command)
474474

475-
command = 'r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW"'
476-
command += ' input='
477-
command += 'correctedoutput' + self.uniqueSufix
478-
command += ' output="' + filename + '"'
479-
elif self.grass7Name == 'r.composite':
480475
command = 'r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW"'
481476
command += ' input='
482477
command += 'correctedoutput' + self.uniqueSufix
@@ -487,9 +482,6 @@ def processOutputs(self):
487482

488483
if self.grass7Name == 'r.horizon':
489484
command += out.name + self.uniqueSufix + '_0'
490-
elif self.grass7Name == 'r.composite':
491-
self.commands.append(command)
492-
self.outputCommands.append(command)
493485
elif self.grass7Name == 'r.statistics':
494486
self.commands.append(command)
495487
self.outputCommands.append(command)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
r.slope.aspect
2-
r.aspect - Generates raster maps of aspect from a elevation raster map.
2+
r.aspect - Generates raster maps of aspect from an elevation raster map.
33
Raster (r.*)
44
ParameterRaster|elevation|Elevation|False
5-
ParameterSelection|precision|Data type|FCELL;CELL;DCELL
6-
ParameterBoolean|-a|Do not align the current region to the elevation layer|True
7-
ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0
5+
ParameterSelection|precision|Data type|FCELL;CELL;DCELL|0
6+
*ParameterBoolean|-a|Do not align the current region to the elevation layer|False
7+
ParameterNumber|zscale|Multiplicative factor to convert elevation units to meters|None|None|1.0
88
ParameterNumber|min_slope|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0
99
OutputRaster|aspect|Aspect
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
r.fillnulls
2-
Fills no-data areas in a raster layer using v.surf.rst splines interpolation or v.surf.bspline interpolation
2+
Fills no-data areas in raster maps using spline interpolation.
33
Raster (r.*)
44
ParameterRaster|input|Input raster layer to fill|False
5+
ParameterSelection|method|Interpolation method to use|bilinear;bicubic;rst|2
56
ParameterNumber|tension|Spline tension parameter|None|None|40.0
67
ParameterNumber|smooth|Spline smoothing parameter|None|None|0.1
8+
ParameterNumber|edge|Width of hole edge used for interpolation (in cells)|2|100|3|True
9+
ParameterNumber|npmin|Minimum number of points for approximation in a segment (>segmax)|2|10000|600|True
10+
ParameterNumber|segmax|Maximum number of points in a segment|2|10000|300|True
711
OutputRaster|output|Filled

python/plugins/processing/algs/grass7/description/r.his.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Raster (r.*)
44
ParameterRaster|hue|Hue|False
55
ParameterRaster|intensity|Intensity|False
66
ParameterRaster|saturation|Saturation|False
7-
ParameterBoolean|-n|Respect NULL values while drawing|False
7+
ParameterBoolean|-c|Use colors from color tables for NULL values|False
88
OutputRaster|red|Red
99
OutputRaster|green|Green
1010
OutputRaster|blue|Blue

python/plugins/processing/algs/grass7/description/r.li.cwed.ascii.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Raster (r.*)
44
ParameterRaster|input|Name of input raster map|False
55
ParameterString|config_txt|Landscape structure configuration|None|True|True
66
ParameterFile|config|Landscape structure configuration file|False|True
7-
ParameterFile|path|Name of file that contains the weight to calculate the index|False
7+
ParameterFile|path|Name of file that contains the weight to calculate the index|False|False
88
OutputFile|output|CWED

python/plugins/processing/algs/grass7/description/r.li.cwed.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Raster (r.*)
44
ParameterRaster|input|Name of input raster map|False
55
ParameterString|config_txt|Landscape structure configuration|None|True|True
66
ParameterFile|config|Landscape structure configuration file|False|True
7-
ParameterFile|path|Name of file that contains the weight to calculate the index|False
7+
ParameterFile|path|Name of file that contains the weight to calculate the index|False|False
88
OutputRaster|output|CWED

python/plugins/processing/algs/grass7/description/r.li.renyi.ascii.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Raster (r.*)
44
ParameterRaster|input|Name of input raster map|False
55
ParameterString|config_txt|Landscape structure configuration|None|True|True
66
ParameterFile|config|Landscape structure configuration file|False|True
7-
ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|True
7+
ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|False
88
OutputFile|output|Renyi

python/plugins/processing/algs/grass7/description/r.li.renyi.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Raster (r.*)
44
ParameterRaster|input|Name of input raster map|False
55
ParameterString|config_txt|Landscape structure configuration|None|True|True
66
ParameterFile|config|Landscape structure configuration file|False|True
7-
ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|True
7+
ParameterString|alpha|Alpha value is the order of the generalized entropy|None|False|False
88
OutputRaster|output|Renyi
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
r.slope.aspect
2-
r.slope - Generates raster maps of slope from a elevation raster map.
2+
r.slope - Generates raster maps of slope from an elevation raster map.
33
Raster (r.*)
44
ParameterRaster|elevation|Elevation|False
5-
ParameterSelection|precision|Data type|FCELL;CELL;DCELL
6-
ParameterBoolean|-a|Do not align the current region to the elevation layer|True
7-
ParameterNumber|zfactor|Multiplicative factor to convert elevation units to meters|None|None|1.0
5+
ParameterSelection|precision|Data type|FCELL;CELL;DCELL|0
6+
*ParameterBoolean|-a|Do not align the current region to the elevation layer|False
7+
ParameterNumber|zscale|Multiplicative factor to convert elevation units to meters|None|None|1.0
88
ParameterNumber|min_slope|Minimum slope val. (in percent) for which aspect is computed|None|None|0.0
99
OutputRaster|slope|Slope

python/plugins/processing/algs/grass7/description/r.sum.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

python/plugins/processing/algs/grass7/description/r.topidx.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ r.topidx
22
Creates topographic index layer from elevation raster layer
33
Raster (r.*)
44
ParameterRaster|input|Input elevation layer|False
5-
OutputRaster|Topographic index
5+
OutputRaster|output|Topographic index

python/plugins/processing/algs/grass7/description/r.viewshed.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ r.viewshed
22
Computes the viewshed of a point on an elevation raster map.
33
Raster (r.*)
44
ParameterRaster|input|Elevation|False
5-
ParameterString|coordinates|Coordinate identifying the viewing position|0,0
6-
ParameterString|observer_elevation|Viewing position height above the ground|1.75
7-
ParameterString|target_elevation|Offset for target elevation above the ground|0.0
8-
ParameterString|max_distance|Maximum distance from the viewing point (meters)|10000
9-
ParameterBoolean|-c|Consider earth curvature (current ellipsoid)|False
5+
ParameterString|coordinates|Coordinate identifying the viewing position|0,0|False|False
6+
ParameterString|observer_elevation|Viewing elevation above the ground|1.75|False|False
7+
ParameterString|target_elevation|Offset for target elevation above the ground|0.0|False|False
8+
ParameterString|max_distance|Maximum distance from the viewing point (meters)|-1|False|False
9+
ParameterNumber|refraction_coeff|Refraction coefficient|0.0|1.0|0.14286|False
10+
ParameterNumber|memory|Amount of memory to use in MB|1|None|500|False
11+
*ParameterBoolean|-c|Consider earth curvature (current ellipsoid)|False
12+
*ParameterBoolean|-r|Consider the effect of atmospheric refraction|False
13+
*ParameterBoolean|-b|Output format is invisible = 0, visible = 1|False
14+
*ParameterBoolean|-e|Output format is invisible = NULL, else current elev - viewpoint_elev|False
1015
OutputRaster|output|Intervisibility
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
r.volume
22
Calculates the volume of data "clumps".
33
Raster (r.*)
4-
ParameterRaster|data|Layer representing data that will be summed within clumps|False
4+
ParameterRaster|input|Name of input raster map representing data that will be summed within clumps|False
55
ParameterRaster|clump|Clumps layer (preferably the output of r.clump)|False
66
*ParameterBoolean|-f|Generate unformatted report|False
77
OutputVector|centroids|Centroids

python/plugins/processing/algs/grass7/ext/r_li_cwed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_edgedensity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_mpa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_mps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_padcv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_padrange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_padsd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_patchdensity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_patchnum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_pielou.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_renyi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_richness.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_shannon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_shape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

python/plugins/processing/algs/grass7/ext/r_li_simpson.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
def checkParameterValuesBeforeExecuting(alg):
32-
checkMovingWindow(alg)
32+
return checkMovingWindow(alg)
3333

3434

3535
def processCommand(alg):

0 commit comments

Comments
 (0)