I try to project a raster into another projection and I cannot manage to use the
I can obtain the CRS of a file using the following code :
import rasterio as rio with rio.open('a_file.tif') as f: # not relevant that I give you the file print(f.crs) crs >>> CRS.from_epsg(4326)
If instead I want to create a CRS from scratch with :
I get the following error :
CPLE_OpenFailedError: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
So I checked the
GDAL_DATAenv variable :
import os os.environ['GDAL_DATA'] >>> '/usr/share/gdal'
but no trace of a gcs.csv file.
- I work in a shared environment and I cannot afford to just rebuild everything from scratch.
- The gdal CLI is also installed in this environment and looking at the documentation I think they are not compatible.
- I tried to start my file by
import os if 'GDAL_DATA' in list(os.environ.keys()): del os.environ['GDAL_DATA'] if 'PROJ_LIB' in list(os.environ.keys()): del os.environ['PROJ_LIB']
but it doesn't change anything
How can I use the rasterio.crs module?
Where should be pointing the GDAL_DATA?
Is it a real error or just hiding something else?
Python==3.6.9 rasterio==1.1.8 pyproj==2.6.1 GDAL==3.0.4