问题
I am trying to read a table from a ESRI geodatabase (.gdb) that has no geometry using R. readOGR is throwing an error because there is no geometry defined, which kind of make sense:
library(rgdal)
readOGR("gSSURGO_CO.gdb","mutext")
#Error in readOGR("gSSURGO_CO.gdb", "mutext") : no features found
#In addition: Warning message:
#In ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, :
#ogrInfo: all features NULL
My current solution is to access directly GDAL and dump a cvs of the table that I read back into R:
# Here example with the same layer
system("ogr2ogr -f CSV mutext.csv gSSURGO_CO.gdb mutext")
mutext <- read.csv("mutext.csv")
It works, but is there a better way to do this?
Thanks!
来源:https://stackoverflow.com/questions/36732055/rgdal-read-a-table-within-a-esri-geodatabase-gdb