Installing the R Windows binary rgdal package

In order to install the R Windows binary rgdal package, you should first have installed GDAL/OGR with all of their dependencies needed for the data you need to access. 

One way is to build PROJ.4, GDAL, and any extra libraries you require with MSYS and MinGW, ideally the same MinGW as is used to build R. In both cases configure, make, make install. Note the installation prefix and exit MSYS. Set an environment variable GDAL_HOME to that value in your R build console (Windows command line interface) --- the value will be passed through and used to access header files, libraries, and to copy across a DLL.

The MSYS build used here was proj 4.4.9 without jni, GDAL 1.3.1, no external libraries.

--------------------------------

Alternative build approach:


Installing FWTools is a convenient way to get started (but will be limited to the - extensive - range of drivers built into the binary package):

http://fwtools.maptools.org/

http://fwtools.maptools.org/windows-main.html

Setting the FWTools bin/ directory in the PATH environmental variable is essential, (GDAL_DATA is set internally to the copy included in the rgdal package).

The R Windows binary rgdal package can built against an FWTools Windows binary, using VC++.

Notes:

Building rgdal.dll in rgdal/src:

Makefile.win with just all: on a single line.

cl /MT /Ox /EHsc /D "WIN32" /c /I E:\rsb\R\R-2.2.1pat\include /I C:\Programfiler\FWTools1.0.0a7\include *.cpp

link /dll /out:rgdal.dll /def:RGDAL.def gdal-bindings.obj ogr_geom.obj ogr_proj.obj ogrsource.obj E:\rsb\R\R-2.2.1pat\lib\Rdll.lib /libpath:"C:\Programfiler\FWTools1.0.0a7\lib" gdal_i.lib

for RSBs locations of current R and FWTools
