Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing][SAGA] Fix output type of Zonal Grid Stats alg
and add unit test

Fixes #20815

(cherry picked from commit c7cb5a8)
  • Loading branch information
nyalldawson committed Dec 17, 2018
1 parent 8c80ff5 commit 5f8870a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
Expand Up @@ -5,4 +5,4 @@ QgsProcessingParameterMultipleLayers|CATLIST|Categorial Grids|3|None|True
QgsProcessingParameterMultipleLayers|STATLIST|Grids to analyze|3|None|True
QgsProcessingParameterRasterLayer|ASPECT|Aspect|None|True
QgsProcessingParameterBoolean|SHORTNAMES|Short Field Names|True
QgsProcessingParameterVectorDestination|OUTTAB|Zonal Statistics
QgsProcessingParameterVectorDestination|OUTTAB|Zonal Statistics|5
Binary file not shown.
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<SAGA_METADATA>
<HISTORY saga-version="2.3.1">
<MODULE library="statistics_grid" id="5" name="Zonal Grid Statistics">
<OPTION type="grid_system" id="PARAMETERS_GRID_SYSTEM" name="Grid system">
<CELLSIZE>0.0001</CELLSIZE>
<XMIN>18.666347944200002</XMIN>
<XMAX>18.7035479442</XMAX>
<YMIN>45.7767515809</YMIN>
<YMAX>45.8116515809</YMAX>
</OPTION>
<OPTION type="boolean" id="SHORTNAMES" name="Short Field Names">TRUE</OPTION>
<INPUT type="grid" id="ZONES" name="Zone Grid" system="PARAMETERS_GRID_SYSTEM">
<MODULE library="io_gdal" id="0" name="Import Raster">
<OPTION type="file" id="FILES" name="Files">"/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/dem_boolean.tif"</OPTION>
<OPTION type="text" id="SELECTION" name="Select from Multiple Bands"/>
<OPTION type="boolean" id="SELECT_SORT" name="Alphanumeric Sorting">TRUE</OPTION>
<OPTION type="boolean" id="TRANSFORM" name="Transformation">TRUE</OPTION>
<OPTION type="choice" id="RESAMPLING" name="Resampling" index="3">B-Spline Interpolation</OPTION>
<OUTPUT type="grid_list" id="GRIDS" name="Grids">dem_boolean</OUTPUT>
</MODULE>
</INPUT>
<OUTPUT type="table" id="OUTTAB" name="Zonal Statistics">Zonal Statistics</OUTPUT>
</MODULE>
</HISTORY>
<SOURCE>
<FILE>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/expected/saga/zonal_grid_stats.dbf</FILE>
<DATABASE>
<FIELDS>
<FIELD TYPE="INTEGER">demboolean</FIELD>
<FIELD TYPE="INTEGER">Count UCU</FIELD>
</FIELDS>
</DATABASE>
<PROJECTION>
<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>
<PROJ4>+init=epsg:4326 +proj=longlat +a=6378137.000000 +b=6356752.314245 +no_defs</PROJ4>
<EPSG>-1</EPSG>
</PROJECTION>
</SOURCE>
<DESCRIPTION></DESCRIPTION>
</SAGA_METADATA>
12 changes: 12 additions & 0 deletions python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml
Expand Up @@ -552,3 +552,15 @@ tests:
- db2c282835706e4320e7c59d86c28d930b35433ec57af70e35a325d5
- 9caba3703fd59f99466c0bf37054826d328d1349cfe03f171655adf6
type: rasterhash

- algorithm: saga:zonalrasterstatistics
name: Zonal grid statistics
params:
ZONES:
name: custom/dem_boolean.tif
type: raster
results:
OUTTAB:
name: expected/saga/zonal_grid_stats.dbf
type: vector

0 comments on commit 5f8870a

Please sign in to comment.