User Tools

Site Tools


wiki:pksetmask

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:pksetmask [2017/12/05 22:53] (current)
Line 1: Line 1:
 +====== pksetmask ======
 +NAME
 +   ​pksetmask - apply mask to raster file
  
 +SYNOPSIS
 +<code bash>
 +   ​pksetmask -i input -o output [OPTION]
 +</​code>​
 +       
 +DESCRIPTION
 +   Apply mask (flag invalid values) to raster file according to given mask (raster file)
 +       
 +OPTIONS
 +<code bash>
 +   ​-i ​    ​--input ​               Input image (default: <empty string>)
 +   ​-m ​    ​--mask ​                Mask image(s) (default: <empty string>)
 +   ​-o ​    ​--output ​              ​Output mask file (default: <empty string>)
 +   ​-ot ​   --otype ​               Data type for output image ({Byte/​Int16/​UInt16/​UInt32/​Int32/​Float32/​Float64/​CInt16/​CInt32/​CFloat32/​CFloat64}). Empty string: inherit type from input image (default: <empty string>)
 +   ​-of ​   --oformat ​             Output image format (see also gdal_translate). Empty string: inherit from input image (default: <empty string>)
 +   ​-co ​   --co                   ​options:​ NAME=VALUE [-co COMPRESS=LZW] [-co INTERLEAVE=BAND] (default: <empty string>)
 +   ​-t ​    ​--invalid ​             Mask value(s) where image is invalid. Use one value for each mask, or multiple values for a single mask. (default: 1)
 +   ​-p ​    ​--operator ​            ​Operator:​ < = > !. Use operator for each invalid option (default: =)
 +   ​-f ​    ​--flag ​                Flag value to put in image if not valid (0) (default: 0)
 +   ​-ct ​   --ct                   color table (file with 5 columns: id R G B ALFA (0: transparent,​ 255: solid) (default: <empty string>)
 +   ​-v ​    ​--verbose ​             verbose (default: 0)
 +</​code>​
 +
 +====== Examples ======
 +
 +<code bash>
 +pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte -t 0 -f 255 # copy pixel values from input.tif to output.tif, applying mask.tif, setting all values to 255 where mask is 0.
 +
 +pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte -t 1 -f 255 --operator '​!'​ # copy values from input.tif to output.tif, but set all values to 255 if mask is not 1
 +
 +pksetmask -i input.tif -m mask1.tif -m mask2.tif -o output.tif -ot Byte -t 0 -f 255 # copy pixel values from input.tif to output.tif, applying two masks, setting all values to 255 where either mask is 0.
 +
 +pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte -t 0 -t 1 -f 255 -f 255 # copy pixel values from input.tif to output.tif, applying single masks, setting all values to 255 where mask is either 0 or 1.
 +
 +pksetmask -i input.tif -m mask.tif -o output.tif -ot Byte -t 0 -t 1 -f 255 -f 255 # copy pixel values from input.tif to output.tif, applying single masks, setting all values to 255 where mask is either 0 or 1.
 +</​code>​
wiki/pksetmask.txt ยท Last modified: 2017/12/05 22:53 (external edit)