Hello,<br><br>Does the TIFF driver support the SetStatistics function? I work with<br>~4GB TIFF files and it takes a significant amount of time to call<br>ComputeStatistics. Everytime I open a file or create one it takes about 10 minutes to calculate the statistics, which would be OK if it was a one time only thing. The statistics are seemingly not cached in the meta
<br>
data or the Xml file even if the file was opened as a PAM dataset. Also it didn't make a difference if the dataset was opened with read-only or update permissions.<br><br>Here is a snippet of my code:<br><br> int bForce = FALSE;
<br> int approxOK = TRUE;<br> CPLErr err = poBand->GetStatistics (approxOK, bForce, minValue, maxValue, pMean, pStdDev);<br><br> if ( err != CE_None )<br> {<br> // Stats not cached, recompute them<br>
// BPS - using ApproxOK does not seem to obey the NoDataValue (mean shifted toward 0)<br> // also behaves differently if we just made overviews or already had them<br> // But it's soooooo much faster than recalcing full stats on a big file
<br> poBand->ComputeStatistics (FALSE, minValue, maxValue, pMean, pStdDev, NULL, NULL);<br> poBand->SetStatistics (*minValue, *maxValue, *pMean, *pStdDev);<br> }<br><br>BTW, thanks for the great product. Overall it has been a joy to use so far.
<br><br>Regards,<br><font color="#888888">Rory</font>