我想将ArcGIS shapefile转换为Splus/ArcInfo/Epimap格式,以便我可以将邻接矩阵和地图输入WinBUGS。 WinBUGS 无法直接读取 ArcGIS shapefile。我如何使用 R 或任何软件来做到这一点?
我终于找到了解决方案
install.packages("maptools", repos ="https://packagemanager.posit.co/cran/2023-10-13")
library(maptools)
library(sp)
usa_counties <- readShapePoly("E:\\USA_Counties.shp", IDvar =
"CNTY_FIPS")
# Convert to WinBUGS S-Plus format
splus_data <- sp2WB(as(usa_counties, "SpatialPolygons"), filename
= "E:\\USA_Counties.txt")