[gdal-dev] Calculate histogram using pyramids instead of tiff

Even Rouault even.rouault at spatialys.com
Thu Aug 20 09:44:30 PDT 2015


On Thursday 20 August 2015 18:18:28 aperi2007 wrote:
> Hi Even, thx for hint.
> 
> Is this possible using the python API ?

Sure

ds.GetRasterBand(1).GetHistogram(approx_ok = 1)

Other keywords possible: min, max, buckets to define respectively the minimum 
value of the histogram, the maximum, and the number of buckets. Defaults are 
respectively -0.5, 255.5 and 256 (buckets have a width, hence the 0.5)

> 
> Thx ,
> 
> A.
> 
> Il 20/08/2015 17:15, Even Rouault ha scritto:
> > Not directly. At the API level, it is possible to require for approximate
> > histogram (and this will select a overview level that is close to 1 / 50
> > th of the original raster size.

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list