[gdal-dev] Feature Request: Band Names

Even Rouault even.rouault at spatialys.com
Wed Feb 18 09:20:10 PST 2015


Le mercredi 18 février 2015 18:02:49, Yuta Sato a écrit :
> Dear GDAL Developers:
> 
> It would be much easier to deal with multi-band raster image if each band
> could be named, and stored in GeoTiff file.

Yuta,

This is already the case. See:

$ python

from osgeo import gdal
ds = gdal.GetDriverByName('GTiff').Create('test.tif',1,1,2)
ds.GetRasterBand(1).SetDescription('foo')
ds.GetRasterBand(2).SetDescription('bar')
ds = None


$ gdalinfo test.tif
Driver: GTiff/GeoTIFF
Files: test.tif
Size is 1, 1
Coordinate System is `'
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,    1.0)
Upper Right (    1.0,    0.0)
Lower Right (    1.0,    1.0)
Center      (    0.5,    0.5)
Band 1 Block=1x1 Type=Byte, ColorInterp=Gray
  Description = foo
Band 2 Block=1x1 Type=Byte, ColorInterp=Undefined
  Description = bar

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list