I need to take x number of points and equally/spatially divide them into groups. Meaning that if I had 40 points like in the image below and wanted to have 4 groups of points. Each group should have 10 points and all the points should be spatially near each other. I have tried using normal K-means cluster but that only spatially correlates data while not taking into account the even number of points in each group. I have tried writing this in JavaScript as well as Python. Does anyone have any thoughts on what would be the best way to go about evenly and spatially splitting a set of points?

Points on map

  • 1
    You have this tagged with PostGIS, Python, and JavaScript, but don't have any code for any of them in the question. Please choose one solution framework and provide what you have attempted so far.
    – Vince
    Dec 19, 2018 at 13:26
  • @Vince Is there any reason why I cannot choose more than one framework? Limiting a solution to one framework would not make since if I can use a variety of frameworks. I can provide the code for what I have previously done.
    – mkeller
    Dec 19, 2018 at 13:28
  • We have a "One question per Question" policy here in GIS SE. Leaving the solution language open effectively makes this N questions.
    – Vince
    Dec 19, 2018 at 13:32
  • Ok, I will delete this and post the same question 3 different times for each framework.
    – mkeller
    Dec 19, 2018 at 13:34
  • No, don't delete, just focus. It's better if you choose one environment and work that through resolution, instead of having to maintain three questions at once.
    – Vince
    Dec 19, 2018 at 13:37


Your Answer

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

Browse other questions tagged or ask your own question.