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

Matt.Wilkie at yukon.ca Matt.Wilkie at yukon.ca
Thu Jun 17 10:44:11 PDT 2021


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.

Thanks! ...Later: How to use it? It doesn't seem to work for me:

~~~
>>> gdal.GetCacheMax()
4294967296
>>> gdal.SetCacheMax(0)
>>> gdal.GetCacheMax()
0
>>> gdal.SetConfigOption('GDAL_CACHEMAX','50%')
>>> gdal.GetCacheMax()
0
>>> gdal.SetConfigOption('GDAL_CACHEMAX','500')
>>> gdal.GetCacheMax()
0
>>> gdal.VersionInfo()
'3020200
~~~

Python 3.8.8 (default, Feb 24 2021, 15:54:32) on Windows (64 bits).



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


More information about the gdal-dev mailing list