how to upgrade proj4 for rgdal

为君一笑 提交于 2019-12-23 09:47:36

问题


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 

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.

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 

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?

Thanks!


回答1:


I ended up compiling both proj4 and gdal from source, by cloning the respective github repositories.

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

https://github.com/OSGeo/gdal




回答2:


Installing rgdal on ubuntu should work (have done it, 2 months ago, on the amazone webservers). And yes, I received errors, but i could fix it by adding a folder with extra files, which didn't were installed during the installation of RGDAL.



来源:https://stackoverflow.com/questions/33381421/how-to-upgrade-proj4-for-rgdal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!