In R, how do we get a file list of rasters in a geodatabase folder?
We know the case of vector layers as follow.
library(rgdal)
fgdb = "C:/path/to/your/filegeodatabase.gdb"
subset(ogrDrivers(), grepl("GDB", name))
fc_list = ogrListLayers(fgdb)
However, for raster layers, if only we know the raster layer name, we can read it by specifying the layer name as follow.
library(arcgisbinding)
arc.check_product()
a <- as.raster(arc.raster(arc.open(paste(fgdb,"/rasterlayername", sep=""))))
For more effective reading, I want to get the raster layers name list like the vectors layers case. How to do it??
RasList <- arc.open(fgdb)@children$RasterDataset
a <- NULL
for(i in 1:length(RasList)){
a[[i]] <- as.raster(arc.raster(arc.open(paste(fgdb,"/",RasList[i], sep=""))))
}