2

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!

brunj7
  • 149
  • 1
  • 8
  • In one instance you used a full file name and in the other you used what might be seen with a Windows or Mac file browser that didn't display extensions. In the absence of an actual data example there's not much more that can be offered. Why not use a dataset from the web or from the 'data' folder if one exists in either `rgdal` or one of the other commonly used spatial packages? – IRTFM Apr 20 '16 at 01:09
  • Answered here: http://gis.stackexchange.com/questions/184013/read-a-table-from-an-esri-file-geodatabase-gdb-using-r – Benjamin Feb 09 '17 at 02:29

0 Answers0