1GDAL_EDIT(1)                         GDAL                         GDAL_EDIT(1)
2
3
4

NAME

6       gdal_edit  -  Edit  in  place  various  information of an existing GDAL
7       dataset.
8

SYNOPSIS

10          gdal_edit [--help-general] [-ro] [-a_srs srs_def]
11                  [-a_ullr ulx uly lrx lry] [-a_ulurll ulx uly urx ury llx lly]
12                  [-tr xres yres] [-unsetgt] [-unsetrpc] [-a_nodata value] [-unsetnodata]
13                  [-unsetstats] [-stats] [-approx_stats]
14                  [-setstats min max mean stddev]
15                  [-scale value] [-offset value] [-units value]
16                  [-colorinterp_X red|green|blue|alpha|gray|undefined]*
17                  [-gcp pixel line easting northing [elevation]]*
18                  [-unsetmd] [-oo NAME=VALUE]* [-mo "META-TAG=VALUE"]*  datasetname
19

DESCRIPTION

21       The gdal_edit.py script can be used to edit in place  various  informa‐
22       tion  of  an  existing  GDAL dataset (projection, geotransform, nodata,
23       metadata).
24
25       It works only with raster formats that support update access to  exist‐
26       ing datasets.
27
28       CAUTION:
29          Depending  on  the  format,  older values of the updated information
30          might still be found in the file in a  "ghost"  state,  even  if  no
31          longer accessible through the GDAL API. This is for example the case
32          of the GTiff -- GeoTIFF File Format format (this is not a exhaustive
33          list).
34
35       --help-general
36              Gives a brief usage message for the generic GDAL commandline op‐
37              tions and exit.
38
39       -ro    Open the dataset in read-only. Might be useful for  drivers  re‐
40              fusing to use the dataset in update-mode. In which case, updated
41              information will go into PAM .aux.xml files.
42
43       -a_srs <srs_def>
44              Defines the target coordinate system.   This  coordinate  system
45              will  be written to the dataset.  If the empty string or None is
46              specified, then the existing coordinate system will  be  removed
47              (for TIFF/GeoTIFF, might not be well supported besides that).
48
49       -a_ullr ulx uly lrx lry:
50              Assign/override the georeferenced bounds of the dataset.
51
52       -a_ulurll ulx uly urx ury llx lly:
53              Assign/override  the  georeferenced  bounds  of the dataset from
54              three points: upper-left,  upper-right  and  lower-left.  Unlike
55              -a_ullr, this also supports rotated datasets (edges not parallel
56              to coordinate system axes).
57
58              New in version 3.1.
59
60
61       -tr <xres> <yres>
62              Set target resolution. The values must be expressed in georefer‐
63              enced units.  Both must be positive values.
64
65       -unsetgt
66              Remove the georeference information.
67
68       -unsetrpc
69              Remove RPC information.
70
71              New in version 2.4.
72
73
74       -unsetstats
75              Remove band statistics information.
76
77              New in version 2.0.
78
79
80       -stats Calculate and store band statistics.
81
82              New in version 2.0.
83
84
85       -setstats min max mean stddev
86              Store user-defined values for band statistics (minimum, maximum,
87              mean and standard deviation). If any of the  values  is  set  to
88              None,  the real statistics are calclulated from the file and the
89              ones set to None are used from the real statistics.
90
91              New in version 2.4.
92
93
94       -approx_stats
95              Calculate and store approximate band statistics.
96
97              New in version 2.0.
98
99
100       -a_nodata <value>
101              Assign a specified nodata value to output bands.
102
103       -unsetnodata
104              Remove existing nodata values.
105
106              New in version 2.1.
107
108
109       -scale <value>
110              Assign a specified scale value to output  bands.   If  a  single
111              scale  value is provided it will be set for all bands.  Alterna‐
112              tively one scale value per band can be provided, in  which  case
113              the  number  of scale values must match the number of bands.  If
114              no scale is needed, it it recommended to set  the  value  to  1.
115              Scale and Offset are generally used together. For example, scale
116              and offset might be used to store elevations in a unsigned 16bit
117              integer  file  with  a precision of 0.1, and starting from -100.
118              True values would be calculated as: true_value = (pixel_value  *
119              scale) + offset
120
121              NOTE:
122                 These   values   can  be  applied  using  -unscale  during  a
123                 gdal_translate run.
124
125              New in version 2.2.
126
127
128       -offset <value>
129              Assign a specified offset value to output bands.   If  a  single
130              offset value is provided it will be set for all bands.  Alterna‐
131              tively one offset value per band can be provided, in which  case
132              the  number of offset values must match the number of bands.  If
133              no offset is needed, it recommended to set the value to 0.   For
134              more see scale.
135
136              New in version 2.2.
137
138
139       -units <value>
140              Assign a unit to output band(s).
141
142              New in version 3.1.
143
144
145       -colorinterp_X red|green|blue|alpha|gray|undefined
146              Change  the  color  interpretation of band X (where X is a valid
147              band number, starting at 1).
148
149              New in version 2.3.
150
151
152       -gcp pixel line easting northing [elevation]
153              Add the indicated ground control point to the dataset.  This op‐
154              tion may be provided multiple times to provide a set of GCPs.
155
156       -unsetmd
157              Remove  existing metadata (in the default metadata domain).  Can
158              be combined with -mo.
159
160              New in version 2.0.
161
162
163       -mo META-TAG=VALUE
164              Passes a metadata key and value to set on the output dataset  if
165              possible.   This  metadata  is  added  to  the existing metadata
166              items, unless -unsetmd is also specified.
167
168       -oo NAME=VALUE
169              Open option (format specific).
170
171              New in version 2.0.
172
173
174       The -a_ullr, -a_ulurll, -tr and -unsetgt options are exclusive.
175
176       The -unsetstats and either -stats or -approx_stats options  are  exclu‐
177       sive.
178

EXAMPLE

180          gdal_edit -mo DATUM=WGS84 -mo PROJ=GEODETIC -a_ullr 7 47 8 46 test.ecw
181
182          gdal_edit -scale 1e3 1e4 -offset 0 10 twoBand.tif
183

AUTHOR

185       Even Rouault <even.rouault@spatialys.com>
186
188       1998-2023
189
190
191
192
193                                 Apr 17, 2023                     GDAL_EDIT(1)
Impressum