Skip to content

Commit

Permalink
Add another bunch of tests for rasters
Browse files Browse the repository at this point in the history
  • Loading branch information
Médéric RIBREUX committed Jun 26, 2016
1 parent 2a98098 commit a1c541e
Show file tree
Hide file tree
Showing 37 changed files with 1,185 additions and 101 deletions.
82 changes: 14 additions & 68 deletions python/plugins/processing/tests/grass7_todo.md
Expand Up @@ -2,76 +2,22 @@

## Raster algorithms

* r.basins.fill
* r.carve: needs a vector input
* r.category
* r.category.out
* r.coin
* r.colors
* r.colors.out
* r.colors.stddev
* r.composite
* r.contour.level
* r.contour.step
* r.cost.coordinates
* r.cost.points
* r.cost.raster
* r.covar
* r.cross
* r.describe
* r.distance
* r.drain
* r.fill.dir
* r.fillnulls
* r.flow
* r.flow.aspect
* r.flow.aspect.barrier
* r.flow.barrier
* r.grow
* r.grow.distance
* r.gwflow
* r.his
* r.basins.fill: needs different input rasters (result is always empty).
* r.carve: needs a vector input.
* r.colors: needs to handle output directories.
* r.colors.stddev: needs to find a way to test color table.
* r.contour.level: needs to export vector to GeoJSON (instead of Shapefile).
* r.contour.step: needs to export vector to GeoJSON (instead of Shapefile).
* r.drain: needs another dataset.
* r.flow.aspect.barrier: needs another dataset.
* r.flow.barrier: needs another dataset.
* r.grow: needs another dataset.
* r.grow.distance: needs another dataset.
* r.gwflow: needs another (huge) dataset.
* r.horizon
* r.horizon.height
* r.in.lidar
* r.in.lidar.info
* r.info
* r.kappa
* r.lake.coords
* r.lake.layer
* r.latlong
* r.li.cwed
* r.li.cwed.ascii
* r.li.dominance
* r.li.dominance.ascii
* r.li.edgedensity
* r.li.edgedensity.ascii
* r.li.mpa
* r.li.mpa.ascii
* r.li.mps
* r.li.mps.ascii
* r.li.padcv
* r.li.padcv.ascii
* r.li.padrange
* r.li.padrange.ascii
* r.li.padsd
* r.li.padsd.ascii
* r.li.patchdensity
* r.li.patchdensity.ascii
* r.li.patchnum
* r.li.patchnum.ascii
* r.li.pielou
* r.li.pielou.ascii
* r.li.renyi
* r.li.renyi.ascii
* r.li.richness
* r.li.richness.ascii
* r.li.shannon
* r.li.shannon.ascii
* r.li.shape
* r.li.shape.ascii
* r.li.simpson
* r.li.simpson.ascii
* r.in.lidar: needs another dataset.
* r.in.lidar.info: needs another dataset.
* r.mapcalc
* r.mask.rast
* r.mask.vect
Expand Down
Binary file not shown.
@@ -0,0 +1 @@
PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]
@@ -0,0 +1 @@
PROJCS["RGF93 / Lambert-93",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2154"]]
Binary file not shown.
Binary file not shown.
Expand Up @@ -11,12 +11,12 @@
</HistItem>
</Histograms>
<Metadata>
<MDI key="COLOR_TABLE_RULES_COUNT">5</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_0">1.000000e+00 1.600000e+00 255 255 0 0 255 0</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_1">1.600000e+00 2.200000e+00 0 255 0 0 255 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_2">2.200000e+00 2.800000e+00 0 255 255 0 0 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_3">2.800000e+00 3.400000e+00 0 0 255 255 0 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_4">3.400000e+00 4.000000e+00 255 0 255 255 0 0</MDI>
<MDI key="COLOR_TABLE_RULES_COUNT">5</MDI>
<MDI key="Generated_with">GRASS GIS 7.0.3</MDI>
<MDI key="STATISTICS_MAXIMUM">4</MDI>
<MDI key="STATISTICS_MEAN">3.3133333333333</MDI>
Expand Down
Expand Up @@ -11,12 +11,12 @@
</HistItem>
</Histograms>
<Metadata>
<MDI key="COLOR_TABLE_RULES_COUNT">5</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_0">1.000000e+00 1.800000e+00 255 255 0 0 255 0</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_1">1.800000e+00 2.600000e+00 0 255 0 0 255 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_2">2.600000e+00 3.400000e+00 0 255 255 0 0 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_3">3.400000e+00 4.200000e+00 0 0 255 255 0 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_4">4.200000e+00 5.000000e+00 255 0 255 255 0 0</MDI>
<MDI key="COLOR_TABLE_RULES_COUNT">5</MDI>
<MDI key="Generated_with">GRASS GIS 7.0.3</MDI>
<MDI key="STATISTICS_MAXIMUM">5</MDI>
<MDI key="STATISTICS_MEAN">3.4714760638298</MDI>
Expand Down
Expand Up @@ -11,12 +11,12 @@
</HistItem>
</Histograms>
<Metadata>
<MDI key="COLOR_TABLE_RULES_COUNT">5</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_0">1.000000e+00 2.000000e+00 255 255 0 0 255 0</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_1">2.000000e+00 3.000000e+00 0 255 0 0 255 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_2">3.000000e+00 4.000000e+00 0 255 255 0 0 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_3">4.000000e+00 5.000000e+00 0 0 255 255 0 255</MDI>
<MDI key="COLOR_TABLE_RULE_RGB_4">5.000000e+00 6.000000e+00 255 0 255 255 0 0</MDI>
<MDI key="COLOR_TABLE_RULES_COUNT">5</MDI>
<MDI key="Generated_with">GRASS GIS 7.0.3</MDI>
<MDI key="STATISTICS_MAXIMUM">6</MDI>
<MDI key="STATISTICS_MEAN">4.1343333333333</MDI>
Expand Down
@@ -0,0 +1,2 @@
SAMPLINGFRAME 0|0|1|1
SAMPLEAREA 0.0|0.0|1.0|1.0
@@ -0,0 +1,3 @@
SAMPLINGFRAME 0.1223021582733813|0.14678899082568808|0.26605504587155965|0.39568345323741005
SAMPLEAREA -1|-1|0.09174311926605505|0.07194244604316546
MOVINGWINDOW
@@ -0,0 +1,4 @@
1,2,0.65
3,4,0.32
5,6,0.54

@@ -0,0 +1,5 @@
1
2
3
4
5
@@ -0,0 +1,35 @@

+------------------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------------------+ +-----------------------+

@@ -0,0 +1,4 @@
-303 0:0:0
14847 255:255:255
nv 255:255:255
default 255:255:255
@@ -0,0 +1,4 @@
N = 14743
3.032568 0.048485 -0.000132
0.048485 2.232202 -0.013692
-0.000132 -0.013692 0.561513
@@ -0,0 +1 @@
0 1-6
@@ -0,0 +1,4 @@
1:1:0:344550:6693650:344550:6693650
2:1:100:355550:6693650:355550:6693550
3:1:100:352750:6693650:352650:6693650
4:1:100:344650:6693650:344550:6693650
@@ -0,0 +1,29 @@
+----------------------------------------------------------------------------+
| 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 |
| |
+----------------------------------------------------------------------------+

@@ -0,0 +1,59 @@
ACCURACY ASSESSMENT
LOCATION: temp_location Sun Jun 26 12:49:27 2016
MASK: none
MAPS: MAP1 = (untitled) (tmp14669381667410 in PERMANENT)
MAP2 = (untitled) (tmp1466938166749 in PERMANENT)

Error Matrix
Panel #1 of 2
MAP1
cat# 1 2 3 4 5
M 1 44 18 42 55 45
A 2 0 0 0 0 0
P 3 0 0 0 0 0
2 4 0 0 0 0 0
5 0 0 0 0 0
6 0 0 0 0 0
Col Sum 44 18 42 55 45

Panel #2 of 2
MAP1
cat# 6 Row Sum
M 1 93 297
A 2 0 0
P 3 0 0
2 4 0 0
5 0 0
6 0 0
Col Sum 93 297


Cats % Commission % Ommission Estimated Kappa
1 85.185185 0.000000 0.000000
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA

Kappa Kappa Variance
0.000000 0.005729

Obs Correct Total Obs % Observed Correct
44 297 14.814815

MAP1 Category Description
1: (no description)
2: (no description)
3: (no description)
4: (no description)
5: (no description)
6: (no description)

MAP2 Category Description
1: (no description)
2: (no description)
3: (no description)
4: (no description)
5: (no description)
6: (no description)
@@ -0,0 +1 @@
RESULT 1|1484.18
@@ -0,0 +1 @@
RESULT 1|0.121643391969718
@@ -0,0 +1 @@
RESULT 1|24.86
@@ -0,0 +1 @@
RESULT 1|4.13433333333333
@@ -0,0 +1 @@
RESULT 1|1.6642627316099
@@ -0,0 +1 @@
RESULT 1|102.492806034809
@@ -0,0 +1 @@
RESULT 1|36
@@ -0,0 +1 @@
RESULT 1|1.70574957341855
@@ -0,0 +1 @@
RESULT 1|60.0866666666667
@@ -0,0 +1 @@
RESULT 1|9013
@@ -0,0 +1 @@
RESULT 1|0.932109530291962
@@ -0,0 +1 @@
RESULT 1|1.47108219688802
@@ -0,0 +1 @@
RESULT 1|6
@@ -0,0 +1 @@
RESULT 1|1.67011607725834
@@ -0,0 +1 @@
RESULT 1|97.1875880278272
@@ -0,0 +1 @@
RESULT 1|0.790194657777778

0 comments on commit a1c541e

Please sign in to comment.