
/*!
\if man
\page gdal_sieve
\else
\page gdal_sieve gdal_sieve.py
\endif

Removes small raster polygons.

\section gdal_sieve_synopsis SYNOPSIS

\verbatim
gdal_sieve.py [-q] [-st threshold] [-4] [-8] [-o name=value]
           srcfile [-nomask] [-mask filename] [-of format] [dstfile]
\endverbatim

\section gdal_sieve_description DESCRIPTION

The gdal_sieve.py script removes raster polygons smaller than a provided
threshold size (in pixels) and replaces replaces them with the pixel value
of the largest neighbour polygon.  The result can be written back to the
existing raster band, or copied into a new file.

The input dataset is read as integer data which means that floating point
values are rounded to integers. Re-scaling source data may be necessary in
some cases (e.g. 32-bit floating point data with min=0 and max=1).

Additional details on the algorithm are available in the GDALSieveFilter()
docs.

<dl>

<dt> <b>-q</b>:</dt><dd>
The script runs in quiet mode.  The progress monitor is suppressed and routine
messages are not displayed.

<dt> <b>-st</b> <i>threshold</i>:</dt><dd>
Set the size threshold in pixels.  Only raster polygons smaller than this size
will be removed.

<dt> <b>-o</b> <i>name=value</i>:</dt><dd>
Specify a special argument to the algorithm.  Currently none are supported.
</dd>

<dt> <b>-4</b>:</dt><dd>
Four connectedness should be used when determining polygons.  That is
diagonal pixels are not considered directly connected.  This is the default.
</dd>

<dt> <b>-8</b>:</dt><dd>
Eight connectedness should be used when determining polygons.  That is
diagonal pixels are considered directly connected.
</dd>

<dt> <i>srcfile</i></dt><dd> The source raster file used to identify target pixels.  Only the first band is used.</dd>

<dt> <b>-nomask</b>:</dt><dd>
Do not use the default validity mask for the input band (such as nodata, or
alpha masks).
</dd>

<dt> <b>-mask</b> <i>filename</i>:</dt><dd>
Use the first band of the specified file as a validity mask (zero is invalid,
non-zero is valid).
</dd>

<dt> <i>dstfile</i></dt><dd> The new file to create with the filtered result.  If not provided, the source band is updated in place.</dd>

<dt> <b>-of</b> <em>format</em>:</dt><dd> Select the output format. The default is GeoTIFF (GTiff). Use the short format name. </dd>

</dl>

\if man
\section gdal_sieve_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/

