The ID_2 column for the first two polygons is duplicated #You'll see in the first two rows ID_2 is duplicated Sptemp <- readOGR(dsn="gadmETH", layer="ETH_adm2") Unzip(paste0("gadmETH.zip"), exdir="gadmETH", overwrite=FALSE) the polygons are merged too.ĭownload, unzip, and load into R GADM file for Ethiopia level 2 (899kb to working directory): library(curl) A plot of sptemp would bring up where current sptemp and sptemp2 without the boundaries between the duplicated, i.e. I'd like sptemp with 79 features combining the first two rows that are the ones with duplicated ID_2. How do I get the below shapefile with duplicated ID_2 to merge to a single polygon in sptemp?Įxample below of GADM level 2 of Ethiopia has first two rows of the shapefile ID_2 column duplicated (value=1). Rbind and union just combine the rows of the shapefile features, they don't actually merge the polygons themselves. How do I merge polygon features in a shapefile with many polygons?
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |