Installing RGDAL on a mac

1 view
Skip to first unread message

Adam Wilson

unread,
Oct 10, 2008, 11:07:34 AM10/10/08
to UConn UseRs
Greetings all,

Sorry for the late notice, but for those of you on Macs, Natalia and I wanted to send around more detailed instructions on how to get rgdal working.  We just got it to work on her computer (OS 10.4).  The instructions I posted before are correct, but lack some detail. 

  1. Go to  http://www.kyngchaos.com/wiki/software:frameworks and download and install the following frameworks:

    UnixImageIO, GEOS 3, SQLite3, PROJ, and GDAL

  2. Download the RGDAL source file from http://cran.r-project.org/src/contrib/rgdal_0.5-26.tar.gz and put it on your desktop

  3. POTENTIALLY OPTIONAL:  you may need to run the following command in a terminal, but I don't think it's necessary.  Try step 4, and if it fails, run the following command first, and then return to step 4. The path should point to the GDAL framework you just installed.  This command adds the GDAL framework you just installed to the system path, which tells your computer where to look for things. 

    PATH=$PATH\:/Library/Frameworks/GDAL.framework

  4. Open a terminal (not R, a system terminal) and run the following (after confirming that all the paths listed below are correct by browsing to them and looking for those files/folders):

    R CMD INSTALL ~/Desktop/rgdal_0.5-26.tar.gz --configure-args="
    --with-gdal-config=/Library/Frameworks/GDAL.framework/Versions/1.5/Programs/gdal-config
    --with-proj-include=/Library/Frameworks/PROJ.framework/Versions/4.6/Headers
    --with-proj-lib=/Library/Frameworks/PROJ.framework/Versions/4.6/unix/lib"

  5. open R and run

    library(rgdal)
    library(sp)
    library(maptools)
    library(spatstat)

  6. If you get any errors, you may need to install other packages.  Natalia needed gpclib and deldir packages.  If so, use the package manger to install those packages as well.
This may seem like a colossal pain, but in effect you are gaining the functionality of a GIS that is easily comparable to and more flexible than ArcGIS.  What the ESRI folks have done is put a wrapper around ideas that are fairly easy to implement in environments like R, created some arguably user-friendly dialog boxes, and charge $600+ a seat for it. 

Good luck!   See you in class.


Adam






--
Adam Wilson
http://hydrodictyon.eeb.uconn.edu/people/wilson/
Department of Ecology and Evolutionary Biology
BioPharm 223
University of Connecticut
Tel: 860.486.4157
Adam....@UConn.edu
Reply all
Reply to author
Forward
0 new messages