r - 如何为 rgdal 升级 proj4

标签 r ubuntu gdal proj

我广泛使用 R 包 rgdal 和 rgeos(目前使用 R v3.2.2)。最近,在我的 ubuntu 机器(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 机器。

有没有人知道如何获取更新?

谢谢!

最佳答案

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

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

https://github.com/OSGeo/gdal

关于r - 如何为 rgdal 升级 proj4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33381421/

相关文章:

r - fileInput 中进度条的颜色 -- Shiny

Python 看不到使用 apt-get 安装的模块

bash - 在 shell 脚本中使用 grep 会出现找不到文件的错误

ubuntu - Vim新手: Mapping kj key to <Esc> not working in gnome terminal

r - 安装 rgdal 时遇到问题

rCharts morris 标题和轴标签

r - R包中的源文件

r - 将函数应用于矩阵或数据框的每一行

compression - 使用 gdal_translate 将 Geotiff 转换为 NetCDF : Huge increase in filesize

python - 带有 gdal、ogr 等的 python 中带有 shapefile 的 GTiff 掩码