pksieve(1)

NAME
pksieve - program to sieve filter raster image

SYNOPSIS
\FCpksieve\F[]
\FC-i\F[] input [\FC-s\F[] size] \FC-o\F[] output [options]

DESCRIPTION
pksieve filters small objects (maximum size defined with the option \FC-s\F[]) in a raster by replacing them to the largest neighbor object. In this context, objects are defined as pixels of the same value that are also connected. The connection can be defined in four directions (N-S and W-E: set option \FC-c\F[] 4) or eight directions (N-S, W-E and diagonals NW-SE, NE-SW: set option \FC-c\F[] 8).

OPTIONS

\FC-i\F[] filename, \FC--input\F[] filename
    Input image file

\FC-s\F[] size, \FC--size\F[] size
    raster polygons with sizes smaller than this will be merged into their largest neighbour. No sieve is performed if size = 0

\FC-o\F[] filename, \FC--output\F[] filename
    Output image file Output image file

\FC-c\F[] 4|8, \FC--connect\F[] 4|8
    the connectedness: 4 directions or 8 directions

\FC-b\F[] band, \FC--band\F[] band
    the band to be used from input file

\FC-m\F[] filename, \FC--mask\F[] filename
    Use the first band of the specified file as a validity mask (zero is invalid, non-zero is valid).

\FC-ot\F[] type, \FC--otype\F[] type
    Data type for output image ({Byte / Int16 / UInt16 / UInt32 / Int32 / Float32 / Float64 / CInt16 / CInt32 / CFloat32 / CFloat64}). Empty string: inherit type from input image

\FC-of\F[] format, \FC--oformat\F[] format
    Output image format (see also gdal_translate(1)). Empty string: inherit from input image

\FC-co\F[] option, \FC--co\F[] option
    Creation option for output file. Multiple options can be specified.

\FC-ct\F[] filename, \FC--ct\F[] filename
    colour table in ASCII format having 5 columns: id R G B ALFA (0: transparent, 255: solid)

\FC-v\F[] level, \FC--verbose\F[] level
    verbose mode if > 0

EXAMPLE
merge all patches smaller than 5 pixels into bigger classes, using 8 connectivity (horizontal, vertical and diagonal)

\FC
pksieve -i input.tif -c 8 -c 5 -o output.shp
      \F[]