GDAL_SIEVE(1)

πŸ“¦
version 3.4.3 Β· 2 versions
, in epel 9

πŸ’… 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 πŸŽ€
  • -st threshold β€” it takes a value literally called threshold in the synopsis
  • -4 β€” a flag, four-shaped
  • -8 β€” a flag, eight-shaped
  • -o name=value β€” takes a name=value pair, iconically
  • srcfile β€” the source file, sitting there in the middle of everything
  • -nomask β€” no mask, per the name on the tin
  • -mask filename β€” takes a filename
  • -of format β€” takes a format
  • dstfile β€” 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 with min=0 and max=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. πŸ‘‘


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