<div dir="ltr"><br><br>On Thu, Jun 14, 2018 at 10:55 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br>><br>> > > Wanna take a crack at implementing this ?<br>> ><br>> > Too many API changes required, starting with GDALGetRasterStatistics(),<br>> > GDALComputeRasterStatistics() and all else following. There must be an<br>> > easier solution. But thanks for your offer:-)<br>><br>> We don't necessary need to change the API. The function could just set the<br>> metadata item, and the client would read it with GDALGetMetadataItem()<br><div><br></div><div>Thinking about it, I do not want to support approximate statistics, therefore something like STATISTICS_VALID_RATIO does not work for me, only something like STATISTICS_N_VALID which requires exact statistics. Approximate statistics are confusing for users, unless it is made clear that these statistics are approximations. E.g. a user calculates exact statistics with some software other than GDAL and then wonders why results are different between gdalinfo and that some software known to calculate exact statistics.<br></div><div>></div>> > Enhancement request: set STATISTICS_APPROXIMATE=UNKNOWN if it is unknown. I<br>> > checked with some externally provided sample data and GDAL 2.3.0 does not<br>> > report STATISTICS_APPROXIMATE.<br>><br>> I didn't want to pollute statistics with STATISTICS_APPROXIMATE=NO when exact<br>> computation has been done. So basically you have STATISTICS_APPROXIMATE=YES or<br>> no STATISTICS_APPROXIMATE at all when exact computation has been done (which<br>> is the normal assumption)<br><div><br></div><div>Looking at random samples, the normal assumption must be STATISTICS_APPROXIMATE=YES if STATISTICS_APPROXIMATE is not set. IMHO, GDAL should set STATISTICS_APPROXIMATE=YES unless GDAL itself has computed exact statistics. If in doubt set STATISTICS_APPROXIMATE=YES.</div><div><br></div><div>I am aware it's a conflict between providing results quickly to users and providing exact results to users which might take longer to get. I am for exact results.<br></div><div><br></div><div>Markus<br></div><br></div>