dwww Home | Manual pages | Find package

GDAL_POLYGONIZE(1)                   GDAL                   GDAL_POLYGONIZE(1)

NAME
       gdal_polygonize - Produces a polygon feature layer from a raster.

SYNOPSIS
          gdal_polygonize.py [-8] [-nomask] [-mask filename] <raster_file> [-b band]
                             [-q] [-f ogr_format] <out_file> [layer] [fieldname]

DESCRIPTION
       This  utility creates vector polygons for all connected regions of pix-
       els in the raster sharing a common pixel value.  Each polygon  is  cre-
       ated  with  an attribute indicating the pixel value of that polygon.  A
       raster mask may also be provided to determine which pixels are eligible
       for processing.

       The utility will create the output vector datasource if it does not al-
       ready exist, defaulting to GML format.

       The utility is based on the :GDALPolygonize() function which has  addi-
       tional details on the algorithm.

       -8     Use 8 connectedness. Default is 4 connectedness.

       -nomask
              Do not use the default validity mask for the input band (such as
              nodata, or alpha masks).

       -mask <filename>
              Use the first band of the specified  file  as  a  validity  mask
              (zero  is invalid, non-zero is valid). If not specified, the de-
              fault validity mask for the input band (such as nodata, or alpha
              masks) will be used (unless -nomask is specified)

       <raster_file>
              The source raster file from which polygons are derived.

       -b <band>
              The  band  on <raster_file> to build the polygons from. Starting
              with GDAL 2.2, the value can also be set to "mask", to  indicate
              that  the  mask  band  of  the  first  band  must  be  used  (or
              "mask,band_number" for the mask of a specified band)

       -f <ogr_format>
              Select the output format. Starting with GDAL 2.3, if not  speci-
              fied,  the  format is guessed from the extension (previously was
              GML). Use the short format name

       <out_file>
              The destination vector file to which the polygons will be  writ-
              ten.

       <layer>
              The name of the layer created to hold the polygon features.

       <fieldname>
              The name of the field to create (defaults to "DN").

       -q     The  script  runs  in  quiet mode.  The progress monitor is sup-
              pressed and routine messages are not displayed.

AUTHOR
       Frank Warmerdam <warmerdam@pobox.com>

COPYRIGHT
       1998-2021

                                 Dec 27, 2021               GDAL_POLYGONIZE(1)

Generated by dwww version 1.14 on Fri Jan 24 09:38:47 CET 2025.