[gdal-dev] Python Bindings and Closed Datasets

Even Rouault even.rouault at spatialys.com
Wed Oct 30 12:31:43 PDT 2019


I've, unsuccessfully, tried to reproduce your issue with the following script:

-----

from osgeo import gdal
import concurrent.futures

def worker(in_f, out_f):
    gdal.Unlink(out_f)
    gdal.Warp(out_f, in_f, options = '-co COMPRESS=DEFLATE -co TILED=YES -ts 2048 2048')

jobs = []

for i in range(1000):
    jobs.append( ['byte.tif', '/tmp/byte%d.tif' % i] )

with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
    future_map = {executor.submit(worker, in_f, out_f): out_f for in_f, out_f in jobs}
    for future in concurrent.futures.as_completed(future_map):
        out_f = future_map[future]
        try:
            future.result()
        except Exception as exc:
            print('%r generated an exception: %s' % (out_f, exc))

        print('Finished ' + out_f)
        ds = gdal.Open(out_f)
        if ds.GetRasterBand(1).Checksum() != 58226:
            print('wrong checksum for ' + out_f)

------

where the input byte.tif file is
https://github.com/OSGeo/gdal/blob/master/autotest/gcore/data/byte.tif?raw=true


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


More information about the gdal-dev mailing list