I am trying to open a GeoTIFF using the following code:
filename = r"C:\Users\user\Downloads\grdtocsv\ers_to_tiff\old.tiff"
sourceds = gdal.Open(filename)
The thing is that I dont get any error and the 'sourceds' is empty
The version of GDAL is 3.4.3
Vince
20.5k16 gold badges49 silver badges65 bronze badges
-
Enable exceptions then see what error you get: gdal.org/api/…mikewatt– mikewatt2022年12月06日 00:07:17 +00:00Commented Dec 6, 2022 at 0:07
1 Answer 1
This is a "gotcha" in the GDAL Python bindings.
from osgeo import gdal
gdal.UseExceptions() # <---- Add this line
gdal.open(r'C:\Users\user\Downloads\grdtocsv\ers_to_tiff\old.tiff')
answered Dec 6, 2022 at 0:15
lang-py