GDAL-RASTER-UPDATE(1)

NAME
gdal-raster-update - Update the destination raster with the content of the input one.

Added in version 3.12.

SYNOPSIS

    Usage: gdal raster update [OPTIONS] <INPUT> <OUTPUT>
    Update the destination raster with the content of the input one.
    Positional arguments:
      -i, --input <INPUT>                        Input raster datasets [required] [not available in pipelines]
      -o, --output <OUTPUT>                      Output raster dataset [required]
    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]
    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:
      --if, --input-format <INPUT-FORMAT>        Input formats [may be repeated] [not available in pipelines]
      --oo, --open-option <KEY>=<VALUE>          Open options [may be repeated] [not available in pipelines]
      --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

DESCRIPTION

gdal raster update can be used to update an existing output raster dataset with the pixel values of the input raster, doing reprojection if the input and output datasets do not have the same coordinate reference systems. The extent, size, resolution or coordinate reference system of the output dataset are not modified by this operation.

Overviews are updated by this command (using gdal raster overview refresh), unless --no-update-overviews is specified.

Starting with GDAL 3.13, gdal raster update can be used as a step of a pipeline, with the input dataset being the output of the previous step.

PROGRAM-SPECIFIC OPTIONS

--et, --error-threshold <ERROR-THRESHOLD>
    Error threshold for transformation approximation, expressed as a number of input pixels. Defaults to 0.125 pixels unless the RPC_DEM transformer option is specified, in which case an exact transformer, i.e. --error-threshold=0, will be used.

--geometry <WKT_or_GeoJSON>
    Geometry as a WKT or GeoJSON string of a polygon (or multipolygon) to which to restrict the update. If the input geometry is GeoJSON, its CRS is assumed to be WGS84, unless there is a CRS defined in the GeoJSON geometry or --geometry-crs is specified. If the input geometry is WKT, its CRS is assumed to be the one of the input dataset, unless --geometry-crs is specified. The X and Y axis are the "GIS friendly ones", that is X is longitude or easting, and Y is latitude or northing.

--geometry-crs <CRS>
    CRS in which the coordinate values of --geometry are expressed. If not specified, it is assumed to be the CRS of the input dataset. The geometry will be reprojected from the geometry-crs to the CRS of the dataset being updated.

--no-update-overviews
    Do not update existing overviews.

--to, --transform-option <NAME>=<VALUE>
    Set a transformer option suitable to pass to GDALCreateGenImgProjTransformer2(). See GDALCreateRPCTransformerV2() for RPC specific options.

-r, --resampling <RESAMPLING>
    Resampling method to use. Available methods are:

    nearest: nearest neighbour resampling (default, fastest algorithm, worst interpolation quality).

    bilinear: bilinear resampling.

    cubic: cubic resampling.

    cubicspline: cubic spline resampling.

    lanczos: Lanczos windowed sinc resampling.

    average: average resampling, computes the weighted average of all non-NODATA contributing pixels.

    rms root mean square / quadratic mean of all non-NODATA contributing pixels

    mode: mode resampling, selects the value which appears most often of all the sampled points. In the case of ties, the first value identified as the mode will be selected.

    max: maximum resampling, selects the maximum value from all non-NODATA contributing pixels.

    min: minimum resampling, selects the minimum value from all non-NODATA contributing pixels.

    med: median resampling, selects the median value of all non-NODATA contributing pixels.

    q1: first quartile resampling, selects the first quartile value of all non-NODATA contributing pixels.

    q3: third quartile resampling, selects the third quartile value of all non-NODATA contributing pixels.

    sum: compute the weighted sum of all non-NODATA contributing pixels

    NOTE: When downsampling is performed (use of --resolution or --size), existing overviews (either internal/implicit or external ones) on the source image will be used by default by selecting the closest overview to the desired output resolution. The resampling method used to create those overviews is generally not the one you specify through the -r option.

--wo, --warp-option <NAME>=<VALUE>
    Set a warp option. The GDALWarpOptions::papszWarpOptions docs show all options. Multiple options may be listed.

PROGRAM-SPECIFIC OPTIONS

--if, --input-format <format>
    Format/driver name to be attempted to open the input file(s). It is generally not necessary to specify it, but it can be used to skip automatic driver detection, when it fails to select the appropriate driver. This option can be repeated several times to specify several candidate drivers. Note that it does not force those drivers to open the dataset. In particular, some drivers have requirements on file extensions.

    May be repeated.

--oo, --open-option <NAME>=<VALUE>
    Dataset open option (format specific).

    May be repeated.

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

EXAMPLES

  Example 1: Update existing out.tif with content of in.tif using cubic interpolation

    $ gdal raster update -r cubic in.tif out.tif

AUTHOR
Even Rouault <even.rouault@spatialys.com>

COPYRIGHT
1998-2026