如何将一组地理区域与彼此相似但也保持地理连续性相似的多组分开?

发布于 2025-02-13 14:51:10 字数 730 浏览 3 评论 0原文

我最近尝试使用一组地理区域进行区域化分析,每个区域都包含多个属性(A1,A2,A3,...)。这个目标不像常规的区域化问题(例如K-均值),在该问题中,您定义了组差异最小的组,但在组差异之间最大。

我的区域化恰恰相反,我希望这些小组在手段,差异和其他统计数据方面尽可能相似(尽管组内不必尽可能地不同,但要少一些)。我在R中遇到了Mindiff软件包及其继任的Anticlust软件包,除了一个问题外,它可以很好地完成这项工作:由于这是一个区域化问题,所以我真的希望最终的小组在地理上连接。但是,Mindiff/Anticlust的结果表明,不同的组在地图上彼此混合在一起。这是一个示例代码:

数据框中包含地理单元,并且属性是从shapefile读取并存储在geo.df中的。

geo.df<-as.data.frame(read_sf(dsn = getwd(), lay = "geolayer", stringsAsFactors = FALSE))

geo.df$class <- anticlustering(geo.df[, c("A1", "A2", "A3", "A4", ..., "An"), K = 5, objective = "variance", standardize = TRUE)

我试图在属性(A1,A2,...,AN),成对距离列表中包括坐标,但无效。我总是以分离良好的群体结束,但在地理空间中彼此混合在一起。

关于如何从这里进行的任何指示?任何提示都将不胜感激。

谢谢大家。

I have recently attempted to do a regionalization analysis with a group of geographic regions, each contains multiple attributes (A1, A2, A3, ...). The goal is not like a regular regionalization problem (such as K-means) in which you define groups with minimal within group dissimilarity but maximal between group dissimilarity.

My regionalization is the opposite, I want the groups to be as similar as possible (although within group does not have to be as dissimilar as possible, but that is of less concern) in terms of means, variance, and other statistics. I ran into the minDiff package and its successor anticlust package in R, and it is able to do the job wonderfully except for one problem: since this is a regionalization problem, I would really want the final groups to be geographically connected. Results from minDiff/anticlust, however, show the different groups are mixed with one another all over the map. Here is a sample code:

A dataframe contains the geographic units and attributes is read from a shapefile and stored in geo.df.

geo.df<-as.data.frame(read_sf(dsn = getwd(), lay = "geolayer", stringsAsFactors = FALSE))

geo.df$class <- anticlustering(geo.df[, c("A1", "A2", "A3", "A4", ..., "An"), K = 5, objective = "variance", standardize = TRUE)

I've tried to include coordinates in the list of attributes (A1, A2, ..., An), pairwise distances, but none worked. I always ended up with well separated groups, but all mixed with one another in the geographic space.

Any pointers on how to proceed from here? Any hints will be greatly appreciated.

Thank you all in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幻梦 2025-02-20 14:51:10

这是一个经典的区域化问题。您可以使用溜冰者算法解决此问题。由于您没有提供任何可再现的例子,因此我无法提供任何工作代码。

使用SPDEP库和滑冰者。

library(sf)
#> Linking to GEOS 3.9.1, GDAL 3.2.3, PROJ 7.2.1; sf_use_s2() is TRUE
library(spdep)
#> Loading required package: sp
#> Loading required package: spData
#> To access larger datasets in this package, install the spDataLarge
#> package with: `install.packages('spDataLarge',
#> repos='https://nowosad.github.io/drat/', type='source')`

bh <- st_read(system.file("etc/shapes/bhicv.shp",
                          package="spdep")[1], quiet=TRUE)

dpad <- data.frame(scale(as.data.frame(bh)[,5:8]))

### neighboorhod list
bh.nb <- poly2nb(bh)

### calculating costs
lcosts <- nbcosts(bh.nb, dpad)

### making listw
nb.w <- nb2listw(bh.nb, lcosts, style="B")


### find a minimum spanning tree
mst.bh <- mstree(nb.w,5)

### three groups with no restriction
res1 <- skater(mst.bh[,1:2], dpad, 4)

plot(st_geometry(bh), col = res1$groups)

“”

reprex软件包(v2.0.1)

This is a classic regionalization problem. You can solve this with the skater algorithm. Since you haven't provided any reproducible example, I can't provide any working code.

Use the spdep library and skater.

library(sf)
#> Linking to GEOS 3.9.1, GDAL 3.2.3, PROJ 7.2.1; sf_use_s2() is TRUE
library(spdep)
#> Loading required package: sp
#> Loading required package: spData
#> To access larger datasets in this package, install the spDataLarge
#> package with: `install.packages('spDataLarge',
#> repos='https://nowosad.github.io/drat/', type='source')`

bh <- st_read(system.file("etc/shapes/bhicv.shp",
                          package="spdep")[1], quiet=TRUE)

dpad <- data.frame(scale(as.data.frame(bh)[,5:8]))

### neighboorhod list
bh.nb <- poly2nb(bh)

### calculating costs
lcosts <- nbcosts(bh.nb, dpad)

### making listw
nb.w <- nb2listw(bh.nb, lcosts, style="B")


### find a minimum spanning tree
mst.bh <- mstree(nb.w,5)

### three groups with no restriction
res1 <- skater(mst.bh[,1:2], dpad, 4)

plot(st_geometry(bh), col = res1$groups)

Created on 2022-08-18 by the reprex package (v2.0.1)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文