GDAL-RASTER-PIPELINE(1) GDAL GDAL-RASTER-PIPELINE(1) NAME gdal-raster-pipeline - Process a raster dataset Added in version 3.11. SYNOPSIS Usage: gdal raster pipeline [OPTIONS] Process a raster dataset. Positional arguments: Common Options: -h, --help Display help message and exit --json-usage Display usage as JSON document and exit --config = Configuration option [may be repeated] --progress Display progress bar is of the form: read [READ-OPTIONS] ( ! [STEP-OPTIONS] )* ! write [WRITE-OPTIONS] A pipeline chains several steps, separated with the ! (quotation mark) character. The first step must be read, and the last one write. Each step has its own positional or non-positional arguments. Apart from read and write, all other steps can potentially be used several times in a pipeline. Potential steps are: o read * read [OPTIONS] ------------------------ Read a raster dataset. Positional arguments: -i, --input Input raster dataset [required] Advanced Options: --if, --input-format Input formats [may be repeated] --oo, --open-option = Open options [may be repeated] o aspect * aspect [OPTIONS] ------------------ Generate an aspect map Options: -b, --band Input band (1-based index) (default: 1) --convention Convention for output angles. CONVENTION=azimuth|trigonometric-angle (default: azimuth) --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. o clip * clip [OPTIONS] ---------------- Clip a raster dataset. Options: --bbox Clipping bounding box as xmin,ymin,xmax,ymax Mutually exclusive with --geometry, --like --bbox-crs CRS of clipping bounding box --geometry Clipping geometry (WKT or GeoJSON) Mutually exclusive with --bbox, --like --geometry-crs CRS of clipping geometry --like Dataset to use as a template for bounds Mutually exclusive with --bbox, --geometry --like-sql SELECT statement to run on the 'like' dataset Mutually exclusive with --like-where --like-layer Name of the layer of the 'like' dataset --like-where 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. o color-map * color-map [OPTIONS] --------------------- Generate a RGB or RGBA dataset from a single band, using a color map Options: -b, --band Input band (1-based index) (default: 1) --color-map Color map filename --add-alpha Adds an alpha mask band to the destination. --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. o edit * edit [OPTIONS] ---------------- Edit a raster dataset. Options: --crs Override CRS (without reprojection) --bbox Bounding box as xmin,ymin,xmax,ymax --nodata Assign a specified nodata value to output bands ('none', numeric value, 'nan', 'inf', '-inf') --metadata = Add/update dataset metadata item [may be repeated] --unset-metadata Remove dataset metadata item [may be repeated] Details for options can be found in gdal raster edit. o hillshade * hillshade [OPTIONS] --------------------- Generate a shaded relief map Options: -b, --band Input band (1-based index) (default: 1) -z, --zfactor Vertical exaggeration used to pre-multiply the elevations --xscale Ratio of vertical units to horizontal X axis units --yscale Ratio of vertical units to horizontal Y axis units --azimuth Azimuth of the light, in degrees (default: 315) --altitude Altitude of the light, in degrees (default: 45) --gradient-alg Algorithm used to compute terrain gradient. GRADIENT-ALG=Horn|ZevenbergenThorne (default: Horn) --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. o reproject * reproject [OPTIONS] --------------------- Reproject a raster dataset. Options: -s, --src-crs Source CRS -d, --dst-crs Destination CRS -r, --resampling Resampling method. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|rms|mode|min|max|med|q1|q3|sum (default: nearest) --resolution , Target resolution (in destination CRS units) Mutually exclusive with --size --size , Target size in pixels Mutually exclusive with --resolution --bbox Target bounding box (in destination CRS units) --bbox-crs CRS of target bounding box Advanced Options: --target-aligned-pixels Round target extent to target resolution --src-nodata Set nodata values for input bands ('None' to unset). [1.. values] --dst-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 have none. --wo, --warp-option = Warping option(s) [may be repeated] --to, --transform-option = Transform option(s) [may be repeated] --et, --error-threshold Error threshold Details for options can be found in gdal raster reproject. o resize * resize [OPTIONS] ------------------ Resize a raster dataset without changing the georeferenced extents. Options: --size , Target size in pixels (or percentage if using '%' suffix) [required] -r, --resampling Resampling method. RESAMPLING=nearest|bilinear|cubic|cubicspline|lanczos|average|mode (default: nearest) Details for options can be found in gdal raster resize. o roughness * roughness [OPTIONS] --------------------- Generate a roughness map Options: -b, --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. o scale * scale [OPTIONS] ----------------- Scale the values of the bands of a raster dataset. Options: --ot, --datatype, --output-data-type Output data type. OUTPUT-DATA-TYPE=Byte|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64 -b, --band Select band to restrict the scaling (1-based index) --src-min Minimum value of the source range --src-max Maximum value of the source range --dst-min Minimum value of the destination range --dst-max Maximum value of the destination range --exponent Exponent to apply non-linear scaling with a power function --no-clip Do not clip input values to [srcmin, srcmax] Details for options can be found in gdal raster scale. o select * select [OPTIONS] ------------------------- Select a subset of bands from a raster dataset. Positional arguments: -b, --band Band(s) (1-based index, 'mask' or 'mask:') [1.. values] [required] Options: --mask Mask band (1-based index, 'mask', 'mask:' or 'none') Details for options can be found in gdal raster select. o set-type * set-type [OPTIONS] -------------------- Modify the data type of bands of a raster dataset. Options: --ot, --datatype, --output-data-type Output data type. OUTPUT-DATA-TYPE=Byte|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. o slope * slope [OPTIONS] ----------------- Generate a slope map Options: -b, --band Input band (1-based index) (default: 1) --unit Unit in which to express slopes. UNIT=degree|percent (default: degree) --xscale Ratio of vertical units to horizontal X axis units --yscale Ratio of vertical units to horizontal Y axis units --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. o tpi * tpi [OPTIONS] --------------- Generate a Topographic Position Index (TPI) map Options: -b, --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. o tri * tri [OPTIONS] --------------- Generate a Terrain Ruggedness Index (TRI) map Options: -b, --band Input band (1-based index) (default: 1) --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. o unscale * unscale [OPTIONS] ------------------- Convert scaled values of a raster dataset into unscaled values. Options: --ot, --datatype, --output-data-type Output data type. OUTPUT-DATA-TYPE=Byte|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64 Details for options can be found in gdal raster unscale. o write * write [OPTIONS] -------------------------- Write a raster dataset. Positional arguments: -o, --output Output raster dataset [required] Options: -f, --of, --format, --output-format Output format ("GDALG" allowed) --co, --creation-option = Creation option [may be repeated] --overwrite Whether overwriting existing output is allowed DESCRIPTION gdal raster pipeline can be used to process a raster dataset and perform various processing steps. 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 apply the specified pipeline in a on-the-fly / streamed way. The command_line member of the JSON file should nominally be the whole command line without the final write step, and is what is generated by gdal raster pipeline ! .... ! write out.gdalg.json. { "type": "gdal_streamed_alg", "command_line": "gdal raster pipeline ! read in.tif ! reproject --dst-crs=EPSG:32632" } The final write step can be added but if so it must explicitly specify the stream output format and a non-significant output dataset name. { "type": "gdal_streamed_alg", "command_line": "gdal raster pipeline ! read in.tif ! reproject --dst-crs=EPSG:32632 ! write --output-format=streamed streamed_dataset" } EXAMPLES Example 1: Reproject a GeoTIFF file to CRS EPSG:32632 ("WGS 84 / UTM zone 32N") and adding a metadata item $ gdal raster pipeline --progress ! read in.tif ! reproject --dst-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 --progress ! read in.tif ! reproject --dst-crs=EPSG:32632 ! write in_epsg_32632.gdalg.json --overwrite $ gdal raster info in_epsg_32632.gdalg.json AUTHOR Even Rouault COPYRIGHT 1998-2025 May 6, 2025 GDAL-RASTER-PIPELINE(1)