re-enable some disabled test and fix broken r.describe algorithm

This commit is contained in:
Alexander Bruy 2019-07-15 10:43:37 +03:00 committed by Nyall Dawson
parent 807564a435
commit e45b62c6af
14 changed files with 15405 additions and 391 deletions

View File

@ -4,7 +4,6 @@ Raster (r.*)
QgsProcessingParameterRasterLayer|map|input raster layer|None|False
QgsProcessingParameterString|null_value|String representing NULL value|*|False|True
QgsProcessingParameterNumber|nsteps|Number of quantization steps|QgsProcessingParameterNumber.Integer|255|True|1|None
QgsProcessingParameterEnum|sort|Sort output by distance|asc;desc|False|0|True
QgsProcessingParameterBoolean|-r|Only print the range of the data|False
QgsProcessingParameterBoolean|-n|Suppress reporting of any NULLs|False
QgsProcessingParameterBoolean|-d|Use the current region|False

View File

@ -1,35 +0,0 @@
+------------------------------------------------------------------------------+
| COINCIDENCE TABULATION REPORT |
|------------------------------------------------------------------------------|
| Location: temp_location Mapset: PERMANENT Date: Sun Jun 26 11:43:50 |
| |
| Layer 1: tmp146693422996-- |
| Layer 2: tmp146693422996-- |
| Mask: Aucun |
| |
| Units: percent cover |
|------------------------------------------------------------------------------|
| Window: North: 6693700 |
| West: 344500 East: 358400 |
| South: 6682800 |
+------------------------------------------------------------------------------+
Panel #1 of 1
+--------------------------------------------------------------------------------+ +-----------------------+
| | tmp14669342299627 | Panel Row Total | | Table Row Total |
| cat# | 1 | 2 | 3 | 4 | w cat 0 | w/o cat 0 | | w cat 0 | w/o cat 0 |
|--------------------------------------------------------------------------------| |-----------------------|
|t 1 | 0.29 | 1.55 | 5.10 | 6.14 | 13.08 | 13.08 | | 13.08 | 13.08 |
|m 2 | 0.12 | 0.69 | 2.36 | 2.81 | 5.98 | 5.98 | | 5.98 | 5.98 |
|p 3 | 0.28 | 1.39 | 5.50 | 6.59 | 13.75 | 13.75 | | 13.75 | 13.75 |
|1 4 | 0.36 | 2.20 | 8.22 | 8.86 | 19.64 | 19.64 | | 19.64 | 19.64 |
|4 5 | 0.30 | 1.35 | 5.04 | 6.14 | 12.83 | 12.83 | | 12.83 | 12.83 |
|6 6 | 0.61 | 3.89 | 12.91 | 15.31 | 32.73 | 32.73 | | 32.73 | 32.73 |
|--------------------------------------------------------------------------------| |-----------------------|
|Total | | | | | | | | | |
|with 0 | 1.96 | 11.08 | 39.13 | 45.85 | 98.02 | 98.02 | | 98.02 | 98.02 |
|--------------------------------------------------------------------------------| |-----------------------|
|w/o 0 | 1.96 | 11.08 | 39.13 | 45.85 | 98.02 | 98.02 | | 98.02 | 98.02 |
+--------------------------------------------------------------------------------+ +-----------------------+

View File

@ -1,4 +0,0 @@
N = 14743
3.032568 0.048485 -0.000132
0.048485 2.232202 -0.013692
-0.000132 -0.013692 0.561513

View File

@ -1,29 +0,0 @@
+----------------------------------------------------------------------------+
| Map: tmp14669386814521 Date: Sun Jun 26 12:58:01 2016 |
| Mapset: PERMANENT Login of Creator: medspx |
| Location: temp_location |
| DataBase: /tmp/processingd1287b3c04994d8a8ed29b67a67c13bb/grassdata |
| Title: ( tmp14669386814521 ) |
| Timestamp: none |
|----------------------------------------------------------------------------|
| |
| Type of Map: raster Number of Categories: 0 |
| Data Type: FCELL |
| Rows: 109 |
| Columns: 139 |
| Total Cells: 15151 |
| Projection: unnamed |
| N: 6693700 S: 6682800 Res: 100 |
| E: 358400 W: 344500 Res: 100 |
| Range of data: min = -303 max = 14847 |
| |
| Data Description: |
| gnr par r.external |
| |
| Comments: |
| r.external --overwrite -o input="/home/medspx/projects/QGIS/code/pyt\ |
| hon/plugins/processing/tests/testdata/custom/grass7/float_raster.tif\ |
| " output="tmp14669386814521" band=1 |
| |
+----------------------------------------------------------------------------+

View File

@ -1,188 +0,0 @@
1 1 1 10
1 1 2 48
1 1 3 170
1 1 4 197
1 1 * 2
1 2 1 1
1 2 2 15
1 2 3 56
1 2 4 47
1 2 * 1
1 3 1 8
1 3 2 28
1 3 3 93
1 3 4 139
1 3 * 4
1 4 1 12
1 4 2 57
1 4 3 208
1 4 4 256
1 4 * 6
1 5 1 13
1 5 2 86
1 5 3 239
1 5 4 285
1 5 * 4
1 * 2 1
1 * 3 6
1 * 4 7
2 1 1 5
2 1 2 30
2 1 3 64
2 1 4 83
2 1 * 2
2 2 2 7
2 2 3 26
2 2 4 23
2 2 * 3
2 3 1 3
2 3 2 11
2 3 3 45
2 3 4 64
2 3 * 1
2 4 1 1
2 4 2 17
2 4 3 104
2 4 4 118
2 4 * 4
2 5 1 9
2 5 2 39
2 5 3 117
2 5 4 132
2 5 * 4
2 * 2 1
2 * 3 2
2 * 4 5
3 1 1 5
3 1 2 43
3 1 3 167
3 1 4 184
3 1 * 3
3 2 1 2
3 2 2 13
3 2 3 55
3 2 4 77
3 2 * 2
3 3 1 9
3 3 2 25
3 3 3 105
3 3 4 145
3 3 * 2
3 4 1 16
3 4 2 62
3 4 3 231
3 4 4 259
3 4 * 3
3 5 1 9
3 5 2 67
3 5 3 270
3 5 4 327
3 5 * 16
3 * 1 1
3 * 2 1
3 * 3 5
3 * 4 6
4 1 1 8
4 1 2 69
4 1 3 254
4 1 4 288
4 1 * 11
4 2 1 5
4 2 2 15
4 2 3 67
4 2 4 82
4 2 * 3
4 3 1 9
4 3 2 48
4 3 3 181
4 3 4 182
4 3 * 3
4 4 1 16
4 4 2 88
4 4 3 334
4 4 4 338
4 4 * 9
4 5 1 17
4 5 2 112
4 5 3 405
4 5 4 445
4 5 * 8
4 * 2 1
4 * 3 5
4 * 4 7
5 1 1 5
5 1 2 36
5 1 3 143
5 1 4 178
5 1 * 4
5 2 2 14
5 2 3 52
5 2 4 53
5 2 * 2
5 3 1 7
5 3 2 35
5 3 3 116
5 3 4 136
5 3 * 1
5 4 1 11
5 4 2 50
5 4 3 198
5 4 4 235
5 4 * 5
5 5 1 20
5 5 2 69
5 5 3 248
5 5 4 318
5 5 * 4
5 * 1 2
5 * 2 1
5 * 3 6
5 * 4 11
6 1 1 10
6 1 2 100
6 1 3 381
6 1 4 462
6 1 * 8
6 2 1 9
6 2 2 33
6 2 3 108
6 2 4 143
6 2 * 2
6 3 1 15
6 3 2 87
6 3 3 273
6 3 4 307
6 3 * 8
6 4 1 22
6 4 2 166
6 4 3 532
6 4 4 604
6 4 * 10
6 5 1 37
6 5 2 198
6 5 3 648
6 5 4 784
6 5 * 14
6 * 2 6
6 * 3 14
6 * 4 20
* 1 2 4
* 1 3 16
* 1 4 9
* 2 1 1
* 2 2 2
* 2 4 2
* 3 2 2
* 3 3 7
* 3 4 10
* 3 * 1
* 4 1 2
* 4 2 4
* 4 3 19
* 4 4 12
* 4 * 1
* 5 2 9
* 5 3 29
* 5 4 18
* * 3 1
* * 4 2

View File

@ -1,6 +0,0 @@
Null value area ignored in calculation: 1510000.000000
Plan area used in calculation: 149040000.000000
Surface area calculation(low, high, avg):
143171894.810657 143200607.945173 143186251.377915
Current region plan area: 151510000.000000
Estimated region Surface Area: 145559238.769913

View File

@ -0,0 +1,71 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><p>
</br>+------------------------------------------------------------------------------+
</br>| COINCIDENCE TABULATION REPORT |
</br>|------------------------------------------------------------------------------|
</br>| Location: temp_location Mapset: PERMANENT Date: Mon Jul 15 10:21:14 |
</br>| |
</br>| Layer 1: rast_5d2c296a54-- |
</br>| Layer 2: rast_5d2c296a54-- |
</br>| Mask: none |
</br>| |
</br>| Units: percent cover |
</br>|------------------------------------------------------------------------------|
</br>| Window: North: 6693700 |
</br>| West: 344500 East: 358400 |
</br>| South: 6682800 |
</br>+------------------------------------------------------------------------------+
</br>
</br>Panel #1 of 2
</br>+--------------------------------------------------------------------+
</br>| | rast_5d2c296a5499012 | Panel Row Total |
</br>| cat# | 1 | 2 | 3 | w cat 0 | w/o cat 0 |
</br>|--------------------------------------------------------------------|
</br>|r 1 | 0.29 | 1.55 | 5.10 | 6.94 | 6.94 |
</br>|a 2 | 0.12 | 0.69 | 2.36 | 3.17 | 3.17 |
</br>|s 3 | 0.28 | 1.39 | 5.50 | 7.17 | 7.17 |
</br>|t 4 | 0.36 | 2.20 | 8.22 | 10.78 | 10.78 |
</br>|_ 5 | 0.30 | 1.35 | 5.04 | 6.69 | 6.69 |
</br>|5 6 | 0.61 | 3.89 | 12.91 | 17.42 | 17.42 |
</br>|--------------------------------------------------------------------|
</br>|Total | | | | | |
</br>|with 0 | 1.96 | 11.08 | 39.13 | 52.17 | 52.17 |
</br>|--------------------------------------------------------------------|
</br>|w/o 0 | 1.96 | 11.08 | 39.13 | 52.17 | 52.17 |
</br>+--------------------------------------------------------------------+
</br>
</br>Panel #2 of 2
</br>+--------------------------------------------+
</br>| | rast_5d2c296a5499012| Panel Row Total |
</br>| cat# | 4 | w cat 0 | w/o cat 0 |
</br>|--------------------------------------------|
</br>|r 1 | 6.14 | 6.14 | 6.14 |
</br>|a 2 | 2.81 | 2.81 | 2.81 |
</br>|s 3 | 6.59 | 6.59 | 6.59 |
</br>|t 4 | 8.86 | 8.86 | 8.86 |
</br>|_ 5 | 6.14 | 6.14 | 6.14 |
</br>|5 6 | 15.31 | 15.31 | 15.31 |
</br>|--------------------------------------------|
</br>|Total | | | |
</br>|with 0 | 45.85 | 45.85 | 45.85 |
</br>|--------------------------------------------|
</br>|w/o 0 | 45.85 | 45.85 | 45.85 |
</br>+--------------------------------------------+
</br>
</br>+--------------------------------+
</br>| | Table Row Total |
</br>| cat# | w cat 0 | w/o cat 0 |
</br>|--------------------------------|
</br>|r 1 | 13.08 | 13.08 |
</br>|a 2 | 5.98 | 5.98 |
</br>|s 3 | 13.75 | 13.75 |
</br>|t 4 | 19.64 | 19.64 |
</br>|_ 5 | 12.83 | 12.83 |
</br>|5 6 | 32.73 | 32.73 |
</br>|--------------------------------|
</br>|Total | | |
</br>|with 0 | 98.02 | 98.02 |
</br>|--------------------------------|
</br>|w/o 0 | 98.02 | 98.02 |
</br>+--------------------------------+
</br>
</br></p></body></html>

View File

@ -0,0 +1,5 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><p>N = 14743
</br>1.000000 0.018635 -0.000101
</br>0.018635 1.000000 -0.012230
</br>-0.000101 -0.012230 1.000000
</br></p></body></html>

View File

@ -0,0 +1 @@
0 1-6

View File

@ -0,0 +1,34 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><p> +----------------------------------------------------------------------------+
</br> | Map: rast_5d2c2bb6a52ed3 Date: Mon Jul 15 10:31:02 2019 |
</br> | Mapset: PERMANENT Login of Creator: alex |
</br> | Location: temp_location |
</br> | DataBase: /tmp/processing_196bdf4c941d49fd9a8ac7a1b15bb07d/grassdata |
</br> | Title: |
</br> | Timestamp: none |
</br> |----------------------------------------------------------------------------|
</br> | |
</br> | Type of Map: GDAL-link Number of Categories: 0 |
</br> | Data Type: FCELL |
</br> | Rows: 109 |
</br> | Columns: 139 |
</br> | Total Cells: 15151 |
</br> | Projection: unnamed |
</br> | N: 6693700 S: 6682800 Res: 100 |
</br> | E: 358400 W: 344500 Res: 100 |
</br> | Range of data: min = -303 max = 14847 |
</br> | |
</br> | Data Source: |
</br> | /home/alex/devel/qgis/python/plugins/processing/tests/testdata/custom/g |
</br> | |
</br> | |
</br> | Data Description: |
</br> | generated by r.external |
</br> | |
</br> | Comments: |
</br> | r.external --overwrite -o input="/home/alex/devel/qgis/python/plugin\ |
</br> | s/processing/tests/testdata/custom/grass7/float_raster.tif" output="\ |
</br> | rast_5d2c2bb6a52ed3" band=1 |
</br> | |
</br> +----------------------------------------------------------------------------+
</br>
</br></p></body></html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><p>Null value area ignored in calculation: 1510000.000000
</br>Plan area used in calculation: 149040000.000000
</br>Surface area calculation(low, high, avg):
</br> 143171894.810657 143200607.945173 143186251.377915
</br>Current region plan area: 151510000.000000
</br>Estimated region Surface Area: 145559238.769913
</br></p></body></html>

View File

@ -404,19 +404,23 @@ tests:
hash: b147ed0a7ac16afa33bed88c0bd94042f01b529225371fa9ce4a1d8b
type: rasterhash
# - algorithm: grass7:r.surf.area
# name: GRASS7 r.surf.area
# params:
# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0
# map:
# name: custom/grass7/raster_6class.tif
# type: raster
# units: '2'
# vscale: 1
# results:
# rawoutput:
# name: expected/grass7/r.surf.area.txt
# type: file
- algorithm: grass7:r.surf.area
name: GRASS7 r.surf.area
params:
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
map:
name: custom/grass7/raster_6class.tif
type: raster
units: 2
vscale: 1.0
results:
html:
name: expected/grass7/r_surf_area.html
type: regex
rules:
- 'Null value area ignored in calculation: 1510000.000000'
- '143171894.810657 143200607.945173 143186251.377915'
- 'Estimated region Surface Area: 145559238.769913'
- algorithm: grass7:r.sunmask.position
name: GRASS7 r.sunmask.position
@ -563,39 +567,45 @@ tests:
# name: expected/grass7/r.stats.quantile.txt
# type: file
# - algorithm: grass7:r.stats
# name: GRASS7 r.stats
# params:
# '-1': false
# -A: true
# -C: false
# -N: false
# -a: false
# -c: true
# -g: false
# -i: false
# -l: false
# -n: false
# -p: false
# -r: false
# -x: false
# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0
# input:
# params:
# - name: custom/grass7/raster_6class.tif
# type: raster
# - name: custom/grass7/raster_5class.tif
# type: raster
# - name: custom/grass7/raster_4class.tif
# type: raster
# type: multi
# nsteps: '255'
# nv: '*'
# separator: space
# results:
# rawoutput:
# name: expected/grass7/r.stats.txt
# type: file
- algorithm: grass7:r.stats
name: GRASS7 r.stats
params:
'-1': true
-A: false
-C: false
-N: false
-a: false
-c: false
-g: false
-i: false
-l: false
-n: false
-p: false
-r: false
-x: false
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
input:
params:
- name: custom/grass7/raster_6class.tif
type: raster
- name: custom/grass7/raster_5class.tif
type: raster
- name: custom/grass7/raster_4class.tif
type: raster
type: multi
nsteps: 255
null_value: '0'
separator: space
sort: 0
results:
html:
name: expected/grass7/r_stats.html
type: regex
rules:
- '6 2 1'
- '4 3 4'
- '0 1 2'
- '1 1 3'
- algorithm: grass7:r.statistics
name: GRASS7 r.statistics
@ -790,29 +800,26 @@ tests:
# name: expected/grass7/r.category.out.txt
# type: file
# - algorithm: grass7:r.coin
# name: GRASS7 r.coin
# params:
# -w: true
# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0
# first:
# name: custom/grass7/raster_4class.tif
# type: raster
# second:
# name: custom/grass7/raster_6class.tif
# type: raster
# units: '1'
# results:
# rawoutput:
# type: regex
# name: expected/grass7/r.coin.txt
# rules:
# - '|t 1 | 0.29 | 1.55 | 5.10 | 6.14 | 13.08 | 13.08 |'
# - '|m 2 | 0.12 | 0.69 | 2.36 | 2.81 | 5.98 | 5.98 |'
# - '|p 3 | 0.28 | 1.39 | 5.50 | 6.59 | 13.75 | 13.75 |'
# - '|1 4 | 0.36 | 2.20 | 8.22 | 8.86 | 19.64 | 19.64 |'
# - '|4 5 | 0.30 | 1.35 | 5.04 | 6.14 | 12.83 | 12.83 |'
# - '|6 6 | 0.61 | 3.89 | 12.91 | 15.31 | 32.73 | 32.73 |'
- algorithm: grass7:r.coin
name: GRASS7 r.coin
params:
-w: false
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
first:
name: custom/grass7/raster_4class.tif
type: raster
second:
name: custom/grass7/raster_6class.tif
type: raster
units: 1
results:
html:
name: expected/grass7/r_coin.html
type: regex
rules:
- '|r 1 | 0.29 | 1.55 | 5.10 | 6.94 | 6.94 |'
- '|a 2 | 0.12 | 0.69 | 2.36 | 3.17 | 3.17 |'
- '|5 6 | 0.61 | 3.89 | 12.91 | 17.42 | 17.42 |'
- algorithm: grass7:r.colors.out
name: GRASS7 r.colors.out)
@ -915,24 +922,28 @@ tests:
hash: d08b86dbf86d283f642381dd38ef62e0d6ec2ec905fcbee66fe631cd
type: rasterhash
# - algorithm: grass7:r.covar
# name: GRASS7 r.covar
# params:
# -r: false
# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0
# map:
# params:
# - name: custom/grass7/raster_6class.tif
# type: raster
# - name: custom/grass7/raster_5class.tif
# type: raster
# - name: custom/grass7/raster_4class.tif
# type: raster
# type: multi
# results:
# rawoutput:
# name: expected/grass7/r.covar.txt
# type: file
- algorithm: grass7:r.covar
name: GRASS7 r.covar
params:
-r: true
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
map:
params:
- name: custom/grass7/raster_6class.tif
type: raster
- name: custom/grass7/raster_5class.tif
type: raster
- name: custom/grass7/raster_4class.tif
type: raster
type: multi
results:
html:
name: expected/grass7/r_covar.html
type: regex
rules:
- '1.000000 0.018635 -0.000101'
- '0.018635 1.000000 -0.012230'
- '-0.000101 -0.012230 1.000000'
- algorithm: grass7:r.cross
name: GRASS7 r.cross
@ -954,23 +965,25 @@ tests:
hash: 1eccafaa5b459c8a57e72d449f1586a4088bda82fe891f8687dbd94b
type: rasterhash
# - algorithm: grass7:r.describe
# name: GRASS7 r.describe
# params:
# -d: false
# -i: false
# -n: false
# -r: false
# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0
# map:
# name: custom/grass7/raster_6class.tif
# type: raster
# nsteps: 255
# nv: 0
# results:
# rawoutput:
# name: expected/grass7/r.describe.txt
# type: file
- algorithm: grass7:r.describe
name: GRASS7 r.describe
params:
-d: false
-i: false
-n: false
-r: false
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
map:
name: custom/grass7/raster_6class.tif
type: raster
nsteps: 255
null_value: '0'
results:
html:
name: expected/grass7/r_describe.html
type: regex
rules:
- '0 1-6'
# - algorithm: grass7:r.distance
# name: GRASS7 r.distance
@ -1175,29 +1188,24 @@ tests:
- d447a4dfb85ed7f4d819e68b32eb1303bd2040ca72077892d3e3cec7
type: rasterhash
# - algorithm: grass7:r.info
# name: GRASS7 r.info
# params:
# -d: false
# -g: false
# -h: false
# -m: false
# -p: false
# -r: false
# -s: false
# -t: false
# -u: false
# GRASS_REGION_PARAMETER: 344500.0,358400.0,6682800.0,6693700.0
# map:
# name: custom/grass7/float_raster.tif
# type: raster
# results:
# rawoutput:
# name: expected/grass7/r.info.txt
# type: regex
# rules:
# - 'N: 6693700 S: 6682800 Res: 100'
# - 'E: 358400 W: 344500 Res: 100'
- algorithm: grass7:r.info
name: GRASS7 r.info
params:
-e: false
-g: false
-h: false
-r: false
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
map:
name: custom/grass7/float_raster.tif
type: raster
results:
html:
name: expected/grass7/r_info.html
type: regex
rules:
- '| N: 6693700 S: 6682800 Res: 100 |'
- '| E: 358400 W: 344500 Res: 100 |'
# - algorithm: grass7:r.li.cwed
# name: GRASS7 r.li.cwed