Create mask raster layer

Create a mask raster layer by evaluating a source raster layer.

Usage:

  1. Open the algorithm from the processing toolbox.

  2. Select a raster layer to be masked and modify the python script to fit your needs, then click run.

    ../../../../_images/create_mask.png
  3. The output raster can be found under Rasters in the Data Source Panel

Parameters

Raster layer [raster]

Raster layer.

Band [band]

Band to be evaluated.

Mask no data values [boolean]

Whether to mask no data values. Default: True

Mask non-finite values [boolean]

Whether to mask non-finite values (i.e. Inf and NaN). Default: True

Mask values [matrix]

Values to be masked.

Mask value ranges [matrix]

Value-ranges to be masked.

Mask bits [matrix]

Bits to be masked. A bit mask part is specified by the “First bit”, the “Bit count” and a list of “Values” (space- or comma-separated) to be masked.

Outputs

Output mask raster layer [rasterDestination]

Raster file destination.

Command-line usage

>qgis_process help enmapbox:createmaskrasterlayer:

----------------
Arguments
----------------

raster: Raster layer
    Argument type:    raster
    Acceptable values:
        - Path to a raster layer
band: Band
    Argument type:    band
    Acceptable values:
        - Integer value representing an existing raster band number
maskNoDataValues: Mask no data values (optional)
    Default value:    true
    Argument type:    boolean
    Acceptable values:
        - 1 for true/yes
        - 0 for false/no
        - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
        - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
maskNonFiniteValues: Mask non-finite values (optional)
    Default value:    true
    Argument type:    boolean
    Acceptable values:
        - 1 for true/yes
        - 0 for false/no
        - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
        - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
maskValues: Mask values (optional)
    Argument type:    matrix
    Acceptable values:
        - A comma delimited list of values
maskValueRanges: Mask value ranges (optional)
    Argument type:    matrix
    Acceptable values:
        - A comma delimited list of values
maskBits: Mask bits (optional)
    Argument type:    matrix
    Acceptable values:
        - A comma delimited list of values
outputMask: Output mask raster layer (optional)
    Argument type:    rasterDestination
    Acceptable values:
        - Path for new raster layer

----------------
Outputs
----------------

outputMask: <outputRaster>
    Output mask raster layer