0

I'm using geemap to display a raster on a created map. This lib use xarray_leaflet to display the raster and this lib will end up using rasterio to manipulate the .tif file.

When I launch my display :

m = geemap.Map()
m.add_raster(clip_map, colormap='terrain', layer_name='gfc')

I get the following error :

CRSError: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.

This error is everywhere on SO so I tried to verify if my GDAL_DATA env variable was coorectly set :

import os
import stat
gdal_data = os.environ['GDAL_DATA']
print('is dir: ' + str(os.path.isdir(gdal_data)))
gcs_csv = os.path.join(gdal_data, 'gcs.csv')
print('is file: ' + str(os.path.isfile(gcs_csv)))
st = os.stat(gcs_csv)
print('is readable: ' + str(bool(st.st_mode & stat.S_IRGRP)))

# out 
# is dir: True
#is file: False
#FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/gdal/gcs.csv'

going to the glad distrib inb the NEWS file, I read that they removed lots of file in 3.0 including gcs.csv. So it's no longer included in my folder.

Is there a workaround ?

Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47
  • Try adding a 'PROJ_LIB' environment variable pointing to the location of the proj library. This worked for me with that same error – leelum1 Aug 03 '20 at 02:33
  • The CLI of GDAL is also installed on this machine and it created the PROJ_LIB and GDAL_DATA env variable. If I change it it's not gonna work annymore in all the R scripts that we are using. – Pierrick Rambaud Aug 25 '20 at 07:07

0 Answers0