Menu

grid_filter_4 Log in to Edit

Anonymous Volker Wichmann
Attachments
UDF1573329.png (19729 bytes)
UDF2434331.png (17167 bytes)

User Defined Filter (3x3)

Author(s) Module: Olaf Conrad, (c) 2001

Author(s) Wiki Documentation: Vern Cimmmery, (c) 2011 (kapcimmery at hotmail dot com)

License Wiki Documentation: Creative Commons Attribution-ShareAlike 3.0 Unported License


Description:

The User Defined Filter (3x3) module creates a new grid data layer by re-calculating grid cell data values for an existing data layer using a mathematical operation on the target cell value and its neighbors. The nature of this operation is determined by the values stored in a user defined matrix or variable sized template or kernel that is centered over each grid cell as it is processed. This matrix or template is like a moving window, progressing from one cell to the next. This matrix can be provided from a saved table or interactively using the settings page.

module settings
Figure UDF.1. Settings page for the module User Defined Filter (3x3).

Input
Grid system
The entry for the ‘Grid system’ parameter must be the grid system the input grid data layer (‘>>Grid’) is a part.

>>Grid
The single input parameter is the grid data layer containing grid cells you wish to be filtered using a user defined filter matrix. This is a mandatory input. The default entry is "[not set]". As noted above, this grid data layer must be a part of the grid system chosen for the 'Grid system' parameter, otherwise, it will not ba available to choose.

The 'Tables: >Filter Matrix' parameter is an optional parameter. A table file must be available in the table section of the 'Data' tab area of the Workspace. If one is available, its' name will appear in the drop-down list of options when you click in the value field to the right of the parameter name. When this option is used, the values for the ‘Default Filter Matrix (3 x 3)‘ parameter are ignored. The size of the table for this parameter is not limited to 3 x 3.

Output
<<Filtered Grid
The output for the module is identified in the value field to the right of the ‘<<Filtered Grid’ parameter. The default is “[not set]”. The default name for the output grid data layer is the name of the input grid data layer concatenated with “[Filter]”.

Options
The ‘Default Filter Matrix (3 x 3)‘ is the single option in the Options section.

Default Filter Matrix (3 x 3)
The ‘Default Filter Matrix (3 x 3)’ parameter is a table made up of 3 rows and 3 columns of numeric values. Figure UDF.2 displays the default matrix value field entry window.

default filter matrix
Figure UDF.2. The default ‘Default Filter Matrix (3 x 3)’ value field entry window.

The edit buttons Add, Insert, and Delete are functional, sort of. Although the module is designed to support only a 3 by 3 matrix, it does support a 4 by 3 matrix. However, a non-symmetrical matrix used as a filter could be problematic. Thus, the Add, Insert, and Delete buttons do work, however, the default 3 by 3 matrix should be used. The Load and Save buttons can be used to save a matrix in a text (.txt) or dBase (.dbf) format.


Execution Example:
This example uses the digital terrain model (DEM) for Mason County, Washington named 'MCdem' for the '>>Grid' parameter. The default value "[not set]" will be used for the '<Filter Matrix' parameter. 1. Execute the Simple Filter module.
2. Select the grid system the input grid data layer is a part for the 'Grid system' paramter.
3. Choose the DEM grid data layer 'MCdem' from the drop-down list of data layers for the grid system chosen for the '>>Grid' parameter.
4. Choose the "[create]" option for the output parameter '<Filtered Grid'.
5. Use the default "[not set]" for the '>FIlter Matrix' parameter.
6. In the Options section, click in the value field to the right of the 'Default Filter Matrix (3 x 3) parameter. The values displayed in the 'Filter Matrix' window are the default values. For this example, I will use the default values for the 3 x 3 matrix.
7. When changes have been made to the module parameters and options, click on the 'Okay' button to execute the module.
8. When module execution is complete, the output grid data layer name will appear in the 'Tab' area of the Workspace. The layer name will be the name of the grid data layer for the '>>Grid' parameter concatenated with "[Gaussian Filter]".


Notes:
1. The input grid data layer (for the '>>Grid' parameter) must be a member of the grid system chosen for the 'Grid system' parameter.
2. The single output parameter ('>Filtered Grid') must be set to the "[create]" option; "[not set]" is the default entry. If you use the default, there will be no output. 3. You can provide an available matrix that is stored in a file by using the '>Filter Matrix' parameter. In order for the file to be chosen, it must be loaded and available in the 'Tables' section of the 'Data' tab area of the Workspace.


References:

Cimmery, Vern (2011): 'User Defined Filter (3x3)', SAGA References, unpublished .pdf document. [PENDING]


Related

Wiki: grid_filter

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.