Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to upgrade proj4 for rgdal

Tags:

r

ubuntu

gdal

proj

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!

like image 606
Pascal Avatar asked Oct 31 '22 16:10

Pascal


1 Answers

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

like image 128
Pascal Avatar answered Nov 02 '22 05:11

Pascal