GDAL_EDIT(1)
π NAME π
okay bestie, this is the GDAL_EDIT(1) page from the GDAL manual. π
gdal_edit β edit in place various information of an existing GDAL dataset. Thatβs the whole assignment: tweak the info on a dataset that already exists, no new-file nonsense. π«Ά
β¨ SYNOPSIS β¨
Hereβs the exact invocation mood board β do not touch a character, iykyk:
gdal_edit [--help-general] [-ro] [-a_srs srs_def]
[-a_ullr ulx uly lrx lry] [-a_ulurll ulx uly urx ury llx lly]
[-tr xres yres] [-unsetgt] [-unsetrpc] [-a_nodata value] [-unsetnodata]
[-unsetstats] [-stats] [-approx_stats]
[-setstats min max mean stddev]
[-scale value] [-offset value] [-units value]
[-colorinterp_X red|green|blue|alpha|gray|undefined]*
[-gcp pixel line easting northing [elevation]]*
[-unsetmd] [-oo NAME=VALUE]* [-mo "META-TAG=VALUE"]* datasetname
πΈ DESCRIPTION πΈ
The gdal_edit.py script can be used to edit in place various information of an existing GDAL dataset (projection, geotransform, nodata, metadata). It works only with raster formats that support update access to existing datasets. periodt.
CAUTION: Depending on the format, older values of the updated information might still be found in the file in a "ghost" state, even if no longer accessible through the GDAL API. This is for example the case of the raster.gtiff format (this is not a exhaustive list). Spooky but real. π»
--help-generalβ gives a brief usage message for the generic GDAL commandline options and exits. so helpful.-roβ opens the dataset in read-only. Might be useful for drivers refusing to use the dataset in update-mode. In which case, updated information will go into PAM.aux.xmlfiles. cute little sidecar situation.-a_srs<srs_def>β defines the target coordinate system. This coordinate system will be written to the dataset. If the empty string orNoneis specified, then the existing coordinate system will be removed (for TIFF/GeoTIFF, might not be well supported besides that). bye bye, SRS.-a_ullrulxulylrxlryβ assign/override the georeferenced bounds of the dataset. corners said left, right, up, down.-a_ulurllulxulyurxuryllxllyβ assign/override the georeferenced bounds of the dataset from three points: upper-left, upper-right and lower-left. Unlike-a_ullr, this also supports rotated datasets (edges not parallel to coordinate system axes). New in version 3.1.-tr<xres><yres>β set target resolution. The values must be expressed in georeferenced units. Both must be positive values. positive vibes only.-unsetgtβ remove the georeference information. poof.-unsetrpcβ remove RPC information. New in version 2.4.-unsetstatsβ remove band statistics information. New in version 2.0.-statsβ calculate and store band statistics. New in version 2.0.-setstatsminmaxmeanstddevβ store user-defined values for band statistics (minimum, maximum, mean and standard deviation). If any of the values is set toNone, the real statistics are calculated from the file and the ones set toNoneare used from the real statistics. New in version 2.4.-approx_statsβ calculate and store approximate band statistics. New in version 2.0.-a_nodata<value>β assign a specified nodata value to output bands. nodata said hi.-unsetnodataβ remove existing nodata values. New in version 2.1.-scale<value>β assign a specified scale value to output bands. If a single scale value is provided it will be set for all bands. Alternatively one scale value per band can be provided, in which case the number of scale values must match the number of bands. If no scale is needed, itβs recommended to set the value to1. Scale and Offset are generally used together. For example, scale and offset might be used to store elevations in a unsigned 16bit integer file with a precision of0.1, and starting from-100. True values would be calculated as:true_value = (pixel_value * scale) + offset. NOTE: These values can be applied using-unscaleduring agdal_translaterun. New in version 2.2.-offset<value>β assign a specified offset value to output bands. If a single offset value is provided it will be set for all bands. Alternatively one offset value per band can be provided, in which case the number of offset values must match the number of bands. If no offset is needed, itβs recommended to set the value to0. For more see scale. New in version 2.2.-units<value>β assign a unit to output band(s). New in version 3.1.-colorinterp_Xred|green|blue|alpha|gray|undefinedβ change the color interpretation of band X (where X is a valid band number, starting at1). New in version 2.3.-gcppixellineeastingnorthing[elevation]β add the indicated ground control point to the dataset. This option may be provided multiple times to provide a set of GCPs. GCP stack, letβs go.-unsetmdβ remove existing metadata (in the default metadata domain). Can be combined with-mo. New in version 2.0.-moMETA-TAG=VALUEβ passes a metadata key and value to set on the output dataset if possible. This metadata is added to the existing metadata items, unless-unsetmdis also specified.-ooNAME=VALUEβ open option (format specific). New in version 2.0.
Exclusive flags check: the-a_ullr,-a_ulurll,-trand-unsetgtoptions are exclusive. The-unsetstatsand either-statsor-approx_statsoptions are exclusive.
π EXAMPLE π
okay, example time, bestie:
gdal_edit -mo DATUM=WGS84 -mo PROJ=GEODETIC -a_ullr 7 47 8 46 test.ecw
gdal_edit -scale 1e3 1e4 -offset 0 10 twoBand.tif
π AUTHOR π
Even Rouault <even.rouault@spatialys.com> β icon, legend, wrote this page. π
π COPYRIGHT π
1998-2026 β the copyright era, periodt.
kisses, the GDAL manual π β GDAL_EDIT(1), Jan 08, 2026, mwah π
π¦ where this page comes from
- epel 9: gdal3.4 3.4.3-5.el9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms