GDAL-RASTER-UPDATE(1)
π¦ GDAL-RASTER-UPDATE β bestie's guide to updating a raster with another raster π¦
okay so this little cutie lives in the GDAL manual (that's GDAL-RASTER-UPDATE(1) iykyk) and she's brand new β added in version 3.12 β¨
β¨ NAME β¨
gdal-raster-update β update the destination raster with the content of the input one π
fr fr, she was Added in version 3.12, so she's the new girl and she's already serving.
π 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 π
so like. gdal raster update is the girl who looks at your existing output raster and goes "bestie, let me pour the pixel values of the input raster into you" π«β¨ and if the input and output datasets don't share the same coordinate reference systems, she'll reproject on the way in. no biggie. the way that she stays in her lane though?? iconic β the extent, size, resolution or coordinate reference system of the output dataset are not modified by this operation. periodt. not touched. π
also she updates the overviews for you (using gdal raster overview refresh β she doesn't do it herself, she delegates like a true main character π), unless you pass --no-update-overviews. then she minds her business.
and!! 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 π§ that's the upgrade arc, we love to see it.
πΈ PROGRAM-SPECIFIC OPTIONS πΈ
--et,--error-threshold<ERROR-THRESHOLD>β error threshold for transformation approximation, expressed as a number of input pixels. defaults to0.125pixels unless theRPC_DEMtransformer option is specified, in which case an exact transformer, i.e.--error-threshold=0, will be used. so like, specifyRPC_DEMand she goes full precision mode π€β¨--geometry<WKT_or_GeoJSON>β geometry as a WKT or GeoJSON string of a polygon (or multipolygon) to which to restrict the update π so she only does her thing inside that shape, okay??- 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-crsis specified. - if the input geometry is WKT, its CRS is assumed to be the one of the input dataset, unless
--geometry-crsis specified. - the X and Y axis are the "GIS friendly ones", that is X is longitude or easting, and Y is latitude or northing. no chaos, x is x bestie πΊοΈ
- 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<CRS>β CRS in which the coordinate values of--geometryare expressed. if not specified, it is assumed to be the CRS of the input dataset. the geometry will be reprojected from the geometry-crs <arrow>β</arrow> to the CRS of the dataset being updated. she travels π«--no-update-overviewsβ do not update existing overviews. that's it. that's the whole vibe. π--to,--transform-option<NAME>=<VALUE>β set a transformer option suitable to pass toGDALCreateGenImgProjTransformer2(). seeGDALCreateRPCTransformerV2()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.
--wo,--warp-option<NAME>=<VALUE>β set a warp option. theGDALWarpOptions::papszWarpOptionsdocs show all options. multiple options may be listed. go read the docs bestie, they're right there π
π PROGRAM-SPECIFIC OPTIONS π
(yes bestie, there are two of these sections in the original β she's extra, we respect it π )
--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 π (so like, don't be shocked if your driver doesn't take the bait.)
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 β but listen, (non-blocking errors emitted as warnings are considered as a successful execution) so don't spiral if you see a lil warning, she's still thriving π«Ά
π EXAMPLES π
Example 1: Update existing out.tif with content of in.tif using cubic interpolation
$ gdal raster update -r cubic in.tif out.tif
that's it. cubic. in. out. slay β¨
π AUTHOR π
Even Rouault <even.rouault@spatialys.com> β the legend, the icon, the moment π«‘
π COPYRIGHT π
1998-2026
okay and one tiny lil sign-off bestie: this whole page is from the GDAL manual, the page is GDAL-RASTER-UPDATE(1), and the date on the tin is Aug 18, 2026 ποΈπ now go update that raster, you got this π¦πβ¨
π¦ 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