On Sun, Sep 18, 2016 at 5:49 AM, Even Rouault <even.roua...@spatialys.com>
> Le dimanche 18 septembre 2016 11:02:20, Sean Gillies a écrit :
> > Hi Andrew, Even,
> > I am so grateful you asked this question, Andrew.
> UPDATE: Andrew, after digging, I believe you have hit
> https://trac.osgeo.org/gdal/ticket/6592 whose fix hasn't yet reached any
> released version.
It seems like doing something else to set the metadata change flag will
make things work. Unfortunately, the change flag seems to be guarded so
one has to make an actual change to get it to be set. Something like the
following works, but is a little crufty and deserves a comment. Perhaps
there's a better way?
int nBands = 5;
dataset->Create(filename, width, height, nBands, ...);
for (int i = 1; i <= nBands; ++i)
GDALRasterBand *band = dataset->GetRasterBand(i);
// Force metadata change flag so that description gets written.
// (ticket 6592) requires something like this.
band->SetOffset(band->GetOffset(NULL) + .00001);
band->SetOffset(band->GetOffset(NULL) - .00001);
gdal-dev mailing list