Table of Contents
QGIS merge points within distance
Issue
How
One possible approach consists in the following steps:
- draw a buffer of 5m around points;
- dissolve the buffers which overlap;
- calculate the centroids of dissolved buffers.
You can choose the tools with which you're more comfortable.
Example\
For instance, using GDAL >= 1.10.0 compiled with SQLite and SpatiaLite you can calculate the buffer around your points.shp
:
ogr2ogr buffers.shp points.shp -dialect sqlite -sql "SELECT ST_Buffer(geometry,5) from points"
Then, calculate the clusters (dissolved buffers):
ogr2ogr clusters.shp buffers.shp -dialect sqlite -sql "SELECT ST_Union(geometry) from buffers" -explodecollections
Finally, calculate result_points.shp
:
ogr2ogr result_points.shp clusters.shp -dialect sqlite -sql "SELECT Centroid(geometry) FROM clusters"
Draw a buffer of 5m around points
Dissolve the buffers which overlap
I reduced the buffer sales