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

Even Rouault even.rouault at spatialys.com
Thu Aug 20 08:15:55 PDT 2015


On Thursday 20 August 2015 16:47:16 Andrea Peri wrote:
> Hi,
> 
> I need to retrieve the histogram of a set of rasters.
> To do this I use the
> gdalinfo for every raster using the parameter "-hist".
> 
> But this process take a long time because the rasters are huge and
> have 11 bands each of them.
> 
> For my need the histogram informations should be sufficient at a
> middle level pyramid.
> 
> So my question is if is possible with gdalinfo create the histogram
> from an intermediate pyramid level.

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.

Otherwise a trick would be to extract the desired overview level with 
gdal_translate -outsize (possibly as a VRT) and run gdalinfo -hist on it

> 
> Thx for any hints.

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


More information about the gdal-dev mailing list