3

I am trying to read a raster ".tif" file with rasterio:

import rasterio
raster_path = r'.........\file.tif'
raster = rasterio.open(raster_path)

but I am getting the following error message:

"RasterioIOError: This is a BigTIFF file.  BigTIFF is not supported by this version of GDAL and libtiff"

Apparently, the raster file I am trying to open with rasterio is a BIGTIFF (which I had no idea about since I cannot see anything in the properties of the file when being opened with ArcMap that suggests such a thing, plus it's not a particularly big file -less than 1GB-).

I have seen similar questions posted here more than a year ago, but they don't really offer any solution.

I have:

GDAL     =>  2.4.1
libtiff  =>  4.0.10
rasterio =>  1.0.21
9
  • I've encountered this before when installing in windows with anaconda and the conda-forge feedstock. I've found gdal==2.3.3 and libtiff==4.0.10 works (with a variety of rasterio versions).
    – jdmcbr
    Aug 18, 2019 at 20:59
  • If it works with GDAL 2.3.3, shouldn't it also work with GDAL 2.4.1? Anyway, I've installed GDAL 2.3.3, but I'm still getting the same error. Aug 18, 2019 at 21:36
  • 2
    Possible duplicate of Cannot install a version of GDAL via Anaconda that permits reading BigTIFFs. See point 1 of the accepted answer and use -c conda-forge when you install.
    – user2856
    Aug 18, 2019 at 21:51
  • From that link I've used the following commands => "conda create -n testgdal -c conda-forge gdal vs2015_runtime=14" and "activate testgdal"..........error still present Aug 18, 2019 at 22:45
  • I'm still stuck with this issue. Any help much appreciated. From the possible duplicate I understand that "conda create -n testgdal -c conda-forge gdal vs2015_runtime=14" and "activate testgdal" solves the problem. I don't know what a 'conda-forge env' is, but if I use those two commands I can see that md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') throws a number different to -1. However, when I run my script, none of the packages I have installed can be imported. They have disappeared. Does it mean I have to install them again? Aug 19, 2019 at 22:15

1 Answer 1

1

I managed to get this to work on Windows with Anaconda following these steps:

I first downloaded whl files for Gdal and Rasterio as suggested on the rasterio page (e.g. from here for rasterio). I chose files for python 3.7 as I already had this combination working for big tiffs on a Linux platform.

Then in Anaconda:

conda create -n w1 python=3.7
conda activate w1
pip install GDAL-3.2.2-cp37-cp37m-win_amd64.whl
pip install rasterio-1.2.3-cp37-cp37m-win_amd64.whl

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.