I trying to follow some code on git which uses sentinel hub images code
I'm stuck with one part of the code which opens and reads a grayscale tif image which for some reason returns a rasterio IOerror.
with rasterio.open(img_path) as src: gamma0 = src.read(1)
The error message is as follows:
rasterio.errors.RasterioIOError: Read or write failed. /home/vulcanadmin/landstat-sentinel-fusion-installation/landsat-sentinel-fusion/data/processed/sentinel-1/antananarivo/vv-gamma0.tif, band 1: IReadBlock failed at X offset 0, Y offset 0: TIFFReadEncodedStrip() failed.
I checked the image. It isn't corrupt, no issues opening it with gdal.
Read that it has do with setting a GDAL variable, VRT_SHARED_SOURCE=0. I'm trying to figure out how this variable should be set or if anyone has encountered a similar issue and found a resolution. I'm using a linux system so tried setting it as an environment variable
export $VRT_SHARED_SOURCE=0 but that didn't work. Neither did it work with the following,
with rasterio.Env(VRT_SHARED_SOURCE=0): with rasterio.open('vv-gamma0.tif') as src: gamma0 = src.read(1)
Would appreciate any help. Thanks.