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 asxmin,ymin,xmax,ymaxMutually exclusive with--window,--geometry,--like--bbox-crs <BBOX-CRS>โ CRS of clipping bounding box--window <WINDOW>โ Raster window ascol,line,width,heightin 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>โSELECTstatement 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>โWHERESQL 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 asxmin,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 is1, 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 asxmin,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 aspixel,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 asxmin,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 (orALL_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 (orALL_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 (8bit 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 issame. โจ--bbox <BBOX>โ the target bounding box, written asxmin,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) ortms(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.xmlsidecar files when needed.--kmlโ generate KML files.--resumeโ generate only the missing files.-j,--num-threads <NUM-THREADS>โ number of jobs (orALL_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-valuesto 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 (oralpha=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 (orALL_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
teestep.
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>
๐ COPYRIGHT ๐
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
- 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