1

How can I cluster geographically 1886 polygons in QGIS knowing that I need 69 clusters with 27 polygons by cluster and one with only 23 polygons?

  • 2
    Can you explain a bit better how you need to cluster them? (A naive way of doing it would be to take the 27 first polygons in one cluster, the 27 next one in the next and so on...) – MortenSickel Mar 12 at 20:58
  • If doing it that way, you have no guarantee that the clusters will get togheter geographically if that is what you need – MortenSickel Mar 12 at 21:29
  • 1
    That's the issue, I need the clusters together geographically – Angel Serrano Mar 12 at 21:51
  • Can you make a screenshot of your data set and scetch what you try do achieve? - edit your question to insert it. – MortenSickel Mar 13 at 5:39
  • please use the edit link to add the constraints that you need to apply – Ian Turton Mar 13 at 9:40
2

Vector analysis -> K-means clustering is a good tool for clustering features geographically. You can specify the required number of clusters.

| improve this answer | |
  • Just out of curiosity, do you know if it can it cluster the way Angel asked for - 69 clusters with 27 polys and one with 23 if you set it up for clustering in 70 polygons. Or would it be 66 with 27 and four with 26? (I do not have any dataset with 1886 polys around to test it on...) – MortenSickel Mar 13 at 13:12
  • @MortenSickel, I'm quite certain it cannot cluster exactly as Angel asked for. K-means minimizes within-cluster variance, and does to my knowledge not necessarily lead to evenly sized clusters. – Sam Mar 13 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.