问题描述
我广泛使用R包rgdal和rgeos(当前使用R v3.2.2).最近,在我的ubuntu机器(ubuntu v15.10)上,当我加载rgdal软件包时,我看到以下内容:
I use the R packages rgdal and rgeos extensively (currently with R v3.2.2). Recently, on my ubuntu machine (ubuntu v15.10), when I load the rgdal package, I see the following:
> library(rgdal)
Loading required package: sp
rgdal: version: 1.0-7, (SVN revision 559)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.11.1, released 2014/09/24
Path to GDAL shared files: /usr/local/share/gdal
Loaded PROJ.4 runtime: Rel. 4.9.1, 04 March 2015, [PJ_VERSION: 491]
Path to PROJ.4 shared files: (autodetected)
WARNING: no proj_defs.dat in PROJ.4 shared files
Linking to sp version: 1.2-1
我在最近的r-sig-geo上看到了发布,这是一个已知问题,并且已发布rgdal软件包的更新程序以解决此问题.但是,尽管重新安装了rgdal软件包,但使用以下命令重新安装了gdal和proj4:
I have seen on a recent r-sig-geo posting that this is a known issue, and that an update to the rgdal package has been released to fix this issue. However, despite reinstalling the rgdal package, reinstalling gdal and proj4 with the following:
sudo apt-get update && sudo apt-get install libgdal-dev libproj-dev
我没什么区别.当我使用这些软件包的功能时,此问题会生成数百条警告消息.
I see no difference. This problem generates hundreds of warning messages when I use the functions of these packages.
相比之下,在我的Mac上,如果加载了rgdal程序包,我会看到
In comparison, on my mac, if I load the rgdal package, I see
> library(rgdal)
Loading required package: sp
rgdal: version: 1.0-7, (SVN revision 559)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.11.3, released 2015/09/16
Path to GDAL shared files: /usr/local/Cellar/gdal/1.11.3/share/gdal
Loaded PROJ.4 runtime: Rel. 4.9.2, 08 September 2015, [PJ_VERSION: 491]
Path to PROJ.4 shared files: (autodetected)
Linking to sp version: 1.2-0
因此,显然有gdal和proj.4的更新没有被添加到我的linux机器上.
So there are clearly updates to gdal and proj.4 that are not making it onto my linux machine.
有人对我如何获得更新有任何想法吗?
Does anybody have any ideas how I can get the updates?
谢谢!
推荐答案
我最终通过克隆相应的github存储库,从源代码同时编译了proj4和gdal.
I ended up compiling both proj4 and gdal from source, by cloning the respective github repositories.
https://github.com/OSGeo/proj.4
这篇关于如何为rgdal升级proj4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!