[gdal-dev] How to edit GeoTIFF band names with gdal_edit?

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Thu Oct 4 06:14:03 PDT 2018


Hi,

The names of the raster bands seem to be stored into GeoTIFF with GDAL tag 42112

Tag 42112: <GDALMetadata>
<Item name="DESCRIPTION" sample="0" role="description">SomeBandName 001</Item>
<Item name="DESCRIPTION" sample="1" role="description">SomeBandName 002</Item>

The description can be set with Python by doing something like
RasterBand.SetDescription(BandName)

I guess that those metadata items can be added also with gdal_edit but I can't imagine what is the right syntax. A simple test with
gdal_edit -mo "DESCRIPTION=test" test.tif
adds metadata into higher level

Metadata:
  AREA_OR_POINT=Area
  DESCRIPTION=test

So how would the gdal_edit command look like on Windows, if the aim is to add a metadata item
<Item name="DESCRIPTION" sample="0" role="description">SomeBandName 001</Item>
so that after this gdalinfo would report

Band 1 Block=20x20 Type=UInt16, ColorInterp=Gray
  Description = SomeBandName 001

-Jukka Rahkonen-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20181004/b53d5232/attachment.html>


More information about the gdal-dev mailing list