On vendredi 7 février 2020 03:58:02 CET umbertofilippo wrote: > Solved by looking at this answer > <https://gis.stackexchange.com/questions/44003/python-equivalent-of-gdalbuil > dvrt/299218> > > > out_vrt = os.path.join(out_dir, 'mosaic.vrt') > ds = gdal.BuildVRT(out_vrt, [raster1.tif, raster2.tif]) > ds = None # this did the trick! > factors = [128, 256, 512] > gdal.SetConfigOption('COMPRESS_OVERVIEW', 'DEFLATE') > ds.BuildOverviews("AVERAGE", factors)
The above will obviously not work :-) ! You cannot call ds.BuildOverview() when ds is set to None before. I suspect you've added in-between a ds = gdal.Open(out_vrt, gdal.GA_Update) But having to close / re-open was a bug that I've just fixd. Your original code would now work. Even -- Spatialys - Geospatial professional services http://www.spatialys.com _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev