Tool Shrink and Expand (Grid Collection)
This is the multi-raster version of the 'Shrink and Expand' tool for single grids and applies the tool operation to each grid provided by the input grid collection.
With this tool you can shrink and/or expand regions with valid data by a certain distance defined by the (kernel) radius. Shrinking just invalidates all (valid) data cells found within the given distance to no-data cells, while expansion replaces no-data cells with new values based on the evaluation of all (valid) data cells found within the neighbourhood as defined by the kernel. Both operations can be combined.
The method for the value expansion can be chosen as minimum, maximum, mean or majority value. The neighbourhood can be evaluated either at once or in a stepwise iterative way.
- Author: O.Conrad (c) 2023
- Menu: Grid Collection|Gaps
Parameters
| Name | Type | Identifier | Description | Constraints |
Input | Input | Grids, input | INPUT | - | - |
Output | Result (*) | Grids, output, optional | RESULT | - | - |
Options | Grid System | Grid system | PARAMETERS_GRID_SYSTEM | - | - |
Operation | Choice | OPERATION | - | Available Choices: [0] shrink [1] expand [2] shrink and expand [3] expand and shrink Default: 3 |
Search Mode | Choice | CIRCLE | Choose the shape of the kernel. | Available Choices: [0] Square [1] Circle Default: 1 |
Radius | Integer | RADIUS | The kernel radius [cells]. | Minimum: 1 Default: 1 |
Method | Choice | EXPAND | Choose how to fill no-data cells. | Available Choices: [0] minimum [1] maximum [2] mean [3] majority Default: 3 |
Preserve Data Type | Boolean | KEEP_TYPE | If false, mean value expansion results will be stored with floating point precision. | Default: 1 |
Iterative Expansion | Boolean | ITERATIVE | If false, the neighbourhood for expansion is evaluated in one step, else expansion is done stepwise with a one cell radius for each iteration until desired kernel radius is reached. | Default: 0 |
(*) optional |
Command-line
Usage: saga_cmd grid_tools 41 [-OPERATION <str>] [-CIRCLE <str>] [-RADIUS <num>] [-EXPAND <str>] [-KEEP_TYPE <str>] [-ITERATIVE <str>] [-INPUT <str>] [-RESULT <str>]
-OPERATION:<str> Operation
Choice
Available Choices:
[0] shrink
[1] expand
[2] shrink and expand
[3] expand and shrink
Default: 3
-CIRCLE:<str> Search Mode
Choice
Available Choices:
[0] Square
[1] Circle
Default: 1
-RADIUS:<num> Radius
Integer
Minimum: 1
Default: 1
-EXPAND:<str> Method
Choice
Available Choices:
[0] minimum
[1] maximum
[2] mean
[3] majority
Default: 3
-KEEP_TYPE:<str> Preserve Data Type
Boolean
Default: 1
-ITERATIVE:<str> Iterative Expansion
Boolean
Default: 0
-INPUT:<str> Input
Grids, input
-RESULT:<str> Result
Grids, output, optional