I have been having problems with vectorial spatial data for some time, mostly important to plot SpatialPolygonDataFrames (I asked here: Slow plotting SpatialPolygonDataFrames on some systems). This happens to me in a Macos laptop (MacBook Pro (Retina, 13-inch, Late 2013) with macOS Sierra 10.12.4 (16E195).
Trying to solve it, I updated all libraries related to spatial data, among them GDAL and PROJ. After reinstalling rdgal, I have noticed that when I load the library, the wrong version of PROJ.4 is loaded:
> library(rgdal) rgdal: version: 1.2-7, (SVN revision 660) Geospatial Data Abstraction Library extensions to R successfully loaded Loaded GDAL runtime: GDAL 2.1.2, released 2016/10/24 Path to GDAL shared files: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgdal/gdal Loaded PROJ.4 runtime: Rel. 4.9.1, 04 March 2015, [PJ_VERSION: 491] Path to PROJ.4 shared files: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgdal/proj Linking to sp version: 1.2-4
I am sure I have installed the version 4.9.2, and it must be properly set in PATH because if I run the command
proj on the terminal I get:
MacBook-Pro:~ javierfajnolla$ proj Rel. 4.9.2, 08 September 2015 usage: proj [ -beEfiIlormsStTvVwW [args] ] [ +opts[=arg] ] [ files ]
The version 4.9.1 is known to have some problems (although I totally do not know if my problems are at all related to those... I'm just desperate for a solution), so I think I should update it. But I have failed trying to make rgdal read the right version of it.
Does anyone know a way to do this?
EDIT: I still do not have a way to solve this issue, but I have some additional information:
If the plots are done in R, not RStudio, it is faster. Not as fast as in other OS, but still better. It seems that the plotting device built in RStudio is quite slow.
There is a workaround related with the previous point. It is possible to use a different plotting device that RStudio's, and that makes it much faster. You can open
png(), make the plot and close the connection
dev.off()and you will get a file with the plot inside. Not ideal, but certainly working.