GDAL-RASTER-AS-FEATURES(1)

πŸ“¦
version 3.13.3 Β· 4 versions
, in alpine 3.24, arch rolling, ubuntu stonking

✨ GDAL-RASTER-AS-FEATURES(1) ✨

okay bestie, welcome to the GDAL manual page for gdal-raster-as-features β€” yes we're doing man pages now, and yes it's giving main character energy. πŸ’… This one's from the GDAL suite, and it is, no cap, a whole vibe.


πŸ’– NAME πŸ’–

gdal-raster-as-features β€” create features representing the pixels of a raster πŸ¦‹

Added in version 3.12.


🌸 SYNOPSIS 🌸

Usage: gdal raster as-features [OPTIONS] <INPUT> <OUTPUT>

Create features from pixels of a raster dataset

Positional arguments:
  -i, --input <INPUT>                                  Input raster datasets [required] [not available in pipelines]
  -o, --output <OUTPUT>                                Output vector dataset [required] [not available in pipelines]

Common Options:
  -h, --help                                           Display help message and exit
  --json-usage                                         Display usage as JSON document and exit
  --config <KEY>=<VALUE>                               Configuration option [may be repeated]

Options:
  -f, --of, --format, --output-format <OUTPUT-FORMAT>  Output format ("GDALG" allowed) [not available in pipelines]
  --co, --creation-option <KEY>=<VALUE>                Creation option [may be repeated] [not available in pipelines]
  --lco, --layer-creation-option <KEY>=<VALUE>         Layer creation option [may be repeated] [not available in pipelines]
  --overwrite                                          Whether overwriting existing output dataset is allowed [not available in pipelines]
  --update                                             Whether to open existing dataset in update mode [not available in pipelines]
  --overwrite-layer                                    Whether overwriting existing output layer is allowed [not available in pipelines]
  --append                                             Whether appending to existing layer is allowed [not available in pipelines]
  --output-layer <OUTPUT-LAYER>                        Output layer name [not available in pipelines]
  -b, --band <BAND>                                    Input band(s) (1-based index) [may be repeated]
  --geometry-type <GEOMETRY-TYPE>                      Geometry type. GEOMETRY-TYPE=none|point|polygon (default: none)
  --skip-nodata                                        Omit NoData pixels from the result
  --include-xy                                         Include fields for cell center coordinates
  --include-row-col                                    Include columns for row and column

Advanced Options:
  --if, --input-format <INPUT-FORMAT>                  Input formats [may be repeated] [not available in pipelines]
  --oo, --open-option <KEY>=<VALUE>                    Open options [may be repeated] [not available in pipelines]
  --output-oo, --output-open-option <KEY>=<VALUE>      Output open options [may be repeated] [not available in pipelines]

πŸŽ€ Positional arguments

  • -i, --input <INPUT> β€” the input raster dataset(s) you're feeding in. [required] [not available in pipelines]
  • -o, --output <OUTPUT> β€” the output vector dataset. [required] [not available in pipelines]

🌈 Common Options

  • -h, --help β€” show the help message and dip. πŸ‘‹
  • --json-usage β€” dump the usage as a JSON document and exit.
  • --config <KEY>=<VALUE> β€” configuration option. [may be repeated]

πŸ’œ Options

  • -f, --of, --format, --output-format <OUTPUT-FORMAT> β€” output format ("GDALG" allowed). [not available in pipelines]
  • --co, --creation-option <KEY>=<VALUE> β€” creation option. [may be repeated] [not available in pipelines]
  • --lco, --layer-creation-option <KEY>=<VALUE> β€” layer creation option. [may be repeated] [not available in pipelines]
  • --overwrite β€” whether overwriting an existing output dataset is allowed. [not available in pipelines]
  • --update β€” whether to open the existing dataset in update mode. [not available in pipelines]
  • --overwrite-layer β€” whether overwriting an existing output layer is allowed. [not available in pipelines]
  • --append β€” whether appending to an existing layer is allowed. [not available in pipelines]
  • --output-layer <OUTPUT-LAYER> β€” output layer name. [not available in pipelines]
  • -b, --band <BAND> β€” input band(s), 1-based index. [may be repeated]
  • --geometry-type <GEOMETRY-TYPE> β€” geometry type. GEOMETRY-TYPE=none|point|polygon (default: none)
  • --skip-nodata β€” omit NoData pixels from the result.
  • --include-xy β€” include fields for cell center coordinates.
  • --include-row-col β€” include columns for row and column.

πŸ¦‹ Advanced Options

  • --if, --input-format <INPUT-FORMAT> β€” input formats. [may be repeated] [not available in pipelines]
  • --oo, --open-option <KEY>=<VALUE> β€” open options. [may be repeated] [not available in pipelines]
  • --output-oo, --output-open-option <KEY>=<VALUE> β€” output open options. [may be repeated] [not available in pipelines]

🌟 DESCRIPTION 🌟

gdal raster as-features makes features that represent the pixels in a raster dataset. You can get them as polygons, as points, or with literally no geometry at all. Important though: unlike gdal raster polygonize, adjacent pixels that have the same values are not combined. Every pixel is its own moment, periodt. πŸ‘‘

This algorithm can be part of a gdal pipeline. iconic.


πŸŽ€ PROGRAM-SPECIFIC OPTIONS πŸŽ€

  • -b, --band <band> β€” tells it which bands' pixel values should get added as fields of the created features. If you don't say anything, values get added for all bands by default. πŸ’…
  • --geometry-type β€” sets the geometry type of the created features. Your choices are "none" (that's the default), "point", or "polygon".
  • --include-row-col β€” if you set it, ROW and COL fields get added with the cell positions. πŸ“
  • --include-xy β€” if you set it, CENTER_X and CENTER_Y fields get added with the center coordinates of each pixel.
  • --output-layer β€” gives a name to the output vector layer. Defaults to "pixels".
  • --skip-nodata β€” if you set it, no features will be emitted for pixels that are equal to the NoData value. bye girl 🫢

✨ STANDARD OPTIONS ✨

  • --append β€” whether appending features to existing layer(s) is allowed. This also creates the output dataset if it does not exist yet. lowkey convenient.
  • --co, --creation-option <NAME>=<VALUE> β€” okay so a lot of formats have one or more optional creation options, and they control the particulars about the file that gets created. For instance, the GeoTIFF driver supports creation options to control compression, and whether the file should be tiled.

May be repeated.

The creation options available vary by format driver, and some simple formats have no creation options at all. A list of options supported for a format can be listed with the --formats command line option but the documentation for the format is the definitive source of information on driver creation options. See Raster drivers format specific documentation for legal creation options for each format.

  • --if, --input-format <format> β€” format/driver name to be attempted to open the input file(s). Generally you do not need to specify it, but it's there for when automatic driver detection fails to select the appropriate driver. This option can be repeated several times to specify several candidate drivers. Note that it does not force those drivers to open the dataset. In particular, some drivers have requirements on file extensions. πŸ’€

May be repeated.

  • --lco, --layer-creation-option <NAME>=<VALUE> β€” many formats have one or more optional layer creation options that can control particulars about the layer created. For instance, the GeoPackage driver supports layer creation options to control the feature identifier or geometry column name, setting the identifier or description, etc.

May be repeated.

The layer creation options available vary by format driver, and some simple formats have no layer creation options at all. A list of options supported for a format can be listed with the --formats command line option but the documentation for the format is the definitive source of information on driver creation options. See Vector drivers format specific documentation for legal creation options for each format.

Note that layer creation options are different from dataset creation options. not the same thing bestie, don't mix them up πŸ™ˆ
  • --oo, --open-option <NAME>=<VALUE> β€” dataset open option (format specific).

May be repeated.

  • -f, --of, --format, --output-format <OUTPUT-FORMAT> β€” which output vector format to use. Allowed values may be given by
gdal --formats | grep vector | grep rw | sort
  • --output-open-option, --output-oo <NAME>=<VALUE> β€” Added in version 3.12.

Dataset open option for output dataset (format specific).

May be repeated.

  • --overwrite β€” lets the program overwrite an existing target file or dataset. Otherwise, by default, gdal errors out if the target file or dataset already exists. 😭
  • --overwrite-layer β€” whether overwriting the existing output vector layer is allowed.
  • --update β€” whether to open an existing output dataset in update mode.

⭐ RETURN STATUS CODE ⭐

The program returns status code 0 in case of success, and non-zero in case of error (non-blocking errors emitted as warnings are considered as a successful execution). so like, warnings are fine, errors are not. slay.


πŸ’– EXAMPLES πŸ’–

🌸 Example 1: Create points at the center of pixels having a value less than 150

gdal pipeline read input.tif !
         reclassify -m "[-inf, 150)=1; DEFAULT=NO_DATA" !
         as-features --geometry-type point --skip-nodata !
         write out.shp

πŸ¦‹ Example 2: Create a polygon grid dividing the globe into 1-degree chunks

gdal pipeline create --bbox -180,-90,180,90 --size 360,180 !
         as-features --geometry-type polygon !
         write grid.shp

πŸ‘‘ AUTHOR πŸ‘‘

Dan Baston <dbaston@gmail.com>


1998-2026


and that's the page bestie, you ate πŸ’… this was GDAL-RASTER-AS-FEATURES(1), dated Aug 18, 2026, out here in the GDAL source. go make some features, you got this πŸŽ€βœ¨

πŸ“¦ where this page comes from