This issue has been discussed few times and any of the read posts have not been the ultimate answer for my case:
I'm trying to load data from a PostGIS database into the R Console. While many packages in R are suitable for it, it seems to be that only rgdal is able to implement directly spatial capabilities.
The bad new is (as mentioned in many posts) the installation of rgdal from CRAN in windows does not include the driver PostgreSQL (the driver is not listed by the command ogrDrivers()
in the R Console).
I loaded the source for rgdal from the CRAN site to build the package myself as recommended in some posts but I always get an error message:
OGR_write.cpp:1:24: fatal error: cpl_string.h: No such file or directory
The same error appears when trying to install the package from GitHub:
library(devtools)
install_github("cran/rgdal")
Is there a way or a guide (for dummies) that can help me getting the PostgreSQL driver enabled in rgdal?
Further information that may be required to answer this question:
- My operative System: Windows 7 64-bit
- R-3.3.3 installed at C:\Program Files\R\R-3.3.3
- GDAL-2.0.1 installed at C:\Program Files\GDAL
- FWTools-2.2.8 installed at C:\Program Files (x86)\FWTools2.2.8
- Rtools-34 installed at C:\Rtools