gdal-raster-pipeline - Man Page

Name

gdal-raster-pipeline — Process a raster dataset applying several steps

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.

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)

<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, 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.

Potential steps are:

Details for options can be found in gdal raster calc.

Details for options can be found in gdal raster mosaic.

Details for options can be found in gdal raster stack.

Details for options can be found in gdal raster aspect.

Details for options can be found in gdal raster blend.

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 fill-nodata.

Details for options can be found in gdal raster hillshade.

Details for options can be found in gdal raster materialize.

Details for options can be found in gdal raster neighbors.

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

Details for options can be found in gdal raster overview.

Details for options can be found in gdal raster pansharpen.

Details for options can be found in gdal raster proximity.

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 rgb-to-palette.

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 sieve.

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.

Details for options can be found in gdal raster viewshed.

Details for options can be found in Output nested pipeline.

Added in version 3.12.

* info [OPTIONS]
----------------

Return information on a raster dataset.

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

Details for options can be found in gdal raster info.

Added in version 3.12.

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

Generate tiles in separate files from a raster dataset.

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>                                  Tiling scheme. TILING-SCHEME=raster|WebMercatorQuad|WorldCRS84Quad|WorldMercatorWGS84Quad|GoogleCRS84Quad|PseudoTMS_GlobalMercator|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 dataset extent not intersecting tile matrix is only a warning
  -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 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
  --dst-nodata <DST-NODATA>                                        Destination nodata value
  --skip-blank                                                     Do not generate blank tiles
  --metadata <KEY>=<VALUE>                                         Add metadata item to output tiles [may be repeated]
  --copy-src-metadata                                              Whether to copy metadata from source dataset
  --aux-xml                                                        Generate .aux.xml sidecar files when needed
  --kml                                                            Generate KML files
  --resume                                                         Generate only 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 beignored 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 transparent pixelto 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.

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.

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"
}

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.

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

There are 2 kinds of nested pipelines:

See Nested pipeline.

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 --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 ! read in.tif ! reproject --dst-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

Author

Even Rouault <even.rouault@spatialys.com>

Info

Nov 07, 2025 GDAL