9

I have seen similar questions asked about grouping points and Concave Hull being given as an answer, but in my case there are no "features"/attributes that will classify the points. The only parameter I want to group the points is through proximity to each other.

I have over 800,000 points which are spread across with some close to each other. I want to create polygons that cover points that are within 500m from each other, and lone ones will have a polygon of their own.

Clarification: The clusters need to have a maximum specified radius. Clusters themselves should not merge based on how far apart they are to each other.

Could you please let me know how I can approach this?

1 Answer 1

13

you can try this (did this in QGIS 2.16)

  • fixed distance buffer each point by 250m (this is half the required distance between points)
  • then dissolve all on the result of that
  • then use multipart to singlepart to split each cluster into its own feature
  • add a field (using the expression @row_number) to assign a unique ID to each cluster.

you then get something like this...

enter image description here

Now use join attributes by location on your points layer to find out which cluster each point falls inside (using 'within'/'take attributes of first selected feature').

Finally the Concave hull plugin. Sadly this doesn't appear to support "by field" concave hulls like the Convex hull functionality. So you'll need to select and export each cluster yourself and run Concave Hull on each one separately. Here's what cluster #1 looks like as a concave hull...

enter image description here

So each point within that cluster is within 500m of another point in that cluster.

Note that a point with no neighbours within 500m will probably have a concave hull which collapses to a point. And one with only one neighbour will probably have a concave hull which is a line. I haven't tested these, though.

Tip - 800k is a lot of points. For your own productivity and to avoid frustration, I suggest you try this on a small region, or a small random selection of your data first. It's easy to get an option wrong, and this could take some time on a set that large ;) This might be done faster with postgis

2
  • 1
    Hi Steven, Thanks for this. However, I am looking for a circular cluster and it needs to have a specified maximum radius - rather than how close clusters are (which ST_Clusterwithin does well).
    – user82635
    Commented Sep 30, 2016 at 11:29
  • @geejay have you actually sorted that out ? I'm looking into doing the same but haven't found a solution yet Commented Feb 18, 2021 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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