Halley Brantley
2014-Mar-06 20:03 UTC
[R] Error importing data from a personal geodatabase
I am trying to import data from a personal geodatabse into R. This code worked previously, but I recently upgraded to Windows 7 and R 3.0.1 and it no longer works. The error message is "Cannot open data source". Why am I getting this error? Code and session info below. Thanks for the help.> # Set working directory > directory <- "C:\\Users\\HBrantle\\Current_Projects\\ARYS" > analysis.dir <- file.path(directory,"Data_Analysis") > data.dir <- file.path(analysis.dir, "Data") > gis.dir <- file.path(directory, "ARYS_GIS", "Data") > # List feature classes in the ARYS geodatabase > features <- ogrListLayers(dsn= file.path(gis.dir, "ARYS.mdb"))Error in ogrListLayers(dsn = file.path(gis.dir, "ARYS.mdb")) : Cannot open data source> run <- readOGR(dsn= file.path(gis.dir, "ARYS.mdb"), features[1])Error in nchar(layer) : object 'features' not found> file.info(file.path(gis.dir, "ARYS.mdb"))size isdir mode mtime C:\\Users\\HBrantle\\Current_Projects\\ARYS/ARYS_GIS/Data/ARYS.mdb 195461120 FALSE 666 2014-03-06 11:02:25 ctime atime exe C:\\Users\\HBrantle\\Current_Projects\\ARYS/ARYS_GIS/Data/ARYS.mdb 2014-03-05 18:44:53 2014-03-06 11:01:21 no> ogrDrivers()name write 1 AeronavFAA FALSE 2 ARCGEN FALSE 3 AVCBin FALSE 4 AVCE00 FALSE 5 BNA TRUE 6 CSV TRUE 7 DGN TRUE 8 DXF TRUE 9 EDIGEO FALSE 10 ESRI Shapefile TRUE 11 Geoconcept TRUE 12 GeoJSON TRUE 13 Geomedia FALSE 14 GeoRSS TRUE 15 GML TRUE 16 GMT TRUE 17 GPSBabel TRUE 18 GPSTrackMaker TRUE 19 GPX TRUE 20 HTF FALSE 21 Idrisi FALSE 22 KML TRUE 23 MapInfo File TRUE 24 Memory TRUE 25 MSSQLSpatial TRUE 26 ODBC TRUE 27 ODS TRUE 28 OpenAir FALSE 29 PCIDSK TRUE 30 PDF TRUE 31 PDS FALSE 32 PGDump TRUE 33 PGeo FALSE 34 REC FALSE 35 S57 TRUE 36 SDTS FALSE 37 SEGUKOOA FALSE 38 SEGY FALSE 39 SUA FALSE 40 SVG FALSE 41 TIGER TRUE 42 UK .NTF FALSE 43 VRT FALSE 44 XLSX TRUE 45 XPlane FALSE> sessionInfo()R version 3.0.1 (2013-05-16) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] rgdal_0.8-16 sp_1.0-14 loaded via a namespace (and not attached): [1] grid_3.0.1 lattice_0.20-15 tools_3.0.1 [[alternative HTML version deleted]]