I have a set of about 120,000 points, not regularly spread.
I would like to cluster them in order to create groups of about 3,000 points, regardless the distance. The final goal is to create polygons (their size is not important, I just want them to contain 3,000 points) out of bbox from these groups. The result would be like a grid with different sizes of cells, each cell containing 3,000 points. Do you know how could I achieve this ? I saw st_clusterKmeans and st_clusterDBSCAN functions, but I don't know how to fix the number of points to aggregate (there's a minpoints with st_clusterDBSCAN, but no "maxpoints").
Asked
Active
Viewed 337 times
2
WITH RECURSIVEapproach, rerunningST_ClusterDBSCANon clusters with too many points. A smallerparams.fractionvalue will increase execution time, but the amount of points per cluster will be closer to theparams.max_pointsvalue. The goal was to get belowparams.max_points, not divide by exactlyparams.max_pointspoints, so cluster sizes will vary below that threshold. Grid cells may very likely overlap, too. – geozelot Nov 27 '19 at 13:50