rgdal - read a table within a ESRI geodatabase (gdb)

僤鯓⒐⒋嵵緔 提交于 2019-12-23 03:56:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!