<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Sep 18, 2016 at 5:49 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">Le dimanche 18 septembre 2016 11:02:20, Sean Gillies a écrit :<br>
> Hi Andrew, Even,<br>
><br>> I am so grateful you asked this question, Andrew.<br>
<br>
</div></div>UPDATE: Andrew, after digging, I believe you have hit<br>
<a href="https://trac.osgeo.org/gdal/ticket/6592" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/<wbr>ticket/6592</a> whose fix hasn't yet reached any<br>
released version.<br></blockquote><div><br></div><div>Thanks Even,</div><div><br></div><div>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?</div><div><br></div><div><span style="font-size:12.8px">int nBands = 5;</span><br></div><div><div style="font-size:12.8px">dataset->Create(filename, width, height, nBands, ...);</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">for (int i = 1; i <= nBands; ++i)<br clear="all"><div>{</div><div> GDALRasterBand *band = dataset->GetRasterBand(i);</div><div> band->SetDescription(<wbr>someString);</div><div><br></div><div> // Force metadata change flag so that description gets written. Current bug</div><div> // (ticket 6592) requires something like this.</div><div><div style="font-size:small"> band->SetOffset(band->GetOffset(NULL) + .00001);</div><div style="font-size:small"> band->SetOffset(band->GetOffset(NULL) - .00001); </div></div><div><br></div><div> band->WriteBlock(someData);</div><div>}</div></div></div></div><div><br></div>-- <br><div class="gmail_signature">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div>
</div></div>