6

This is my project:

Picture1

I want to convert all points that touch each other into polygons, something like this (I know I missed some of them):

Picture2

I tried using dissolve and convex hull to do that, but they didn't work as intended. Also, this is just a fraction of the whole project, so I don't know how many clusters there should be. Hence, I can't run k-means.

Unfortunately, I don't know anything about PostGIS. Does anyone know how to do this?

4
  • 3
    Looks like a very small buffer and Dissolve might do the trick.
    – Jon
    Commented Sep 22, 2020 at 20:10
  • 3
    The points don't actually touch, they are just rendered with circles that visually touch. Do the points represent an area (data-wise)? Circular or square? Commented Sep 22, 2020 at 20:16
  • They represent square-ish areas
    – willsbit
    Commented Sep 22, 2020 at 20:26
  • It doesn't matter what shape the points are rendered as, buffer by more than half the gap between points, dissolve then buffer by negative the same size to trim the unjoined back to fairly close to the generating points. Commented Sep 23, 2020 at 0:03

2 Answers 2

6

This will work when each cluster has an attribute that defines it.

If there is no such attribute, you can achieve it using the "DBSCAN clustering" geoalgorithm.

Clusters point features based on a 2D implementation of Density-based spatial clustering of applications with noise (DBSCAN) algorithm.

The algorithm requires two parameters, a minimum cluster size ("minPts"), and the maximum distance allowed between clustered points ("eps").

Let's assume there is a point layer called 'pois', see the image below.

input

Use the "Minimum bounding geometry" geoalgorithm from the QGIS's Processing Toolbox (Ctrl+Alt+T) and get the output:

result


2

Managed to do it with the "Rectangles, Ovals, Diamonds (Variable)" tool. I used a rectangle with a small width and height (0.7) and then dissolved the result.

1
  • Looking at your screenshot, some of the point clumps don't really match a rectangle. What if a different shape, such as oval had been a better choice for a particular clump? Furthermore, even if a rectangle had been a good choice for a particular clump, what if it could be improved by rotation? Your answer would be improved if you edited it to show the results, using the same area as in your question's screenshot.
    – Stu Smith
    Commented Jan 1, 2021 at 17:56

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.