gis.gdal.GDALBand.statistics()

statistics(refresh=False, approximate=False)

New in Django 1.10.

Compute statistics on the pixel values of this band. The return value is a tuple with the following structure: (minimum, maximum, mean, standard deviation).

If the approximate argument is set to True, the statistics may be computed based on overviews or a subset of image tiles.

If the refresh argument is set to True, the statistics will be computed from the data directly, and the cache will be updated with the result.

If a persistent cache value is found, that value is returned. For raster formats using Persistent Auxiliary Metadata (PAM) services, the statistics might be cached in an auxiliary file. In some cases this metadata might be out of sync with the pixel values or cause values from a previous call to be returned which don’t reflect the value of the approximate argument. In such cases, use the refresh argument to get updated values and store them in the cache.

For empty bands (where all pixel values are “no data”), all statistics are returned as None.

The statistics can also be retrieved directly by accessing the min, max, mean, and std properties.

doc_Django
2016-10-09 18:37:45
Comments
Leave a Comment

Please login to continue.