5
使用R从ESRI文件地理数据库(.gdb)读取表
我试图将一个表直接从ESRI文件地理数据库读取到R中。可以在此处下载示例数据文件。该数据库包含一个点要素类(Zone9_2014_01_Broadcast)和两个链接表(Zone9_2014_01_Vessel和Zone9_2014_01_Voyage)。你可以阅读使用R中的shape文件readOGR从rgeos包: library(rgeos) library(downloader) download("https://coast.noaa.gov/htdata/CMSP/AISDataHandler/2014/01/Zone9_2014_01.zip", dest="Zone9_2014_01.zip", mode="wb") unzip("Zone9_2014_01.zip", exdir = ".") # Not Run (loads large point file) # broadcast <- readOGR(dsn = "Zone9_2014_01.gdb", layer = "Zone9_2014_01_Broadcast") 当使用ogrListLayers或时,两个链接的表也会显示ogrInfo。但是,ogrInfo给出警告: 警告消息:在ogrInfo(“ Zone9_2014_01.gdb”,layer =“ Zone9_2014_01_Vessel”)中:ogrInfo:所有功能均为NULL 而且,如果您尝试readOGR在表格上使用,则会出现错误: vessel <- readOGR(dsn = "Zone9_2014_01.gdb", layer = "Zone9_2014_01_Vessel") readOGR(dsn =“ Zone9_2014_01.gdb”,layer =“ Zone9_2014_01_Vessel”)中的错误:未找到功能另外:警告消息:在ogrInfo(dsn = dsn,layer =图层,编码=编码,use_iconv = use_iconv …