[gdal-dev] python: set CacheMax to percent, MB, GB?

Even Rouault even.rouault at spatialys.com
Thu Jun 17 10:21:10 PDT 2021


Matt,

Le 17/06/2021 à 19:14, Matt.Wilkie at yukon.ca a écrit :
>
> I see in https://gdal.org/python/osgeo.gdal-module.html#SetCacheMax 
> <https://gdal.org/python/osgeo.gdal-module.html#SetCacheMax> we set 
> the value using bytes. Is there a prebuilt method to convert units 
> like percent, megabytes, gigabytes to bytes or is it up to us to build 
> one?
>
up to the user

you could also call gdal.SetConfigOption('GDAL_CACHEMAX', string), but 
you need to do that *before* reading any raster in the process (or any 
call to gdal.SetCacheMax/GetCacheMax), otherwise it will be ignored.

Even--

http://www.spatialys.com
My software is free, but my time generally not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210617/7c1efea3/attachment.html>


More information about the gdal-dev mailing list