[gdal-dev] Slow GDALComputeRasterMinMax on nc grids

Even Rouault even.rouault at spatialys.com
Fri Jan 3 12:25:16 PST 2020


On vendredi 3 janvier 2020 16:03:47 CET Jeff McKenna wrote:
> On 2020-01-03 3:52 PM, Even Rouault wrote:
> > Do you build netCDF with a custom value of the CHUNK_CACHE_SIZE /
> > chunk-cache- size setting ?
> > 
> > With the default (4 MB), runtime on my machine is about 7 minutes. But if
> > I
> > use --with-chunk-cache-size=67108864 as in
> > https://trac.osgeo.org/gdal/ticket/5291#comment:26 , then it goes down to
> > 9 sec.
> > 
> > So this is a quite old known issue with the netCDF driver with HDF5
> > chunking & compression. Due to the netCDF driver exposing rasters with a
> > north origin, and netCDF Y origin being at south, there's a mismatch
> > between GDAL blocks and netCDF chunks. So for the sake of simplicity, the
> > netCDF driver exposes one single line as the GDAL block size. It
> > could/should be improved to make a better use of netCDF chunks, so as not
> > being too much dependent of the quite pessimistic default of the netCDF
> > chunk_cache_size.
> 
> Hi Even,
> 
> No I don't set CHUNK_CACHE_SIZE during compile at all.  I do however set
> USE_HDF5=OFF

Ah, that explains it all then. The file is thus opened by the HDF5 driver, not 
the netCDF one. And I also do get the 5 sec when forcing the HDF5 driver. But 
you loose the whole netCDF specific logic, and in particular georeferencing.

Even

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


More information about the gdal-dev mailing list