| pktools 2.6.7 Processing Kernel for geospatial data

pkgetmask

program to create mask image based on values in input raster image

## SYNOPSIS

`Usage: pkgetmask -i input -o output`

``

`Options: [-min value]* [-max value]* [-data value]* [-nodata value]*`

`Advanced options: [-b band]* [–operator AND|OR] [-ot type] [-of format] [-co option]* [-ct table]`

``

# Description

The utility pkgetmask creates a mask raster dataset from an input raster dataset. Values smaller than the minimum value (-min) or larger than the maximum value (-max) will result in a -nodata value in the mask.

# Options

- use either `-short` or `--long` options (both `--long=value` and `--long value` are supported)
- short option `-h` shows basic options only, long option `--help` shows all options

  short | long | type | default | description
  --- | --- | --- | --- | ---
  i | input | std::string |  | Input image file
  o | output | std::string |  | Output mask file
  min | min | double |  | Values smaller than min threshold(s) are masked as invalid. Use one threshold for each band
  max | max | double |  | Values greater than max threshold(s) are masked as invalid. Use one threshold for each band
  data | data | unsigned short | 1 | value(s) for valid pixels: between min and max
  nodata | nodata | unsigned short | 0 | value(s) for invalid pixels: not between min and max
  b | band | short | 0 | band(s) used for mask
  p | operator | std::string | OR | Operator: [AND,OR].
  ot | otype | std::string | Byte | Data type for output image ({Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/CInt16/CInt32/CFloat32/CFloat64}). Empty string: inherit type from input image
  of | oformat | std::string | GTiff | Output image format (see also gdal_translate).
  co | co | std::string |  | Creation option for output file. Multiple options can be specified.
  ct | ct | std::string |  | color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid)

Usage: pkgetmask -i input -o output

# Examples

Some examples how to use pkgetmask can be found here