作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
溶解是作为sf方法here讨论的一种常见的地理处理技术。
我正在尝试复制溶解,因为它在ArcGIS中起作用。在ArcGIS中按两个组考虑县。
无论东部半岛是否包含其他单独的多边形,ArcGIS Dissolve命令都会产生两个多边形。像这样:
这是我想在sf中复制的功能,但是我不能如下所示。
nc <- st_read(system.file("shape/nc.shp", package="sf"))
#create two homogenous spatial groups
nc$group <- ifelse(nc$CNTY_ <= 1980,1,2)
#plot
ggplot() + geom_sf(data=nc, aes(fill = factor(group)))
#dissolve
nc_dissolve <- nc %>% group_by(group) %>% summarize()
#plot dissolved
ggplot() + geom_sf(data=nc_dissolve, aes(fill = factor(group)))
#Cartographically, it looks like we have two polygons, but there are
#actually several more wrapped up as MULTIPOLYGONS. We can plot these.
t <- nc_dissolve %>% st_cast() %>% st_cast("POLYGON")
ggplot() + geom_sf(data=t, aes(fill=factor(row.names(t))))
最佳答案
我不太熟悉ArcGIS如何定义多边形,但是多边形的简单要素访问(ISO标准)规范是一个带有零个或多个表示孔的内环的单环。这意味着在该规范下,如果您拥有主要陆地+几个岛屿,那么您将没有一个多边形。为了将它们表示为单个要素,相应的几何类型为多面。意思是您的答案在nc_dissolve
中:它具有两个功能。
关于r - 使用SF包溶解面要素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44314922/
我一直在用ogr2ogr用 shapefile 做我需要的大部分事情(包括溶解它们)。然而,我发现对于大的来说,这需要很长时间。 这是我正在做的一个例子: ogr2ogr new.shp old.sh
我想将 UIImageView 图像从一个图像更改为另一个图像。 但我不希望它完全动画到最后。我只是想让它溶解一定百分比。 结果应该是一个包含两个图像的新图像,就像我会在某个时候停止动画并保留结果一样
与其创建两个 UIImageViews,不如简单地更改一个 View 的 image 似乎是合乎逻辑的。如果我这样做,是否有两个图像之间的淡入淡出/交叉溶解而不是即时切换? 最佳答案 使用新的基于 b
我是一名优秀的程序员,十分优秀!