Skip to content

Commit c7cb5a8

Browse files
committedDec 17, 2018
[processing][SAGA] Fix output type of Zonal Grid Stats alg
and add unit test Fixes #20815
1 parent 1ff3ddc commit c7cb5a8

File tree

4 files changed

+54
-1
lines changed

4 files changed

+54
-1
lines changed
 

‎python/plugins/processing/algs/saga/description/ZonalGridStatistics.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ QgsProcessingParameterMultipleLayers|CATLIST|Categorial Grids|3|None|True
55
QgsProcessingParameterMultipleLayers|STATLIST|Grids to analyze|3|None|True
66
QgsProcessingParameterRasterLayer|ASPECT|Aspect|None|True
77
QgsProcessingParameterBoolean|SHORTNAMES|Short Field Names|True
8-
QgsProcessingParameterVectorDestination|OUTTAB|Zonal Statistics
8+
QgsProcessingParameterVectorDestination|OUTTAB|Zonal Statistics|5
Binary file not shown.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<SAGA_METADATA>
3+
<HISTORY saga-version="2.3.1">
4+
<MODULE library="statistics_grid" id="5" name="Zonal Grid Statistics">
5+
<OPTION type="grid_system" id="PARAMETERS_GRID_SYSTEM" name="Grid system">
6+
<CELLSIZE>0.0001</CELLSIZE>
7+
<XMIN>18.666347944200002</XMIN>
8+
<XMAX>18.7035479442</XMAX>
9+
<YMIN>45.7767515809</YMIN>
10+
<YMAX>45.8116515809</YMAX>
11+
</OPTION>
12+
<OPTION type="boolean" id="SHORTNAMES" name="Short Field Names">TRUE</OPTION>
13+
<INPUT type="grid" id="ZONES" name="Zone Grid" system="PARAMETERS_GRID_SYSTEM">
14+
<MODULE library="io_gdal" id="0" name="Import Raster">
15+
<OPTION type="file" id="FILES" name="Files">"/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/dem_boolean.tif"</OPTION>
16+
<OPTION type="text" id="SELECTION" name="Select from Multiple Bands"/>
17+
<OPTION type="boolean" id="SELECT_SORT" name="Alphanumeric Sorting">TRUE</OPTION>
18+
<OPTION type="boolean" id="TRANSFORM" name="Transformation">TRUE</OPTION>
19+
<OPTION type="choice" id="RESAMPLING" name="Resampling" index="3">B-Spline Interpolation</OPTION>
20+
<OUTPUT type="grid_list" id="GRIDS" name="Grids">dem_boolean</OUTPUT>
21+
</MODULE>
22+
</INPUT>
23+
<OUTPUT type="table" id="OUTTAB" name="Zonal Statistics">Zonal Statistics</OUTPUT>
24+
</MODULE>
25+
</HISTORY>
26+
<SOURCE>
27+
<FILE>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/expected/saga/zonal_grid_stats.dbf</FILE>
28+
<DATABASE>
29+
<FIELDS>
30+
<FIELD TYPE="INTEGER">demboolean</FIELD>
31+
<FIELD TYPE="INTEGER">Count UCU</FIELD>
32+
</FIELDS>
33+
</DATABASE>
34+
<PROJECTION>
35+
<OGC_WKT>GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]</OGC_WKT>
36+
<PROJ4>+init=epsg:4326 +proj=longlat +a=6378137.000000 +b=6356752.314245 +no_defs</PROJ4>
37+
<EPSG>-1</EPSG>
38+
</PROJECTION>
39+
</SOURCE>
40+
<DESCRIPTION></DESCRIPTION>
41+
</SAGA_METADATA>

‎python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,3 +552,15 @@ tests:
552552
- db2c282835706e4320e7c59d86c28d930b35433ec57af70e35a325d5
553553
- 9caba3703fd59f99466c0bf37054826d328d1349cfe03f171655adf6
554554
type: rasterhash
555+
556+
- algorithm: saga:zonalrasterstatistics
557+
name: Zonal grid statistics
558+
params:
559+
ZONES:
560+
name: custom/dem_boolean.tif
561+
type: raster
562+
results:
563+
OUTTAB:
564+
name: expected/saga/zonal_grid_stats.dbf
565+
type: vector
566+

0 commit comments

Comments
 (0)
Please sign in to comment.