如何将GDAL_DATA环境变量设置为指向包含EPSG csv文件的目录? [英] How to set the GDAL_DATA environment variable to point to the directory containing EPSG csv files?

查看:564
本文介绍了如何将GDAL_DATA环境变量设置为指向包含EPSG csv文件的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在这个netcdf文件中包装(重新投影)一个变量.

I want to wrap(re-project) one variable in this netcdf file.

D:\ gdalwarp -t_srs EPSG:4326 NETCDF:"C:\fie.nc":var "C:\Desktop\SM.img"

但是我得到这个错误:

错误4:无法打开EPSG支持文件gcs.csv.尝试将GDAL_DATA环境变量设置为指向包含EPSG csv文件的目录.

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

错误1:转换源或目标SRS失败:EPSG:4326

ERROR 1: Translating source or target SRS failed: EPSG:4326

我正在使用2011年12月29日发行的GDAL 1.9.0.我将不胜感激.

I am using GDAL 1.9.0, released 2011/12/29. I will be grateful for any help.

推荐答案

您可以在Windows中以图形方式编辑环境变量(例如,,或).

You can edit the environment variables graphically in Windows (e.g., this, or this).

添加一个名称为GDAL_DATA的系统变量,并提供共享GDAL数据的路径值(一个包含多个文件的文件夹,例如coordinate_axis.csvgcs.csvpcs.csv和其他文件).

Add a System variable with name GDAL_DATA and value of the path to the shared GDAL data (a folder with a several files, like coordinate_axis.csv, gcs.csv, pcs.csv, and other files).

要使环境变量有效,您需要运行cmd.exe或注销或其他方法.

To make the environment variable effective, you need to run cmd.exe, or log-out, or other method.

另请参见: http://trac.osgeo.org/gdal/wiki/FAQInstallationAndBuilding #HowtosetGDAL_DATAvariable

GDAL库和命令行工具可通过(例如)conda install gdal

GDAL library and command-line tools are available via (e.g.) conda install gdal

激活环境后,将正确设置GDAL_DATA变量.如果启动Anaconda Prompt,将为您完成此操作,否则,您可以激活记录的环境.

The GDAL_DATA variable is properly set when the environment is activated. This is done for you if you start an Anaconda Prompt, otherwise you can activate the environment as documented.

这篇关于如何将GDAL_DATA环境变量设置为指向包含EPSG csv文件的目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆