5

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!

Pascal
  • 1,590
  • 2
  • 16
  • 35
  • 1
    Main Ubuntu repo is woefully old. Even UbuntuGIS only has up to 4.8.0-4. But, https://launchpad.net/ubuntu/+source/proj has 4.9.2 – hrbrmstr Oct 28 '15 at 01:45
  • If you are not afraid by compilation, I would compile `proj4` and install it in `/usr/local`. –  Oct 28 '15 at 03:43

2 Answers2

2

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

Pascal
  • 1,590
  • 2
  • 16
  • 35
  • If you face problems when compiling from source, here is a nice tutorial: https://docs.djangoproject.com/en/1.10/ref/contrib/gis/install/geolibs/ – pat-s Jan 16 '17 at 19:58
0

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.

Dieter
  • 2,499
  • 1
  • 23
  • 41