[gdal-dev] GDALGetRasterStatistics() and bApproxOK, bForce

Frank Warmerdam warmerdam at pobox.com
Thu Oct 11 09:50:08 PDT 2012


Radim,

I gather the problem is that GDAL cannot tell whether saved statistics in
metadata are exact or not, right?  I don't have any real plan to resolve
this unfortunately.   I ticket might be prudent.

Best regards,
Frank

On Thu, Oct 11, 2012 at 8:39 AM, Radim Blazek <radim.blazek at gmail.com>wrote:

> GDALGetRasterStatistics API doc:
> "Returns the minimum, maximum, mean and standard deviation of all
> pixel values in this band. If approximate statistics are sufficient,
> the bApproxOK flag can be set to true in which case overviews, or a
> subset of image tiles may be used in computing the statistics.
> If bForce is FALSE results will only be returned if it can be done
> quickly (ie. without scanning the data). If bForce is FALSE and
> results cannot be returned efficiently, the method will return
> CE_Warning but no warning will have been issued. This is a
> non-standard use of the CE_Warning return value to indicate "nothing
> done"."
>
>
> My understanding is that if it is called with bApproxOK=false and
> bForce=false and exact statistics (from all raster pixels) are not
> available/cached, it should return CE_Warning. Instead, it is giving
> estimated (from sample) cached statistics and it returns CE_None.
>
> Is it expected? If it is, how can I test if exact statistics (from all
> raster pixels) are available/cached (to avoid
> GDALComputeRasterStatistics() if not necessary). Also, the meaning of
> both params should be probably better described in doc.
>
> Radim
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20121011/0636f5fc/attachment.html>


More information about the gdal-dev mailing list