简体   繁体   English

使用R在地理位置上聚类

[英]clustering on geo points using R

I have a set of Lat, long points for a city. 我有一套城市的经纬度。 Now I want to cluster these points based on 500m radius or 1km radius using R. Precisely, I want to find to find out centroids as well as all those points within 500m radius for that particular cluster. 现在,我想使用R基于500m半径或1km半径对这些点进行聚类。准确地说,我想找出质心以及该特定聚类在500m半径内的所有这些点。

PS: PS:

1.I have used k means. 1.我用过k均值。 But I cant fix radius in K - means. 但是我无法固定K半径-意味着。 2. I tried using Leadercluster package in R. After I map clusters to points, and find the distance from centroid, I found out that there are lot points tagged to cluster more than specified radius in Leadercluster package. 2.我尝试在R中使用Leadercluster程序包。将聚类映射到点并找到距质心的距离后,我发现在Leadcluster程序包中有很多标记为聚类的点超过了指定的半径。

My question is exactly like the one in this link: https://gis.stackexchange.com/questions/146701/convert-eps-to-geographic-distance-using-dbscan I am looking for a R solution 我的问题与该链接中的问题完全相同: https : //gis.stackexchange.com/questions/146701/convert-eps-to-geographic-distance-using-dbscan我正在寻找一种R解决方案

Please suggest a nice way to cluster these points based on radius. 请提出一种基于半径对这些点进行聚类的好方法。

Thanks in Advance 提前致谢

Use hierarchical clustering. 使用分层群集。

With maximum linkage, cut at the desired height, you can ensure a maximum distance in each cluster. 通过最大程度的联动,以所需的高度切割, 可以确保每个群集中的最大距离。

With centroid linkage, the distance from the center should be bounded, but this may be limited to Euclidean distances? 使用质心链接时,到中心的距离应该是有界的,但是这可能仅限于欧​​几里得距离吗?

You can draw circles around the points https://gis.stackexchange.com/questions/121489/1km-circles-around-lat-long-points-in-many-places-in-world and then merge them with gUnion. 您可以在点周围绘制圆圈https://gis.stackexchange.com/questions/121489/1km-circles-around-lat-long-points-in-many-places-in-world ,然后将它们与gUnion合并。 The new polygons will be the clusters with points close to each other. 新的多边形将成为点彼此靠近的簇。 A simple way to get the centroid is to take the mean of the lat and lon of the points belonging to each new polygon. 获取质心的一种简单方法是取属于每个新多边形的点的经度和纬度的均值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM