GDAL-RASTER-PIPELINE(1)

๐ŸŒˆ gdal-raster-pipeline ๐Ÿ’– โ€” from the GDAL manual (section 1)

okay bestie sit DOWN because this one is a whole saga โœจ


๐ŸŒธ NAME ๐ŸŒธ

gdal-raster-pipeline โ€” process a raster dataset by applying, like, a bunch of steps in a row ๐ŸŽ€

Added in version 3.11.


โœจ DESCRIPTION โœจ

gdal raster pipeline can be used to process a raster dataset and perform various processing steps that accept raster and generate raster. no cap ๐Ÿซถ

For pipelines mixing raster and vector, consult gdal pipeline.

Most steps proceed in on-demand evaluation of raster blocks, unless otherwise stated in their documentation, without "materializing" the resulting dataset of the operation of each step. It may be desirable sometimes for performance purposes to proceed to materializing an intermediate dataset to disk using gdal raster materialize. ๐Ÿ’…


๐Ÿ’… SYNOPSIS ๐Ÿ’…

Usage: gdal raster pipeline [OPTIONS] <PIPELINE>

Process a raster dataset applying several steps.

Positional arguments:

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]
  -q, --quiet             Quiet mode (no progress bar or warning message) [not available in pipelines]

<PIPELINE> is of the form: read|mosaic|stack [READ-OPTIONS] ( ! <STEP-NAME> [STEP-OPTIONS] )* ! info|compare|tile|write [WRITE-OPTIONS]

A pipeline chains several steps, separated with the ! (exclamation mark) character. The first step must be read, calc, create, mosaic or stack, and the last one write, info or tile. Each step has its own positional or non-positional arguments. Apart from read, calc, mosaic, stack, compare, info, tile and write, all other steps can potentially be used several times in a pipeline. ๐Ÿฆ‹

the ! is literally the whole vibe of this thing, do not forget it, i'm begging ๐Ÿ™ˆ

๐Ÿ‘‘ STEPS ๐Ÿ‘‘

  • aspect
  • blend
  • calc
  • clip
  • color-map
  • compare
  • create
  • edit
  • external
  • fill-nodata
  • hillshade
  • info
  • materialize
  • mosaic
  • neighbors
  • nodata-to-alpha
  • overview
  • pansharpen
  • proximity
  • read
  • reclassify
  • reproject
  • resize
  • rgb-to-palette
  • roughness
  • scale
  • select
  • set-type
  • sieve
  • slope
  • stack
  • tee
  • tile
  • tpi
  • tri
  • unscale
  • update
  • viewshed
  • write

๐ŸŽ€ aspect

* aspect [OPTIONS]
------------------

Generate an aspect map ๐Ÿ—บ๏ธ

Options:

  • -b, --band <BAND> โ€” Input band (1-based index) (default: 1)
  • --convention <CONVENTION> โ€” Convention for output angles. CONVENTION=azimuth|trigonometric-angle (default: azimuth)
  • --gradient-alg <GRADIENT-ALG> โ€” Algorithm used to compute terrain gradient. GRADIENT-ALG=Horn|ZevenbergenThorne (default: Horn)
  • --zero-for-flat โ€” Whether to output zero for flat areas
  • --no-edges โ€” Do not try to interpolate values at dataset edges or close to nodata values

Details for options can be found in gdal raster aspect.


๐ŸŽ€ blend

* blend [OPTIONS] <OVERLAY>
---------------------------

Blend/compose two raster datasets ๐ŸŒˆ

Positional arguments:

  • --overlay <OVERLAY> โ€” Overlay dataset [required]

Options:

  • --operator <OPERATOR> โ€” Composition operator. OPERATOR=src-over|hsv-value|multiply|screen|overlay|hard-light|darken|lighten|color-dodge|color-burn (default: src-over)
  • --opacity <OPACITY> โ€” Opacity percentage to apply to the overlay dataset (0=fully transparent, 100=full use of overlay opacity) (default: 100)

Details for options can be found in gdal raster blend.


๐ŸŽ€ calc

* calc [OPTIONS] <INPUTS>...
----------------------------

Perform raster algebra ๐Ÿงฎโœจ

Positional arguments:

  • -i, --input <INPUTS> โ€” Input raster datasets [1.. values] [required]

Options:

  • --ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> โ€” Output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64
  • --no-check-crs โ€” Do not check consistency of input coordinate reference systems
  • --no-check-extent โ€” Do not check consistency of input extents
  • --propagate-nodata โ€” Whether to set pixels to the output NoData value if any of the input pixels is NoData
  • --calc <CALC> โ€” Expression(s) to evaluate [1.. values] [required]
  • --dialect <DIALECT> โ€” Expression dialect. DIALECT=muparser|builtin (default: muparser)
  • --flatten โ€” Generate a single band output raster per expression, even if input datasets are multiband
  • --nodata <NODATA> โ€” Assign a specified nodata value to output bands ('none', numeric value, 'nan', 'inf', '-inf')

Advanced Options:

  • --if, --input-format <INPUT-FORMAT> โ€” Input formats [may be repeated]
  • --oo, --open-option <KEY>=<VALUE> โ€” Open options [may be repeated]

Details for options can be found in gdal raster calc.


๐ŸŽ€ clip

* clip [OPTIONS]
----------------

Clip a raster dataset. โœ‚๏ธ

Options:

  • --bbox <BBOX> โ€” Clipping bounding box as xmin,ymin,xmax,ymax Mutually exclusive with --window, --geometry, --like
  • --bbox-crs <BBOX-CRS> โ€” CRS of clipping bounding box
  • --window <WINDOW> โ€” Raster window as col,line,width,height in pixels Mutually exclusive with --bbox, --geometry, --like
  • --geometry <GEOMETRY> โ€” Clipping geometry (WKT or GeoJSON) Mutually exclusive with --bbox, --window, --like
  • --geometry-crs <GEOMETRY-CRS> โ€” CRS of clipping geometry
  • --like <DATASET> โ€” Dataset to use as a template for bounds Mutually exclusive with --bbox, --window, --geometry
  • --like-sql <SELECT-STATEMENT> โ€” SELECT statement to run on the 'like' dataset Mutually exclusive with --like-where
  • --like-layer <LAYER-NAME> โ€” Name of the layer of the 'like' dataset
  • --like-where <WHERE-EXPRESSION> โ€” WHERE SQL clause to run on the 'like' dataset Mutually exclusive with --like-sql
  • --only-bbox โ€” For 'geometry' and 'like', only consider their bounding box
  • --allow-bbox-outside-source โ€” Allow clipping box to include pixels outside input dataset
  • --add-alpha โ€” Adds an alpha mask band to the destination when the source raster have none.

Details for options can be found in gdal raster clip.


๐ŸŽ€ color-map

* color-map [OPTIONS]
---------------------

Generate a RGB or RGBA dataset from a single band, using a color map ๐ŸŽจ

Options:

  • -b, --band <BAND> โ€” Input band (1-based index) (default: 1)
  • --color-map <COLOR-MAP> โ€” Color map filename
  • --add-alpha โ€” Adds an alpha mask band to the destination.
  • --color-selection <COLOR-SELECTION> โ€” How to compute output colors from input values. COLOR-SELECTION=interpolate|exact|nearest (default: interpolate)

Details for options can be found in gdal raster color-map.


๐ŸŽ€ compare

Added in version 3.12.

* compare [OPTIONS] <REFERENCE>
-------------------------------

Compare two raster datasets. ๐Ÿ”

Positional arguments:

  • --reference <REFERENCE> โ€” Reference dataset [required]

Options:

  • --skip-all-optional โ€” Skip all optional comparisons
  • --skip-binary โ€” Skip binary file comparison
  • --skip-crs โ€” Skip CRS comparison
  • --skip-geotransform โ€” Skip geotransform comparison
  • --skip-overview โ€” Skip overview comparison
  • --skip-metadata โ€” Skip metadata comparison
  • --skip-rpc โ€” Skip RPC metadata comparison
  • --skip-geolocation โ€” Skip Geolocation metadata comparison
  • --skip-subdataset โ€” Skip subdataset comparison

Details for options can be found in gdal raster compare.


๐ŸŽ€ create

* create [OPTIONS]
------------------

Create a new raster dataset. ๐Ÿฃ

Options:

  • -i, --like, --input <TEMPLATE-DATASET> โ€” Template raster dataset
  • --size <width>,<height> โ€” Output size in pixels
  • --band-count <BAND-COUNT> โ€” Number of bands (default: 1)
  • --ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> โ€” Output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64 (default: Byte)
  • --nodata <NODATA> โ€” Assign a specified nodata value to output bands ('none', numeric value, 'nan', 'inf', '-inf')
  • --burn <BURN> โ€” Burn value [may be repeated]
  • --crs <CRS> โ€” Set CRS
  • --bbox <BBOX> โ€” Bounding box as xmin,ymin,xmax,ymax
  • --metadata <KEY>=<VALUE> โ€” Add metadata item [may be repeated]
  • --copy-metadata โ€” Copy metadata from input dataset Depends on --input
  • --copy-overviews โ€” Create same overview levels as input dataset Depends on --input

Advanced Options:

  • --if, --input-format <INPUT-FORMAT> โ€” Input formats [may be repeated]
  • --oo, --open-option <KEY>=<VALUE> โ€” Open options [may be repeated]

Details for options can be found in gdal raster create.


๐ŸŽ€ edit

* edit [OPTIONS]
----------------

Edit a raster dataset. โœ๏ธ

โœจ Options โœจ

okay bestie, strap in, because this is the full options menu and we are not skipping a single one ๐Ÿ’–

  • -b, --band <BAND> โ€” which band is the active one (1-based index, so the first band is 1, that's just the rules ๐Ÿซถ)
  • --crs <CRS> โ€” override the CRS. and no, it does not reproject anything, it just says "this is the CRS now" โœจ
  • --bbox <BBOX> โ€” bounding box, written out as xmin,ymin,xmax,ymax
  • --nodata <NODATA> โ€” assign a specified nodata value to output bands ('none', numeric value, 'nan', 'inf', '-inf')
  • --color-interpretation <[all|<BAND>=]<COLOR-INTEPRETATION> โ€” set band color interpretation [may be repeated]
  • --color-map <COLOR-MAP> โ€” color map filename. Mutually exclusive with --unset-color-table
  • --scale <[<BAND>=]<SCALE> โ€” override band scale factor [may be repeated]
  • --offset <[<BAND>=]<OFFSET> โ€” override band offset constant [may be repeated]
  • --metadata <KEY>=<VALUE> โ€” add/update a dataset metadata item [may be repeated]
  • --unset-color-table โ€” unset the color table on the 1st band, or on the one you pointed at with --band. Mutually exclusive with --color-map
  • --unset-metadata <KEY> โ€” remove dataset metadata item(s) [may be repeated]
  • --unset-metadata-domain <DOMAIN> โ€” remove dataset metadata domain(s) [may be repeated]
  • --gcp <GCP> โ€” add a ground control point, formatted as pixel,line,easting,northing[,elevation], or @filename [may be repeated]

Details for options can be found in gdal raster edit.


๐ŸŒˆ external

external [OPTIONS] <COMMAND>

Execute an external program as a step of a pipeline. yes bestie, you can just borrow a whole other program and make it a step, iconic behavior ๐Ÿ”ฅ

๐ŸŽฏ Positional arguments

  • --command <COMMAND> โ€” the external command, optionally with <INPUT> and/or <OUTPUT> or <INPUT-OUTPUT> placeholders [required]

โœจ Options

  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” output format

๐Ÿ’ซ Advanced Options

  • --if, --input-format <INPUT-FORMAT> โ€” input formats

Details for options can be found in gdal external.


๐ŸŒธ fill-nodata

fill-nodata [OPTIONS]

Fill nodata raster regions by interpolation from edges. basically: the holes get filled in by peeking at what's around them ๐Ÿงš

โœจ Options

  • -b, --band <BAND> โ€” input band (1-based index) (default: 1)
  • -d, --max-distance <MAX_DISTANCE> โ€” the maximum distance (in pixels) that the algorithm will search out for values to interpolate. (default: 100)
  • -s, --smoothing-iterations <SMOOTHING_ITERATIONS> โ€” the number of 3x3 average filter smoothing iterations to run after the interpolation to dampen artifacts. The default is zero smoothing iterations. (default: 0)
  • --mask <MASK> โ€” use the first band of the specified file as a validity mask (zero is invalid, non-zero is valid).
  • --strategy <STRATEGY> โ€” By default, pixels are interpolated using an inverse distance weighting (invdist). It is also possible to choose a nearest neighbour (nearest) strategy.. STRATEGY=invdist|nearest (default: invdist) โ€” and yeah, that double dot is really there, I'm just the messenger ๐Ÿ’€

Details for options can be found in gdal raster fill-nodata.


๐Ÿ”๏ธ hillshade

hillshade [OPTIONS]

Generate a shaded relief map. it's giving dramatic lighting, main character terrain energy ๐Ÿ‘‘

โœจ Options

  • -b, --band <BAND> โ€” input band (1-based index) (default: 1)
  • -z, --zfactor <ZFACTOR> โ€” vertical exaggeration used to pre-multiply the elevations
  • --xscale <XSCALE> โ€” ratio of vertical units to horizontal X axis units
  • --yscale <YSCALE> โ€” ratio of vertical units to horizontal Y axis units
  • --azimuth <AZIMUTH> โ€” azimuth of the light, in degrees (default: 315)
  • --altitude <ALTITUDE> โ€” altitude of the light, in degrees (default: 45)
  • --gradient-alg <GRADIENT-ALG> โ€” algorithm used to compute terrain gradient. GRADIENT-ALG=Horn|ZevenbergenThorne (default: Horn)
  • --variant <VARIANT> โ€” variant of the hillshading algorithm. VARIANT=regular|combined|multidirectional|Igor (default: regular)
  • --no-edges โ€” do not try to interpolate values at dataset edges or close to nodata values

Details for options can be found in gdal raster hillshade.


๐Ÿ” info

โœจ Added in version 3.12. โœจ
info [OPTIONS]

Return information on a raster dataset. it's the tell me everything step, and honestly? it ate.

โœจ Options

  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” output format. OUTPUT-FORMAT=json|text
  • --mm, --min-max โ€” compute minimum and maximum value
  • --stats โ€” retrieve or compute statistics, using all pixels. Mutually exclusive with --approx-stats
  • --approx-stats โ€” retrieve or compute statistics, using a subset of pixels. Mutually exclusive with --stats
  • --hist โ€” retrieve or compute histogram

๐Ÿ’ซ Advanced Options

  • --no-gcp โ€” suppress ground control points list printing
  • --no-md โ€” suppress metadata printing
  • --no-ct โ€” suppress color table printing
  • --no-fl โ€” suppress file list printing
  • --checksum โ€” compute pixel checksum
  • --list-metadata-domains, --list-mdd โ€” list all metadata domains available for the dataset
  • --mdd, --metadata-domain <METADATA-DOMAIN> โ€” report metadata for the specified domain. 'all' can be used to report metadata in all domains

๐Ÿ”ฎ Esoteric Options

  • --no-nodata โ€” suppress retrieving nodata value
  • --no-mask โ€” suppress mask band information
  • --subdataset <SUBDATASET> โ€” use subdataset of specified index (starting at 1), instead of the source dataset itself
  • --crs-format <CRS-FORMAT> โ€” which format to use to report CRS. CRS-FORMAT=AUTO|WKT2|PROJJSON (default: AUTO)

Details for options can be found in gdal raster info.


๐Ÿ’พ materialize

materialize [OPTIONS]

Materialize a piped dataset on disk to increase the efficiency of the following steps. translation: put it on disk so the rest of the pipeline stops doing cardio ๐Ÿƒโ€โ™€๏ธ

โœจ Options

  • -o, --output <OUTPUT> โ€” materialized dataset name (created by algorithm)
  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” output format
  • --co, --creation-option <KEY>=<VALUE> โ€” creation option [may be repeated]
  • --overwrite โ€” whether overwriting existing output dataset is allowed

Details for options can be found in gdal raster materialize.


๐Ÿงฉ mosaic

mosaic [OPTIONS] <INPUTS>...

Build a mosaic, either virtual (VRT) or materialized. gluing a whole girl gang of rasters together ๐Ÿ’…

๐ŸŽฏ Positional arguments

  • -i, --input <INPUTS> โ€” input raster datasets (or specify a @<filename> to point to a file containing filenames) [1.. values] [required]

โœจ Options

  • -b, --band <BAND> โ€” input band(s) (1-based index) [may be repeated]
  • --absolute-path โ€” whether the path to the input datasets should be stored as an absolute path
  • --resolution <xres>,<yres>|same|average|common|highest|lowest> โ€” target resolution (in destination CRS units) (default: same)
  • --bbox <BBOX> โ€” target bounding box as xmin,ymin,xmax,ymax (in destination CRS units)
  • --target-aligned-pixels โ€” round target extent to target resolution
  • --input-nodata <INPUT-NODATA> โ€” set nodata values for input bands. [1.. values]
  • --output-nodata <OUTPUT-NODATA> โ€” set nodata values at the destination band level. [1.. values]
  • --hide-nodata โ€” makes the destination band not report the NoData.
  • --add-alpha โ€” adds an alpha mask band to the destination when the source raster have none.
  • --pixel-function <PIXEL-FUNCTION> โ€” specify a pixel function to calculate output value from overlapping inputs. PIXEL-FUNCTION=area|argmax|argmin|cmul|complex|conj|dB|dB2amp|dB2pow|diff|div|exp|expression|geometric_mean|harmonic_mean|imag|intensity|interpolate_exp|interpolate_linear|inv|log10|max|mean|median|min|mod|mode|mul|norm_diff|phase|polar|pow|quantile|real|reclassify|replace_nodata|round|scale|sqrt|sum
  • --pixel-function-arg <NAME>=<VALUE> โ€” specify argument(s) to pass to the pixel function [may be repeated]

๐Ÿ’ซ Advanced Options

  • --if, --input-format <INPUT-FORMAT> โ€” input formats [may be repeated]
  • --oo, --open-option <KEY>=<VALUE> โ€” open options [may be repeated]

Details for options can be found in gdal raster mosaic.


๐Ÿ‘ฏ neighbors

neighbors [OPTIONS]

Compute the value of each pixel from its neighbors (focal statistics). literally asking the friend group what a pixel should be ๐Ÿซถ

โœจ Options

  • -b, --band <BAND> โ€” input band (1-based index)
  • --method <METHOD> โ€” method to combine weighed source pixels. METHOD=mean|sum|min|max|stddev|median|mode [may be repeated]
  • --size <SIZE> โ€” neighborhood size
  • --kernel <KERNEL> โ€” convolution kernel(s) to apply [1.. values] [required]
  • --ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> โ€” output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64 (default: Float64)
  • --nodata <NODATA> โ€” assign a specified nodata value to output bands ('none', numeric value, 'nan', 'inf', '-inf')

Details for options can be found in gdal raster neighbors.


๐Ÿซฅ nodata-to-alpha

nodata-to-alpha [OPTIONS]

Replace nodata value(s) with an alpha band. bye bye nodata, hello transparency ๐Ÿฆ‹

โœจ Options

  • --nodata <NODATA> โ€” override nodata value of input band(s) (numeric value, 'nan', 'inf', '-inf') [may be repeated]

Details for options can be found in gdal raster nodata-to-alpha.


๐Ÿชœ overview

overview <COMMAND> [OPTIONS]

where <COMMAND> is one of:

  • add โ€” Adding overviews

Details for options can be found in gdal raster overview.


โœจ pansharpen โœจ

pansharpen [OPTIONS] <SPECTRAL>...

Bestie. This one does a pansharpen operation, and if you don't know what that is, just know it's the glow-up where a low-res color image gets the sharpness of a high-res one. Chef's kiss. ๐Ÿซถ

Positional arguments:

  • --spectral <SPECTRAL> โ€” Input spectral band dataset, and yes you can throw a whole pile of them at it ([1.. values]), and yes it's [required] โ€” no spectral bands, no pansharpening, periodt.

Options:

  • -r, --resampling <RESAMPLING> โ€” Resampling algorithm. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average (default: cubic)
  • --weights <WEIGHTS> โ€” Weight for each input spectral band. This one may be repeated ๐Ÿ’…
  • --nodata <NODATA> โ€” Override the nodata value of the input bands
  • --bit-depth <BIT-DEPTH> โ€” Override the bit depth of the input bands
  • --spatial-extent-adjustment <SPATIAL-EXTENT-ADJUSTMENT> โ€” What to do when your bands aren't the same extent (rude of them, honestly). SPATIAL-EXTENT-ADJUSTMENT=union|intersection|none|none-without-warning (default: union)
  • -j, --num-threads <NUM-THREADS> โ€” Number of jobs (or ALL_CPUS) (default: ALL_CPUS) โ€” go off, multicore ๐Ÿ”ฅ

Details for options can be found in gdal raster pansharpen.


๐Ÿ’– proximity ๐Ÿ’–

proximity [OPTIONS]

Produces a raster proximity map โ€” like, how far is every pixel from the thing you care about? Very giving-distance energy. ๐ŸŒธ

Options:

  • --ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> โ€” Output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64|Byte|UInt16|Int16|UInt32|Int32|Float32|Float64 (default: Float32) โ€” and no, you're not seeing double, those last few really are listed twice, we do not question the lore ๐Ÿ’€
  • -b, --band <BAND> โ€” Input band (1-based index)
  • --target-values <TARGET-VALUES> โ€” Target pixel values. May be repeated.
  • --distance-units <DISTANCE-UNITS> โ€” Distance units. DISTANCE-UNITS=pixel|geo (default: pixel)
  • --max-distance <MAX-DISTANCE> โ€” Maximum distance. Pixels past this distance get the nodata value (default: 0)
  • --fixed-value <FIXED-VALUE> โ€” A fixed value for the pixels that fall within the maximum distance, instead of the actual distance (default: 0)
  • --nodata <NODATA> โ€” Specify a nodata value to use for pixels that are beyond the maximum distance

Details for options can be found in gdal raster proximity.


๐Ÿฆ‹ read ๐Ÿฆ‹

read [OPTIONS] <INPUT>

Read a raster dataset. Iconic. Foundational. The moment before everything else. ๐Ÿ‘‘

Positional arguments:

  • -i, --input <INPUT> โ€” Input raster datasets [required]

Advanced Options:

  • --if, --input-format <INPUT-FORMAT> โ€” Input formats (may be repeated)
  • --oo, --open-option <KEY>=<VALUE> โ€” Open options (may be repeated)

Details for options can be found in gdal raster pipeline read.


๐ŸŽ€ reclassify ๐ŸŽ€

reclassify [OPTIONS]

Reclassify values in a raster dataset โ€” aka giving your pixels a whole new identity โœจ

Options:

  • -m, --mapping <MAPPING> โ€” Reclassification mappings (or specify a @<filename> to point to a file containing mappings [required]
  • --ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> โ€” Output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64

Details for options can be found in gdal raster reclassify.


๐ŸŒˆ reproject ๐ŸŒˆ

reproject [OPTIONS]

Reproject a raster dataset โ€” moving your data into a whole new CRS like it's transferring schools mid-semester.

Options:

  • -s, --input-crs <INPUT-CRS> โ€” Input CRS
  • --like <DATASET> โ€” Dataset to use as a template for target bounds, CRS, size and nodata
  • -d, --output-crs <OUTPUT-CRS> โ€” Output CRS
  • -r, --resampling <RESAMPLING> โ€” Resampling method. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum (default: nearest)
  • --resolution <xres>,<yres> โ€” Target resolution (in destination CRS units). Mutually exclusive with --size โ€” pick one, bestie, you can't have both ๐Ÿ™ˆ
  • --size <width>,<height> โ€” Target size in pixels. Mutually exclusive with --resolution
  • --bbox <BBOX> โ€” Target bounding box (in destination CRS units)
  • --bbox-crs <BBOX-CRS> โ€” CRS of target bounding box
  • -j, --num-threads <NUM-THREADS> โ€” Number of jobs (or ALL_CPUS) (default: ALL_CPUS)

Advanced Options:

  • --target-aligned-pixels โ€” Round target extent to target resolution
  • --input-nodata <INPUT-NODATA> โ€” Set nodata values for input bands ('None' to unset). [1.. values]
  • --output-nodata <OUTPUT-NODATA> โ€” Set nodata values for output bands ('None' to unset). [1.. values]
  • --add-alpha โ€” Adds an alpha mask band to the destination when the source raster has none
  • --wo, --warp-option <NAME>=<VALUE> โ€” Warping option(s) (may be repeated)
  • --to, --transform-option <NAME>=<VALUE> โ€” Transform option(s) (may be repeated)
  • --et, --error-threshold <ERROR-THRESHOLD> โ€” Error threshold

Details for options can be found in gdal raster reproject.


๐Ÿ“ resize ๐Ÿ“

resize [OPTIONS]

Resize a raster dataset without changing the georeferenced extents โ€” so the footprint stays exactly where it was, only the pixel count changes. Very "same address, new aesthetic". ๐Ÿ’…

Options:

  • --resolution <xres>,<yres> โ€” Target resolution (in destination CRS units). Mutually exclusive with --size
  • --size <width[%]>,<height[%]> โ€” Target size in pixels (or percentage if you use that '%' suffix) [required]. Mutually exclusive with --resolution
  • -r, --resampling <RESAMPLING> โ€” Resampling method. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|mode (default: nearest)

Details for options can be found in gdal raster resize.


๐Ÿ’œ rgb-to-palette ๐Ÿ’œ

rgb-to-palette [OPTIONS]

Convert a RGB image into a pseudo-color / paletted image. It's giving reduce, reuse, recolor. ๐ŸŽจ

Options:

  • --color-count <COLOR-COUNT> โ€” Select the number of colors in the generated color table (default: 256)
  • --color-map <COLOR-MAP> โ€” Color map filename
  • --output-nodata <OUTPUT-NODATA> โ€” Output nodata value
  • --no-dither โ€” Disable Floyd-Steinberg dithering
  • --bit-depth <BIT-DEPTH> โ€” Bit depth of color palette component (8 bit causes longer computation time, just so you know what you're signing up for). BIT-DEPTH=5|8 (default: 5)

Details for options can be found in gdal raster rgb-to-palette.


๐Ÿงš roughness ๐Ÿงš

roughness [OPTIONS]

Generate a roughness map. Not your situationship's emotional availability โ€” actual terrain roughness, bestie. ๐Ÿ˜ญ

Options:

  • -b, --band <BAND> โ€” Input band (1-based index) (default: 1)
  • --no-edges โ€” Do not try to interpolate values at dataset edges or close to nodata values

Details for options can be found in gdal raster roughness.


โญ scale โญ

scale [OPTIONS]

Scale the values of the bands of a raster dataset. Number glow-up. ๐Ÿ“ˆ

Options:

  • --ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> โ€” Output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64
  • -b, --band <BAND> โ€” Select band to restrict the scaling to (1-based index)
  • --input-min <INPUT-MIN> โ€” Minimum value of the source range. Depends on --input-max
  • --input-max <INPUT-MAX> โ€” Maximum value of the source range. Depends on --input-min
  • --output-min <OUTPUT-MIN> โ€” Minimum value of the destination range. Depends on --output-max
  • --output-max <OUTPUT-MAX> โ€” Maximum value of the destination range. Depends on --output-min
  • --exponent <EXPONENT> โ€” Exponent to apply non-linear scaling with a power function
  • --no-clip โ€” Do not clip input values to [innput-min, input-max]

Details for options can be found in gdal raster scale.


๐ŸŒธ select ๐ŸŒธ

select [OPTIONS] <BAND>

Select a subset of bands from a raster dataset. Curating. Editing. Main character energy only. โœ‚๏ธ

Positional arguments:

  • -b, --band <BAND> โ€” Band(s) (1-based index, 'mask', 'mask:<band>' or color interpretation such as 'red') [1.. values] [required]

Options:

  • --exclude โ€” Exclude specified bands
  • --mask <MASK> โ€” Mask band (1-based index, 'mask', 'mask:<band>' or 'none')

Details for options can be found in gdal raster select.


๐Ÿ”ฅ set-type ๐Ÿ”ฅ

set-type [OPTIONS]

Modify the data type of bands of a raster dataset. It's not a personality change, it's a type change. Huge difference. ๐Ÿ™ˆ

Options:

  • --ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> โ€” Output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64 [required]

Details for options can be found in gdal raster set-type.


๐ŸŽ€ sieve ๐ŸŽ€

sieve [OPTIONS]

Remove small polygons from a raster dataset. If it's too small to matter, bestie, it's getting evicted. ๐Ÿ’€ (Politely. Algorithmically.)

Options:

  • --mask <MASK> โ€” Use the first band of the specified file as a validity mask (all pixels with a value other than zero will be considered suitable for inclusion in polygons)
  • -b, --band <BAND> โ€” Input band (1-based index)
  • -s, --size-threshold <SIZE-THRESHOLD> โ€” Minimum size of polygons to keep (default: 2)
  • -c, --connect-diagonal-pixels โ€” Consider diagonal pixels as connected

Details for options can be found in gdal raster sieve.


๐Ÿ‘‘ slope ๐Ÿ‘‘

slope [OPTIONS]

Generate a slope map. For when you gotta know exactly how steep the drama is. โ›ฐ๏ธ

Options:

  • -b, --band <BAND> โ€” Input band (1-based index) (default: 1)
  • --unit <UNIT> โ€” Unit in which to express slopes. UNIT=degree|percent (default: degree)
  • --xscale <XSCALE> โ€” Ratio of vertical units to horizontal X axis units
  • --yscale <YSCALE> โ€” Ratio of vertical units to horizontal Y axis units
  • --gradient-alg <GRADIENT-ALG> โ€” Algorithm used to compute terrain gradient. GRADIENT-ALG=Horn|ZevenbergenThorne (default: Horn)
  • --no-edges โ€” Do not try to interpolate values at dataset edges or close to nodata values

Details for options can be found in gdal raster slope.


๐Ÿ’– stack ๐Ÿ’–

stack [OPTIONS] <INPUTS>...

Combine together input bands into a multi-band output, either virtual (VRT) or materialized.

Positional arguments

  • -i, --input <INPUTS> ๐Ÿซถ โ€” the input raster datasets. You can also hand it a @<filename> to point at a file that has a list of filenames in it. [1.. values] โ€” and bestie, it's [required], so you literally cannot skip it.

Options

  • -b, --band <BAND> โ€” which input band(s) you want, 1-based index so no zero-indexed nonsense here. [may be repeated] ๐ŸŽ€
  • --absolute-path โ€” toggles whether the path to the input datasets gets stored as an absolute path.
  • --resolution <xres>,<yres>|same|average|common|highest|lowest> โ€” the target resolution, measured in destination CRS units. Default is same. โœจ
  • --bbox <BBOX> โ€” the target bounding box, written as xmin,ymin,xmax,ymax, again in destination CRS units.
  • --target-aligned-pixels โ€” rounds the target extent to the target resolution. Snaps it into place, cute.
  • --input-nodata <INPUT-NODATA> โ€” sets nodata values for the input bands. [1.. values]
  • --output-nodata <OUTPUT-NODATA> โ€” sets nodata values at the destination band level. [1.. values]
  • --hide-nodata โ€” makes the destination band simply not report the NoData. Shy band energy. ๐Ÿ™ˆ

Advanced Options

  • --if, --input-format <INPUT-FORMAT> โ€” input formats. [may be repeated]
  • --oo, --open-option <KEY>=<VALUE> โ€” open options. [may be repeated]

Details for options can be found in gdal raster stack.


๐Ÿต tee

* tee [OPTIONS] [<PIPELINE>...]
-------------------------------

Pipes the input into the output stream and side nested pipelines. It's giving main character that refuses to choose. ๐Ÿ’…

Positional arguments

  • --tee-pipeline <PIPELINE> โ€” the nested pipeline. [1.. values]

Details for options can be found in Output nested pipeline.


๐Ÿงฉ tile

Added in version 3.12.

* tile [OPTIONS] <OUTPUT>
-------------------------

Generates tiles in separate files from a raster dataset. Chopping the whole thing up, one little tile at a time. โœ‚๏ธ

Positional arguments

  • -o, --output <OUTPUT> โ€” output directory. [required] ๐Ÿซถ

Options

  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” output format. Default: PNG.
  • --co, --creation-option <KEY>=<VALUE> โ€” creation option. [may be repeated]
  • --tiling-scheme <TILING-SCHEME> โ€” the tiling scheme. TILING-SCHEME=raster|WebMercatorQuad|WorldCRS84Quad|WorldMercatorWGS84Quad|GoogleCRS84Quad|PseudoTMS_GlobalMercator|GlobalGeodeticOriginLat270|LINZAntarticaMapTilegrid|APSTILE|CBMTILE|NZTM2000. Default: WebMercatorQuad.
  • --min-zoom <MIN-ZOOM> โ€” minimum zoom level.
  • --max-zoom <MAX-ZOOM> โ€” maximum zoom level.
  • --min-x <MIN-X> โ€” minimum tile X coordinate.
  • --max-x <MAX-X> โ€” maximum tile X coordinate.
  • --min-y <MIN-Y> โ€” minimum tile Y coordinate.
  • --max-y <MAX-Y> โ€” maximum tile Y coordinate.
  • --no-intersection-ok โ€” whether a dataset extent that doesn't intersect the tile matrix is only a warning. Like, it's fine, calm down. ๐Ÿ˜Œ
  • -r, --resampling <RESAMPLING> โ€” resampling method for max zoom. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum. Default: cubic.
  • --overview-resampling <OVERVIEW-RESAMPLING> โ€” resampling method for overviews. OVERVIEW-RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum
  • --convention <CONVENTION> โ€” tile numbering convention: xyz (from top) or tms (from bottom). CONVENTION=xyz|tms. Default: xyz.
  • --tile-size <TILE-SIZE> โ€” override the default tile size.
  • --add-alpha โ€” whether to force adding an alpha channel. Mutually exclusive with --no-alpha.
  • --no-alpha โ€” whether to disable adding an alpha channel. Mutually exclusive with --add-alpha.
  • --output-nodata <OUTPUT-NODATA> โ€” output nodata value.
  • --skip-blank โ€” do not generate blank tiles. Skip the empty ones, we only want the icons. ๐Ÿ‘‘
  • --metadata <KEY>=<VALUE> โ€” add a metadata item to the output tiles. [may be repeated]
  • --copy-src-metadata โ€” whether to copy metadata from the source dataset.
  • --aux-xml โ€” generate .aux.xml sidecar files when needed.
  • --kml โ€” generate KML files.
  • --resume โ€” generate only the missing files.
  • -j, --num-threads <NUM-THREADS> โ€” number of jobs (or ALL_CPUS). Default: ALL_CPUS.
  • --parallel-method <PARALLEL-METHOD> โ€” parallelization method (thread, spawn, fork). PARALLEL-METHOD=thread|spawn|fork

Advanced Resampling Options

  • --excluded-values <EXCLUDED-VALUES> โ€” tuples of values (e.g. <R>,<G>,<B> or (<R1>,<G1>,<B1>),(<R2>,<G2>,<B2>)) that must be ignored as contributing source pixels during (average) resampling.
  • --excluded-values-pct-threshold <EXCLUDED-VALUES-PCT-THRESHOLD> โ€” minimum percentage of source pixels that must be set at one of the --excluded-values to cause the excluded value to be used as the target pixel value. Default: 50.
  • --nodata-values-pct-threshold <NODATA-VALUES-PCT-THRESHOLD> โ€” minimum percentage of source pixels that must be set at one of nodata (or alpha=0, or any other way to express a transparent pixel) to cause the target pixel value to be transparent. Default: 100.

Publication Options

  • --webviewer <WEBVIEWER> โ€” web viewer to generate. WEBVIEWER=none|all|leaflet|openlayers|mapml|stac. Default: all. [may be repeated]
  • --url <URL> โ€” URL address where the generated tiles are going to be published.
  • --title <TITLE> โ€” title of the map.
  • --copyright <COPYRIGHT> โ€” copyright for the map.
  • --mapml-template <MAPML-TEMPLATE> โ€” filename of a template mapml file where variables will be substituted.

Details for options can be found in gdal raster tile.


๐Ÿ”๏ธ tpi

* tpi [OPTIONS]
---------------

Generate a Topographic Position Index (TPI) map. Slopes stay gagged, valleys stay humbled. ๐ŸŒ„

Options

  • -b, --band <BAND> โ€” input band (1-based index). Default: 1.
  • --no-edges โ€” do not try to interpolate values at dataset edges or close to nodata values.

Details for options can be found in gdal raster tpi.


๐Ÿชจ tri

* tri [OPTIONS]
---------------

Generate a Terrain Ruggedness Index (TRI) map. Rugged = the vibe. ๐Ÿง—

Options

  • -b, --band <BAND> โ€” input band (1-based index). Default: 1.
  • --algorithm <ALGORITHM> โ€” algorithm to compute TRI. ALGORITHM=Riley|Wilson. Default: Riley.
  • --no-edges โ€” do not try to interpolate values at dataset edges or close to nodata values.

Details for options can be found in gdal raster tri.


๐Ÿ” unscale

* unscale [OPTIONS]
-------------------

Convert scaled values of a raster dataset into unscaled values. Reversing the glow-up, putting the original numbers back on. โœจ

Options

  • --ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> โ€” output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64

Details for options can be found in gdal raster unscale.


๐Ÿฉน update

* update [OPTIONS] <OUTPUT>
---------------------------

Update the destination raster with the content of the input one. Glow-up in place, no full rewrite needed. ๐Ÿ’…

Positional arguments

  • -o, --output <OUTPUT> โ€” output raster dataset. [required]

Options

  • --geometry <GEOMETRY> โ€” clipping geometry (WKT or GeoJSON).
  • --geometry-crs <GEOMETRY-CRS> โ€” CRS of clipping geometry.
  • -r, --resampling <RESAMPLING> โ€” resampling method. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum. Default: nearest.
  • --no-update-overviews โ€” do not update existing overviews.

Advanced Options

  • --wo, --warp-option <NAME>=<VALUE> โ€” warping option(s). [may be repeated]
  • --to, --transform-option <NAME>=<VALUE> โ€” transform option(s). [may be repeated]
  • --et, --error-threshold <ERROR-THRESHOLD> โ€” error threshold.

Details for options can be found in gdal raster update.


๐Ÿ‘€ viewshed

* viewshed [OPTIONS]
--------------------

Compute the viewshed of a raster dataset.

Options, bestie, buckle up ๐Ÿ’…:

  • -p, --pos, --position <X,Y> or <X,Y,H> โ€” where the observer is standing, obvi ๐Ÿง [2..3 values]
  • -z, --height <HEIGHT> โ€” how tall your observer is
  • --sd-filename <SD-FILENAME> โ€” filename of the standard-deviation raster
  • --target-height <TARGET-HEIGHT> โ€” the height of the target above the DEM surface, measured in the DEM's height unit (default: 0)
  • --mode <MODE> โ€” sets what info the output actually contains. MODE=normal|DEM|ground|cumulative (default: normal)
  • --max-distance <MAX-DISTANCE> โ€” the max distance from observer to even bother computing visibility. It also clamps the extent of the output raster.
  • --min-distance <MIN-DISTANCE> โ€” masks out every cell closer than this to the observer. Gotta be less than 'max-distance'.
  • --start-angle <START-ANGLE> โ€” masks everything outside the arc ('start-angle', 'end-angle'). Clockwise degrees from north. Also clamps the extent of the output raster.
  • --end-angle <END-ANGLE> โ€” same arc situation, other end: masks everything outside ('start-angle', 'end-angle'). Clockwise degrees from north. Also clamps the extent of the output raster.
  • --high-pitch <HIGH-PITCH> โ€” marks all cells out-of-range where the observable height would be higher than the 'high-pitch' angle from the observer. Degrees from horizontal, positive is up. Must be greater than 'low-pitch'.
  • --low-pitch <LOW-PITCH> โ€” bounds observable height so it's no lower than the 'low-pitch' angle from the observer. Degrees from horizontal, positive is up. Must be less than 'high-pitch'.
  • --curvature-coefficient <CURVATURE-COEFFICIENT> โ€” coefficient so we can factor in the effects of curvature and refraction ๐ŸŒ
  • -b, --band <BAND> โ€” input band, 1-based index (default: 1)
  • --visible-value <VISIBLE-VALUE> โ€” pixel value for visible areas (default: 255)
  • --invisible-value <INVISIBLE-VALUE> โ€” pixel value for invisible areas (default: 0)
  • --maybe-visible-value <MAYBE-VISIBLE-VALUE> โ€” pixel value for the potentially visible areas (default: 2)
  • --out-of-range-value <OUT-OF-RANGE-VALUE> โ€” pixel value for cells that land outside the range set by the observer location and the maximum distance (default: 0)
  • --output-nodata <OUTPUT-NODATA> โ€” the value given to cells in the output raster that have no data
  • --observer-spacing <OBSERVER-SPACING> โ€” cell spacing between observers (default: 10)
  • -j, --num-threads <NUM-THREADS> โ€” number of jobs (or ALL_CPUS) (default: 3)

Details for options can be found in gdal raster viewshed. โœจ


๐ŸŽ€ write ๐ŸŽ€

* write [OPTIONS] <OUTPUT>
--------------------------

Write a raster dataset. That's it, that's the job ๐Ÿซถ

Positional arguments:

  • -o, --output <OUTPUT> โ€” output raster dataset [required] ๐Ÿ‘‘

Options:

  • -f, --of, --format, --output-format <OUTPUT-FORMAT> โ€” output format ("GDALG" allowed)
  • --co, --creation-option <KEY>=<VALUE> โ€” creation option [may be repeated]
  • --overwrite โ€” whether overwriting an existing output dataset is allowed. Mutually exclusive with --append
  • --append โ€” append as a subdataset to existing output. Mutually exclusive with --overwrite

Details for options can be found in gdal raster pipeline write.


๐ŸŒˆ GDALG OUTPUT (ON-THE-FLY / STREAMED DATASET) ๐ŸŒˆ

A pipeline can be serialized as a JSON file using the GDALG output format. The resulting file can then be opened as a raster dataset using the GDALG: GDAL Streamed Algorithm driver, and it'll apply the specified pipeline in a on-the-fly / streamed way. Iconic behaviour, no cap ๐Ÿ’ซ

The command_line member of the JSON file should nominally be the whole command line without the final write step, and is what gets generated by gdal raster pipeline ! .... ! write out.gdalg.json.

{
    "type": "gdal_streamed_alg",
    "command_line": "gdal raster pipeline ! read in.tif ! reproject --output-crs=EPSG:32632"
}

The final write step can be added, but if you do, it must explicitly specify the stream output format and a non-significant output dataset name. Not optional, bestie ๐Ÿ˜ญ

{
    "type": "gdal_streamed_alg",
    "command_line": "gdal raster pipeline ! read in.tif ! reproject --output-crs=EPSG:32632 ! write --output-format=streamed streamed_dataset"
}

๐Ÿ’œ SUBSTITUTIONS ๐Ÿ’œ

Added in version 3.12. ๐ŸŽ‰

It is possible to use gdal pipeline to use a pipeline already serialized in a .gdal.json file, and customize its existing steps โ€” typically changing an input filename, specifying an output filename, or adding/modifying arguments of steps.

See Substitutions.


๐Ÿฆ‹ NESTED PIPELINE ๐Ÿฆ‹

Added in version 3.12. โœจ

It is possible to create "nested pipelines", i.e. pipelines inside pipelines. We're going full inception, it's giving dream-within-a-dream ๐Ÿ’ญ

A nested pipeline is delimited by square brackets ([ and ]) surrounded by a space character.

There are 2 kinds of nested pipelines:

  • input nested pipelines: where the result dataset of the nested pipeline is used as the input dataset for an argument of the main pipeline.
  • output nested pipelines: where the output of a step of the main pipeline is used as the input of the nested pipeline in a following step. Output nested pipelines can only be used with the tee step.

See Nested pipeline.


โญ 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 if you get a warning, don't spiral โ€” you're still winning ๐Ÿซถ


๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

Example 1: Reproject a GeoTIFF file to CRS EPSG:32632 ("WGS 84 / UTM zone 32N") and adding a metadata item

$ gdal raster pipeline ! read in.tif ! reproject --output-crs=EPSG:32632 ! edit --metadata AUTHOR=EvenR ! write out.tif --overwrite

Example 2: Serialize the command of a reprojection of a GeoTIFF file in a GDALG file, and later read it

$ gdal raster pipeline ! read in.tif ! reproject --output-crs=EPSG:32632 ! write in_epsg_32632.gdalg.json --overwrite
$ gdal raster info in_epsg_32632.gdalg.json

Example 3: Mosaic on-the-fly several input files and tile that mosaic.

gdal raster pipeline ! mosaic input*.tif ! tile output_folder

Example 4: Reclassify GeoTIFF and render it as RGB image.

$ gdal raster pipeline ! read in.tif ! reclassify -m "[1,10]=1; [11,20]=2; [21,30]=3; DEFAULT=NO_DATA" --ot=Byte ! color-map --color-map=color_map.txt --color-selection=exact --add-alpha ! write -f WEBP rendered.webp

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Even Rouault <even.rouault@spatialys.com>

1998-2026


okay bestie that's a wrap on GDAL-RASTER-PIPELINE(1) โ€” this page lives in the GDAL source/version set and is dated Aug 18, 2026 on the tin, so go forth and pipeline, you absolute main character ๐ŸŒธ๐Ÿ’…๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from