[R-sig-Geo] Building Windows binary of rgdal package to include PGeo driver for reading ESRI personal geodatabases.
Obrien, Josh
JObrien at ucdavis.edu
Wed Feb 1 21:04:08 CET 2012
>> On Tue, 31 Jan 2012, Obrien, Josh wrote:
>> I am a long-time R user, currently working with a team of ArcGIS users.
>> The GIS guys would like to be able pass me data in the form of ESRI
>> personal geodatabases (*.mdb), but the OGR driver that reads such files
>> (PGeo) is not included in the Windows rgdal binary.
>>
>> Roger Bivand's 2008 book (p 111) and the "README.windows" file located
>> in rgdal's main directory both have the same advice for me. They tell me
>> that "the R Windows binary rgdal package can be built against an FWTools
>> binary, using VC++."
> Josh,
>
> Could you please try to install R-devel for Windows:
>
> http://cran.r-project.org/bin/windows/base/rdevel.html
>
> and install the CRAN binary of rgdal? Prof. Brian Ripley and Uwe Ligges
> have been continuing their excellent support for us and the whole
> community, and as part of build train enhancements for forthcoming 2.15 on
> Windows, have built GDAL with more dependencies, including ODBC. For me on
> R-devel, ogrDrivers() now shows:
>
> 23 MapInfo File TRUE
> 24 Memory TRUE
> 25 MSSQLSpatial TRUE
> 26 ODBC TRUE
> 27 OpenAir FALSE
> 28 PCIDSK TRUE
> 29 PDS FALSE
> 30 PGDump TRUE
> 31 PGeo FALSE
>
> where FALSE means that the driver cannot write Pgeo files. It would be
> helpful if you could try it out, which may well mean finding out how to
> declare the Pgeo data source through ODBC or some such.
>
> If you can find out how to use the driver, it may be simpler to go with
> 2.15 as Devel will become, most likely in April 2012, than try to build
> using FWTools or OSGeo4W.
>
> Hope this helps,
>
> Roger
Dear Professor Bivand,
That's phenomenally helpful.
For the record, after installing R-devel (soon to be R-2.15.0) from http://cran.r-project.org/bin/windows/base/rdevel.html, the following steps were the only ones needed to read data from an ESRI personal geodatabase into an R SpatialPointsDataFrame. (The table to be read is named "TelemetryPoints", and is stored in the personal geodatabase at "C://temp/example.mdb"):
install.packages("rgdal")
library(rgdal)
ogrDrivers() # Confirming that the PGeo driver was indeed installed
SPDF <- readOGR("C://temp/example.mdb", "Telemetry points")
Thanks so much for your help,
Josh O'Brien
P.S. Not sure I yet have the hang of properly quoting the context from previous emails in the thread.
More information about the R-sig-Geo
mailing list