用rmapshaper :: ms_simplify简化我的状态文件,并给出错误信息

问题描述 投票:0回答:1

我正在使用传单包在我闪亮的应用程序上制作chloropleth us状态图。我发现渲染地图非常慢。谷歌搜索之后,似乎shapefile过于复杂和简化,可能会使它变得更快。根据此post,简化shapefile可能是答案。

读取形状文件可以。我能够渲染我的传单地图。

states_shape <- tigris::states(cb = TRUE, resolution='500k')
leaflet(states_shape) %>%
  addProviderTiles("CartoDB.Positron") %>%
  addPolygons(fillColor = "white",
              color = "black",
              weight = 0.5) %>%
  setView(-98.5795, 39.8282, zoom=3)

我试图用rmapshaper::ms_simplify简化我的shapefile>

states_shape_simple <- rmapshaper::ms_simplify(states_shape, keep = 0.05, keep_shapes = TRUE)

我收到如下错误:

Error in FUN(X[[i]], ...) : isTRUE(gpclibPermitStatus()) is not TRUE

我不知道那意味着什么,该怎么做。有谁知道为什么会这样以及如何使它起作用?非常感谢!

我正在使用传单包在我闪亮的应用程序上制作chloropleth us状态图。我发现渲染地图非常慢。谷歌搜索之后,似乎shapefile太复杂,无法简化...

r gis shapefile r-leaflet tigris
1个回答
1
投票

以下应该起作用:

© www.soinside.com 2019 - 2024. All rights reserved.