rasterio 正在寻找 gdal 中不再存在的 gcs.csv
rasterio is looking for gcs.csv which does not exist in gdal anymore
描述
我正在使用 geemap 在创建的地图上显示栅格。
此库使用 xarray_leaflet
显示光栅,此库最终将使用 rasterio
来操作 .tif 文件。
当我启动显示器时:
m = geemap.Map()
m.add_raster(clip_map, colormap='terrain', layer_name='gfc')
我收到以下错误:
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.
这个错误在 SO 上无处不在,所以我试图验证我的 GDAL_DATA env 变量是否正确设置:
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'
很高兴地分发了 NEWS
文件,我读到他们在 3.0 中删除了很多文件,包括 gcs.csv
。所以它不再包含在我的文件夹中。
有解决办法吗?
设置
rasterio==1.1.5
python==3.6
geemap==0.7.9
gdal==3.0.4
这是 rasterio 的一个已知问题(例如在 conda 中)
答案在
- Where is “ERROR 4: Unable to open EPSG support file gcs.csv” coming from and what does it mean?
- How to set the GDAL_DATA environment variable to point to the directory containing EPSG csv files?
- ERROR 4: Unable to open EPSG support file gcs.csv
- Unable to open EPSG support file gcs.csv #1539
- Missing gcs.csv file
还有更多。
尝试将 GDAL_DATA 环境设置为包含 gcs.csv 文件的路径(使用搜索查找路径)
os.environ['GDAL_DATA'] = '.../site-packages/rasterio/gdal_data'
或
os.environ['GDAL_DATA'] = '..../site-packages/fiona/gdal_data'
感谢 @gene 的回答
描述
我正在使用 geemap 在创建的地图上显示栅格。
此库使用 xarray_leaflet
显示光栅,此库最终将使用 rasterio
来操作 .tif 文件。
当我启动显示器时:
m = geemap.Map()
m.add_raster(clip_map, colormap='terrain', layer_name='gfc')
我收到以下错误:
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.
这个错误在 SO 上无处不在,所以我试图验证我的 GDAL_DATA env 变量是否正确设置:
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'
很高兴地分发了 NEWS
文件,我读到他们在 3.0 中删除了很多文件,包括 gcs.csv
。所以它不再包含在我的文件夹中。
有解决办法吗?
设置
rasterio==1.1.5
python==3.6
geemap==0.7.9
gdal==3.0.4
这是 rasterio 的一个已知问题(例如在 conda 中)
答案在
- Where is “ERROR 4: Unable to open EPSG support file gcs.csv” coming from and what does it mean?
- How to set the GDAL_DATA environment variable to point to the directory containing EPSG csv files?
- ERROR 4: Unable to open EPSG support file gcs.csv
- Unable to open EPSG support file gcs.csv #1539
- Missing gcs.csv file
还有更多。
尝试将 GDAL_DATA 环境设置为包含 gcs.csv 文件的路径(使用搜索查找路径)
os.environ['GDAL_DATA'] = '.../site-packages/rasterio/gdal_data'
或
os.environ['GDAL_DATA'] = '..../site-packages/fiona/gdal_data'
感谢 @gene 的回答