'\" -*- coding: us-ascii -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH pksieve 1 "14 June 2016" "" "" .SH NAME pksieve \- program to sieve filter raster image .SH SYNOPSIS 'nh .fi .ad l \fBpksieve\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \fB-i\fR \fIinput\fR [\fB-s\fR \fIsize\fR] \fB-o\fR \fIoutput\fR [\fIoptions\fR] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBpksieve\fR filters small objects (maximum size defined with the option \*(T<\fB\-s\fR\*(T>) 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 \*(T<\fB\-c\fR\*(T> 4) or eight directions (N-S, W-E and diagonals NW-SE, NE-SW: set option \*(T<\fB\-c\fR\*(T> 8). .SH OPTIONS .TP \*(T<\fB\-i\fR\*(T> \fIfilename\fR, \*(T<\fB\-\-input\fR\*(T> \fIfilename\fR Input image file .TP \*(T<\fB\-s\fR\*(T> \fIsize\fR, \*(T<\fB\-\-size\fR\*(T> \fIsize\fR raster polygons with sizes smaller than this will be merged into their largest neighbour. No sieve is performed if size = 0 .TP \*(T<\fB\-o\fR\*(T> \fIfilename\fR, \*(T<\fB\-\-output\fR\*(T> \fIfilename\fR Output image file Output image file .TP \*(T<\fB\-c\fR\*(T> \fI4|8\fR, \*(T<\fB\-\-connect\fR\*(T> \fI4|8\fR the connectedness: 4 directions or 8 directions .TP \*(T<\fB\-b\fR\*(T> \fIband\fR, \*(T<\fB\-\-band\fR\*(T> \fIband\fR the band to be used from input file .TP \*(T<\fB\-m\fR\*(T> \fIfilename\fR, \*(T<\fB\-\-mask\fR\*(T> \fIfilename\fR Use the first band of the specified file as a validity mask (zero is invalid, non-zero is valid). .TP \*(T<\fB\-ot\fR\*(T> \fItype\fR, \*(T<\fB\-\-otype\fR\*(T> \fItype\fR Data type for output image ({Byte / Int16 / UInt16 / UInt32 / Int32 / Float32 / Float64 / CInt16 / CInt32 / CFloat32 / CFloat64}). Empty string: inherit type from input image .TP \*(T<\fB\-of\fR\*(T> \fIformat\fR, \*(T<\fB\-\-oformat\fR\*(T> \fIformat\fR Output image format (see also \fBgdal_translate\fR(1)). Empty string: inherit from input image .TP \*(T<\fB\-co\fR\*(T> \fIoption\fR, \*(T<\fB\-\-co\fR\*(T> \fIoption\fR Creation option for output file. Multiple options can be specified. .TP \*(T<\fB\-ct\fR\*(T> \fIfilename\fR, \*(T<\fB\-\-ct\fR\*(T> \fIfilename\fR colour table in ASCII format having 5 columns: id R G B ALFA (0: transparent, 255: solid) .TP \*(T<\fB\-v\fR\*(T> \fIlevel\fR, \*(T<\fB\-\-verbose\fR\*(T> \fIlevel\fR verbose mode if > 0 .SH EXAMPLE merge all patches smaller than 5 pixels into bigger classes, using 8 connectivity (horizontal, vertical and diagonal) .PP .nf \*(T< \fBpksieve\fR \fB\-i\fR \fIinput.tif\fR \fB\-c\fR \fI8\fR \fB\-c\fR \fI5\fR \fB\-o\fR \fIoutput.shp\fR \*(T> .fi