I have millions of lat long points that have been grouped into squares. Some squares have thousands of points, others have a couple of points. The idea is that we have one set of lat long for the square with a weighting related to the square based on the number of items it has instead of having millions of rows of data to the cluster.
I was originally using the leadercluster algorithim which allowed me to specify the distance each of my clusters should cover. This is ideal for my use case but now I would like to use it to cluster squares factoring in the weight of the squares. This is basically a learning experience for me and any help would be greatly appreciated
I have seen this which could be useful but I'm not really able to make headway with it
Below is some sample data in R about airports and arrivals
df <- read.csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_february_us_airport_traffic.csv')
ggplot(df, aes(x = long, y = lat)) + geom_point()
sample <- df %>% select(long, lat, arrivals = cnt)