[gdal-dev] Writing descriptions to GeoTiff bands

Andrew Bell andrew.bell.ia at gmail.com
Fri Sep 16 13:57:13 PDT 2016


Hi,

My code for creating a Tiff raster looks something like this:

int nBands = 5;
dataset->Create(filename, width, height, nBands, ...);

for (int i = 1; i <= nBands; ++i)
{
    GDALRasterBand *band = dataset->GetRasterBand(i);
    band->SetDescription(someString);
    band->WriteBlock(someData);
}

It appears that only the description to band 1 is written (it's the only
one reported by gdalinfo).  A little debugging leads me to believe that
what's happening is that WriteBlock() invokes Crystalize() ->
WriteMetadata(), which takes care of setting the band description.  But
once Crystalize() is called, it sets a flag so as to be a NOOP in future
calls.  I'm not using streaming.

I'm trying to understand if this behavior is by design, a limitation that I
can't find in the documentation or a bug.

Any pointers appreciated.

-- 
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160916/afb0684d/attachment.html>


More information about the gdal-dev mailing list