如何为 rgdal 升级 proj4

how to upgrade proj4 for rgdal

我广泛使用 R 包 rgdal 和 rgeos(目前使用 R v3.2.2)。最近,在我的 ubuntu machine (ubuntu v15.10) 上,当我加载 rgdal 包时,我看到以下内容:

> 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 

我在 recent r-sig-geo posting 上看到这是一个已知问题,并且已经发布了 rgdal 包的更新来解决这个问题。然而,尽管重新安装了 rgdal 包,但重新安装了 gdal 和 proj4 如下:

sudo apt-get update && sudo apt-get install libgdal-dev libproj-dev

我看不出有什么不同。当我使用这些包的功能时,这个问题会产生数百条警告信息。

相比之下,在我的 mac 上,如果我加载 rgdal 包,我会看到

> 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 machine。

有人知道我如何获得更新吗?

谢谢!

我最终通过克隆各自的 github 存储库从源代码编译了 proj4 和 gdal。

https://github.com/OSGeo/proj.4

https://github.com/OSGeo/gdal

在 ubuntu 上安装 rgdal 应该可以(2 个月前在 amazone 网络服务器上完成)。是的,我收到了错误,但我可以通过添加一个包含额外文件的文件夹来修复它,这些文件在安装 RGDAL 期间没有安装。