【问题标题】:Problem trying to use st_remove_holes function尝试使用 st_remove_holes 函数时出现问题
【发布时间】:2021-10-06 12:47:50
【问题描述】:

我正在尝试使用 ngeo 包中的 st_remove_holes 函数从 shapefile 中删除孔,但即使在运行之后,仍然存在一些孔。

library(dplyr) 
library(sf)
library(nngeo) 
library(geobr) 

sf_use_s2(FALSE)
shape.muni <- read_census_tract(year = 2010, code_tract = 3304557) # download the shapefile
shape.muni <- shape.muni %>% 
 group_by(code_neighborhood, name_neighborhood) %>% 
 summarise(geometry = st_union(geom)) %>% 
 st_remove_holes()

结果是: enter image description here

但它应该是: enter image description here

【问题讨论】:

标签: r dplyr geospatial sf


【解决方案1】:

感谢您的帮助。这样就解决了问题:

read_census_tract(year = 2010, code_tract = 3304557, simplified = F)

【讨论】:

  • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 2011-04-22
  • 2021-05-24
  • 1970-01-01
  • 1970-01-01
  • 2019-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-10-15
相关资源
最近更新 更多