Swetha K V
Swetha K V

Reputation: 43

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.

PS:

1.I have used k means. But I cant fix radius in K - means. 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.

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

Please suggest a nice way to cluster these points based on radius.

Thanks in Advance

Upvotes: 2

Views: 2804

Answers (2)

Chris
Chris

Reputation: 2256

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. 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.

Upvotes: 0

Has QUIT--Anony-Mousse
Has QUIT--Anony-Mousse

Reputation: 77454

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?

Upvotes: 0

Related Questions