gdal-raster-pipeline - Man Page

Name

gdal-raster-pipeline — Process a raster dataset

Added in version 3.11.

Synopsis

Usage: gdal raster pipeline [OPTIONS] <PIPELINE>

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 <KEY>=<VALUE>  Configuration option [may be repeated]
  --progress              Display progress bar

<PIPELINE> is of the form: read [READ-OPTIONS] ( ! <STEP-NAME> [STEP-OPTIONS] )* ! write [WRITE-OPTIONS]

A pipeline chains several steps, separated with the ! (exclamation 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:

Details for options can be found in gdal raster aspect.

Details for options can be found in gdal raster clip.

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

Details for options can be found in gdal raster edit.

Details for options can be found in gdal raster hillshade.

Details for options can be found in gdal raster reproject.

Details for options can be found in gdal raster resize.

Details for options can be found in gdal raster roughness.

Details for options can be found in gdal raster scale.

Details for options can be found in gdal raster select.

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

Details for options can be found in gdal raster slope.

Details for options can be found in gdal raster tpi.

Details for options can be found in gdal raster tri.

Details for options can be found in gdal raster unscale.

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 <even.rouault@spatialys.com>

Info

Jul 12, 2025 GDAL