GDAL_SIEVE(1)
π NAME π
gdal_sieve β bestie, it removes small raster polygons. That's the whole vibe. β¨
π¦ SYNOPSIS π¦
gdal_sieve.py [-q] [-st threshold] [-4] [-8] [-o name=value]
srcfile [-nomask] [-mask filename] [-of format] [dstfile]
Okay so here's the shape of the call, and yes, it's giving "one long line with a soft wrap in the middle":
-qβ first flag in the lineup π-stthreshold β it takes a value literally calledthresholdin the synopsis-4β a flag, four-shaped-8β a flag, eight-shaped-oname=value β takes aname=valuepair, iconicallysrcfileβ the source file, sitting there in the middle of everything-nomaskβ no mask, per the name on the tin-maskfilename β takes a filename-offormat β takes a formatdstfileβ destination file, last but never least π
Real talk: this page's synopsis is the entire flag lore. The description below doesn't break them down one by one, so I'm not gonna sit here and make up what each one does to you. No cap. π
πΈ DESCRIPTION πΈ
gdal_sieve.py is that girl who goes through your raster and removes the raster polygons smaller than a provided threshold size (in pixels), then replaces each one with the pixel value of the largest neighbour polygon. Lowkey iconic behaviour. π
The result can go two ways, and both are valid:
- written back to the existing raster band, or
- copied into a new file. β¨
Now the part where you need to pay attention, bestie, because this is the catch:
The input dataset is read as integer data, which means floating point values are rounded to integers. fr fr. So you may need to re-scale your source data in some cases β the manpage's own example being 32-bit floating point data withmin=0andmax=1. π
If you want the full algorithm tea β the actual math, the nerdy details β that lives in the GDALSieveFilter() docs. Go read those, they ate. ππ₯
π AUTHOR π
Frank Warmerdam <warmerdam@pobox.com> β shoutout to the main character who wrote this. π
β COPYRIGHT β
1998-2026 β yeah, that's the whole copyright line. Periodt.
okay that's the whole page, bestie!! π«Ά this was GDAL, dated Jan 08, 2026 β go sieve some polygons and slay πβ¨ππ¦
π¦ where this page comes from
- epel 9: gdal3.4-python-tools 3.4.3-5.el9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms