无法在R中合并shapefile

时间:2016-06-01 20:44:08

标签: r rgdal maptools

我在R中合并shapefile时遇到了问题。到目前为止,这是我的代码:

library(rgdal)
library(maptools)
library(gridExtra)

setwd("/Users/Cornelius/Dropbox/Cornelius_Sharedfolder")

#Load a geodatabase
fgdb = "/Users/Cornelius/Dropbox/Cornelius_Sharedfolder/RwandaGDB.gdb"

subset(ogrDrivers(), grepl("GDB", name))
fc_list = ogrListLayers(fgdb)
print(fc_list)

#Get the shapefiles from the geodatabase:
Residence=readOGR(dsn=fgdb, layer="Résidence")
Territoire = readOGR(dsn=fgdb,layer="Territoire")
Chefferie=readOGR(ds=fgdb, layer="Chefferie")
Sous_Chefferie=readOGR(ds=fgdb, layer="Sous_Chefferie")
RwandaPre2002=readOGR(ds=fgdb, layer="RwandaPre2002")
Country_Boundary2012=readOGR(ds=fgdb, layer="Country_Boundary2012")
Province_Boundary2012=readOGR(ds=fgdb, layer="Province_Boundary2012")
Sector_Boundary2012=readOGR(ds=fgdb, layer="Sector_Boundary2012")
District_Boundary2012=readOGR(ds=fgdb, layer="District_Boundary2012")
Cell_Boundary2012=readOGR(ds=fgdb, layer="Cell_Boundary2012")

x = list(Residence, Territoire, Sous_Chefferie, RwandaPre2002, Country_Boundary2012, Province_Boundary2012, Sector_Boundary2012, District_Boundary2012, Cell_Boundary2012)}

这一切都很顺利。但是,当我尝试合并两个shapefile时 - 例如,Residence和Territoire,并使用以下代码,它会给我一个错误:

test_bind <-spRbind(Territoire, Residence)

错误说明:&#34;非唯一的多边形ID。&#34;

我不确定这意味着什么。能否请你帮忙?

0 个答案:

没有答案