I have recently upgraded RasterIO from version 1.0.5 to 1.0.12. After this upgrade I now get CPLE_NotSupported in driver GTiff does not support open option MODE when reading a MemoryFile.

My code to write then read the memory file is

from rasterio.io import MemoryFile
with MemoryFile() as memfile:
    with memfile.open(**kwargs) as dst:

    with memfile.open() as src:
        for i, ea_band in enumerate(tmp_dst.read(masked=True)):
            print (ea_band.mean(), ea_band.std())

The kwargs used to create the file is

{'count': 2, 'crs': CRS({'init': u'epsg:28354'}), 'dtype': 'float32', 'driver': u'GTiff', 'transform': Affine(2.0, 0.0, 300146.0,
       0.0, -2.0, 6181978.0), 'height': 319, 'width': 358, 'nodata': -9999.0}

Is this and error or a warning and should I be worried about it? It seems to write/display the data correctly. If it's just a warning how do I prevent it from being displayed?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.