Get data in R from an ESRI v10 Geodatabase
Asked Answered
P

3

5

Does anyone know of a method to get (raster) data out of an ESRI v10 File Geodatabase in R?

ESRI offers a C++ API (for Linux and Windows), so I guess in principle it should be possible for an R package to retrieve (and write) data to a Geodatabase. I could not find any packages capable of doing this though.

Paragon answered 10/12, 2012 at 18:12 Comment(0)
F
3

Apparently rgdal now supports file geodatabase read access:

library(rgdal)
subset(ogrDrivers(), grepl("GDB", name))
ogrListLayers("/path/to/folder.gdb")

Worked for me on Windows, R v3.2.0, rgdal v0.9-3.

Frictional answered 1/6, 2015 at 18:57 Comment(3)
I get no hits for grep("GDB", ogrDrivers()$name, ignore.case=TRUE)Worley
@Adrian, very strange---I use this all the time. Your code returns 34 (the row number of ogrDrivers() with name = "OpenFileGDB") for me.Frictional
I'm on ubuntu with R version 3.3.0 (2016-05-03), and I have a fresh vanilla install of install.packages("rgdal"). Maybe I have to install that driver separately?Worley
A
2

A quick google led me to the following page:

http://www.gdal.org/ogr/drv_filegdb.html

Which suggest gdal supports file geodatabase. Probably, R then also supports the format through a properly built rgdalpackage. In essence, if the standalone gdal has support, the rgdal package built against that should also read the file geodatabase.

Anion answered 10/12, 2012 at 19:17 Comment(4)
rgdal doesn't support reading from or writing to file geodatabases -- at least not in its 'out-of-the-box' form. (I just did library(rgdal); ogrDrivers() on my Windows box, and there is no entry there for FileGDB; there is one for (reading from) personal geodatabases.) Roger Bivand touches on the issue here and the relevant entry on this page indicates that even in plain old gdal, support for File Geodatabases is not compiled by default.Hillier
(I would, though, be very interested to learn whether/how a file geodatabase-supporting version of rgdal could be compiled on a box that has the required ESRI-side API...)Hillier
I would also be interested.Anion
The link looks to be dead.Sibyls
R
2

GDAL does not have the ability to read a raster from a File GeoDatabase.

It can read vector feature classes, however. This makes me confident that rgdal also does not support reading raster layers. In fact, ESRI's own FileGDB API does not have raster support.

Unfortunately, this means that you will need to use ESRI tools to export your raster layers to a format that you can use in R. Hopefully there will soon be an open source solution for accessing ESRI GDBs.

Rizzo answered 18/6, 2015 at 16:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.