From 45f8b863dbe7f238270a70c4860b24355dd9968f Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 7 Jan 2019 08:55:55 +1000 Subject: [PATCH] [processing][SAGA] Resync parameters for resample tool And add tests Fixes #20882 --- .../algs/saga/description/Resampling.txt | 4 +- .../tests/testdata/saga_algorithm_tests.yaml | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/python/plugins/processing/algs/saga/description/Resampling.txt b/python/plugins/processing/algs/saga/description/Resampling.txt index 6a063813e796..b07e8e07c8a9 100644 --- a/python/plugins/processing/algs/saga/description/Resampling.txt +++ b/python/plugins/processing/algs/saga/description/Resampling.txt @@ -3,8 +3,8 @@ grid_tools QgsProcessingParameterRasterLayer|INPUT|Grid|None|False QgsProcessingParameterBoolean|KEEP_TYPE|Preserve Data Type|True Hardcoded|-TARGET_DEFINITION 0 -QgsProcessingParameterEnum|SCALE_UP|Upscaling Method|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Inverse Distance Interpolation;[3] Bicubic Spline Interpolation;[4] B-Spline Interpolation;[5] Mean Value;[6] Mean Value (cell area weighted);[7] Minimum Value;[8] Maximum Value;[9] Majority -QgsProcessingParameterEnum|SCALE_DOWN|Downscaling Method|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Inverse Distance Interpolation;[3] Bicubic Spline Interpolation;[4] B-Spline Interpolation +QgsProcessingParameterEnum|SCALE_UP|Upscaling Method|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Bicubic Spline Interpolation;[3] B-Spline Interpolation;[4] Mean Value;[5] Mean Value (cell area weighted);[6] Minimum Value;[7] Maximum Value;[8] Majority|False|5 +QgsProcessingParameterEnum|SCALE_DOWN|Downscaling Method|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Bicubic Spline Interpolation;[3] B-Spline Interpolation|False|3 QgsProcessingParameterExtent|TARGET_USER_XMIN TARGET_USER_XMAX TARGET_USER_YMIN TARGET_USER_YMAX|Output extent|None|True QgsProcessingParameterNumber|TARGET_USER_SIZE|Cellsize|QgsProcessingParameterNumber.Double|100.0|False|None|None QgsProcessingParameterEnum|TARGET_USER_FITS|Fit|[0] nodes;[1] cells diff --git a/python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml b/python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml index 128be85f2c64..7a325b34f4b1 100644 --- a/python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml +++ b/python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml @@ -564,3 +564,50 @@ tests: name: expected/saga/zonal_grid_stats.dbf type: vector + - algorithm: saga:resampling + name: Resample down + params: + INPUT: + name: dem.tif + type: raster + KEEP_TYPE: true + SCALE_DOWN: 3 + SCALE_UP: 5 + TARGET_USER_FITS: 0 + TARGET_USER_SIZE: 0.0005 + results: + OUTPUT: + hash: 1b3a17a724c489ea2eea60b39bc1b9c79778832bd41e982a4e9fb09f + type: rasterhash + + - algorithm: saga:resampling + name: Resample up + params: + INPUT: + name: dem.tif + type: raster + KEEP_TYPE: true + SCALE_DOWN: 3 + SCALE_UP: 5 + TARGET_USER_FITS: 0 + TARGET_USER_SIZE: 5.0e-05 + results: + OUTPUT: + hash: 32008adf7520fee2848d689fcb53d0f8ac862bcd162575b03fefc7f1 + type: rasterhash + + - algorithm: saga:resamplingfilter + name: Resampling filter + params: + GRID: + name: dem.tif + type: raster + SCALE: 10.0 + results: + HIPASS: + hash: cf992e69d506924bb59a5fbabd86617e263cb951a61c1b3c0b10012b + type: rasterhash + LOPASS: + hash: f36069a8ceb7ffe839a34f66b82eebacb80143e9df4ed54485bf8293 + type: rasterhash +