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

EXAMPLE

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

AUTHOR

184       Even Rouault <even.rouault@spatialys.com>
185
187       1998-2021
188
189
190
191
192                                 Sep 07, 2021                     GDAL_EDIT(1)
Impressum