Skip to content
Permalink
Browse files

added SAGA watershed segmentation execution test

(cherry picked from commit 819a82a)
  • Loading branch information
luipir authored and nyalldawson committed Aug 23, 2018
1 parent 9da4669 commit 9b91b99c867413d3ce2bf2ef327f95cc517d0691
Showing with 626 additions and 0 deletions.
  1. +41 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_borders.mgrd
  2. +1 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_borders.prj
  3. BIN python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_borders.sdat
  4. +3 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_borders.sdat.aux.xml
  5. +15 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_borders.sgrd
  6. BIN python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_seeds.dbf
  7. +49 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_seeds.mshp
  8. +1 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_seeds.prj
  9. BIN python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_seeds.shp
  10. BIN python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_seeds.shx
  11. +41 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_segments.mgrd
  12. +1 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_segments.prj
  13. +433 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_segments.sdat
  14. +3 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_segments.sdat.aux.xml
  15. +15 −0 python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_segments.sgrd
  16. +23 −0 python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<SAGA_METADATA>
<HISTORY saga-version="2.3.1">
<MODULE library="imagery_segmentation" id="0" name="Watershed Segmentation">
<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.7767514376</YMIN>
<YMAX>45.8116514376</YMAX>
</OPTION>
<OPTION type="choice" id="OUTPUT" name="Output" index="0">Seed Value</OPTION>
<OPTION type="choice" id="DOWN" name="Method" index="0">Minima</OPTION>
<OPTION type="choice" id="JOIN" name="Join Segments based on Threshold Value" index="0">do not join</OPTION>
<OPTION type="double" id="THRESHOLD" name="Threshold">0.500000</OPTION>
<OPTION type="boolean" id="EDGE" name="Allow Edge Pixels to be Seeds">TRUE</OPTION>
<OPTION type="boolean" id="BBORDERS" name="Borders">TRUE</OPTION>
<INPUT type="grid" id="GRID" name="Grid" system="PARAMETERS_GRID_SYSTEM">
<MODULE library="io_gdal" id="0" name="Import Raster">
<OPTION type="file" id="FILES" name="Files">"/home/ginetto/PROGRAMMING/QGIS/QGIS-master/python/plugins/processing/tests/testdata/dem.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</OUTPUT>
</MODULE>
</INPUT>
<OUTPUT type="data_object" id="BORDERS" name="Borders"/>
</MODULE>
</HISTORY>
<SOURCE>
<FILE>/home/ginetto/PROGRAMMING/QGIS/QGIS-master/python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_borders.sgrd</FILE>
<DATABASE></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>
@@ -0,0 +1 @@
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"]]
Binary file not shown.
@@ -0,0 +1,3 @@
<PAMDataset>
<SRS>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"]]</SRS>
</PAMDataset>
@@ -0,0 +1,15 @@
NAME =
DESCRIPTION =
UNIT =
DATAFORMAT = BYTE_UNSIGNED
DATAFILE_OFFSET = 0
BYTEORDER_BIG = FALSE
TOPTOBOTTOM = FALSE
POSITION_XMIN = 18.6662979442
POSITION_YMIN = 45.7767014376
CELLCOUNT_X = 375
CELLCOUNT_Y = 352
CELLSIZE = 0.0001000000
Z_FACTOR = 1.000000
Z_OFFSET = 0.000000
NODATA_VALUE = 0.000000
Binary file not shown.
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<SAGA_METADATA>
<HISTORY saga-version="2.3.1">
<MODULE library="imagery_segmentation" id="0" name="Watershed Segmentation">
<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.7767514376</YMIN>
<YMAX>45.8116514376</YMAX>
</OPTION>
<OPTION type="choice" id="OUTPUT" name="Output" index="0">Seed Value</OPTION>
<OPTION type="choice" id="DOWN" name="Method" index="0">Minima</OPTION>
<OPTION type="choice" id="JOIN" name="Join Segments based on Threshold Value" index="0">do not join</OPTION>
<OPTION type="double" id="THRESHOLD" name="Threshold">0.500000</OPTION>
<OPTION type="boolean" id="EDGE" name="Allow Edge Pixels to be Seeds">TRUE</OPTION>
<OPTION type="boolean" id="BBORDERS" name="Borders">TRUE</OPTION>
<INPUT type="grid" id="GRID" name="Grid" system="PARAMETERS_GRID_SYSTEM">
<MODULE library="io_gdal" id="0" name="Import Raster">
<OPTION type="file" id="FILES" name="Files">"/home/ginetto/PROGRAMMING/QGIS/QGIS-master/python/plugins/processing/tests/testdata/dem.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</OUTPUT>
</MODULE>
</INPUT>
<OUTPUT type="shapes" id="SEEDS" name="Seed Points">dem [Seeds]</OUTPUT>
</MODULE>
</HISTORY>
<SOURCE>
<FILE></FILE>
<DATABASE>
<FIELDS>
<FIELD TYPE="INTEGER">XCELL</FIELD>
<FIELD TYPE="INTEGER">YCELL</FIELD>
<FIELD TYPE="DOUBLE">VALUE</FIELD>
<FIELD TYPE="INTEGER">ID</FIELD>
<FIELD TYPE="INTEGER">ID_JOIN</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>
@@ -0,0 +1 @@
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"]]
Binary file not shown.
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="imagery_segmentation" id="0" name="Watershed Segmentation">
<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.7767514376</YMIN>
<YMAX>45.8116514376</YMAX>
</OPTION>
<OPTION type="choice" id="OUTPUT" name="Output" index="0">Seed Value</OPTION>
<OPTION type="choice" id="DOWN" name="Method" index="0">Minima</OPTION>
<OPTION type="choice" id="JOIN" name="Join Segments based on Threshold Value" index="0">do not join</OPTION>
<OPTION type="double" id="THRESHOLD" name="Threshold">0.500000</OPTION>
<OPTION type="boolean" id="EDGE" name="Allow Edge Pixels to be Seeds">TRUE</OPTION>
<OPTION type="boolean" id="BBORDERS" name="Borders">TRUE</OPTION>
<INPUT type="grid" id="GRID" name="Grid" system="PARAMETERS_GRID_SYSTEM">
<MODULE library="io_gdal" id="0" name="Import Raster">
<OPTION type="file" id="FILES" name="Files">"/home/ginetto/PROGRAMMING/QGIS/QGIS-master/python/plugins/processing/tests/testdata/dem.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</OUTPUT>
</MODULE>
</INPUT>
<OUTPUT type="grid" id="SEGMENTS" name="Segments">dem [Segments]</OUTPUT>
</MODULE>
</HISTORY>
<SOURCE>
<FILE>/home/ginetto/PROGRAMMING/QGIS/QGIS-master/python/plugins/processing/tests/testdata/expected/saga/watershed_segmentation_segments.sgrd</FILE>
<DATABASE></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>
@@ -0,0 +1 @@
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"]]

Large diffs are not rendered by default.

@@ -0,0 +1,3 @@
<PAMDataset>
<SRS>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"]]</SRS>
</PAMDataset>
@@ -0,0 +1,15 @@
NAME = dem [Segments]
DESCRIPTION =
UNIT =
DATAFORMAT = FLOAT
DATAFILE_OFFSET = 0
BYTEORDER_BIG = FALSE
TOPTOBOTTOM = FALSE
POSITION_XMIN = 18.6663479442
POSITION_YMIN = 45.7767514376
CELLCOUNT_X = 373
CELLCOUNT_Y = 350
CELLSIZE = 0.0001000000
Z_FACTOR = 1.000000
Z_OFFSET = 0.000000
NODATA_VALUE = -999999.000000
@@ -429,3 +429,26 @@ tests:
hash: f4ac677152697773262aa1e5f69146a475139014ace77149966ec045
type: rasterhash

- algorithm: saga:watershedsegmentation
name: Test (saga:watershedsegmentation)
params:
'BBORDERS ': true
DOWN: 0
'EDGE ': true
GRID:
name: dem.tif
type: raster
JOIN: 0
OUTPUT: 0
THRESHOLD: 0.5
results:
BORDERS:
hash: d0cd8bdc7c8400bedb2b5c1edc4a64b4c9b7c14692a4f30fbf3c5f2d
type: rasterhash
SEEDS:
name: expected/saga/watershed_segmentation_seeds.shp
type: vector
SEGMENTS:
hash: f2e71e3374eb229d387db8f87bc24d09b86ffc23d9fca85f324b566b
type: rasterhash

0 comments on commit 9b91b99

Please sign in to comment.
You can’t perform that action at this time.