How can I import a raster file from a gdb into R?
Name of raster file: Cont_maturite in gdb : CAROPER_04151.gdb
In wd: c:\test\caroper
How can I import a raster file from a gdb into R?
Name of raster file: Cont_maturite in gdb : CAROPER_04151.gdb
In wd: c:\test\caroper
R spatial packages all depend on GDAL for file read/write, and GDAL uses the OpenFileGDB driver, which can only read vector data sources at this time - see https://www.gdal.org/drv_openfilegdb.html. The driver provides no write access at all.
If you have a recent version of ArcMap (>=10.3.1) or ArcGis Pro (1.1) installed, you can use the R package arcgisbinding
to connect to ESRI proprietary data sources. This allows read/write access to anything in a File Geodatabase, plus SDE connections, as well as conversion from ESRI's own take on R spatial objects to and from sf
, sp
, and raster
style objects. See https://github.com/R-ArcGIS/r-bridge.
library(arcgisbindings); arc.check_product(); raster <- as.raster(arc.raster(arc.open("path/to/geodatabase.gdb/rasterlayername")))
arcgisbinding
from github. Download it at github.com/R-ArcGIS/r-bridge/releases/tag/v1.0.1.232. Do not unzip - save it in a folder, then install the package in Rstudio using the menu "Tools", "Install packages", and choose the downloaded package archive you just saved. Go to @obrl_soil's second link to install in arc.