GDAL-RASTER-AS-FEATURES(1)
β¨ 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,ROWandCOLfields get added with the cell positions. π--include-xyβ if you set it,CENTER_XandCENTER_Yfields 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,gdalerrors 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>
π COPYRIGHT π
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
- alpine 3.24: gdal-doc 3.13.3-r0 Β· MIT
- arch rolling: gdal 3.13.3-6 Β· MIT
- ubuntu stonking: gdal-bin 3.13.3+dfsg-1ubuntu4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms