【问题标题】:Combining SpatialPolygonsDataFrame of two neighbour countries结合两个邻国的 SpatialPolygonsDataFrame
【发布时间】:2019-03-31 19:38:43
【问题描述】:

我想结合巴基斯坦和印度等两个邻国的SpatialPolygonsDataFrame。我的 MWE 如下:

library(raster)
Pakistan.adm1.spdf <- 
  getData(
    "GADM"
    , country = "Pakistan"
    , level = 1
  )

India.adm1.spdf <- 
  getData(
    "GADM"
    , country = "India"
    , level = 1
  )

如何组合这两个 shapefile?

【问题讨论】:

  • 请注意:它们不是 shapefile,而是“SpatialPolygonsDataFrame”。它们以 .RData 格式提供。
  • 试试rbind(Pakistan.adm1.spdf, India.adm1.spdf, makeUniqueIDs = TRUE)source

标签: r spatial raster shapefile


【解决方案1】:

the answerthis question,使用rbind 和参数makeUniqueIDs

adm1.spdf <- rbind(Pakistan.adm1.spdf, India.adm1.spdf, makeUniqueIDs = TRUE)
plot(adm1.spdf)

【讨论】:

    猜你喜欢
    • 2017-03-30
    • 1970-01-01
    • 2018-10-15
    • 2017-10-16
    • 2017-02-17
    • 1970-01-01
    • 2014-10-16
    • 2010-09-09
    • 2010-11-18
    相关资源
    最近更新 更多