QGIS merge points within distance

Table of Contents

QGIS merge points within distance

Issue

image

How

One possible approach consists in the following steps:

  1. draw a buffer of 5m around points;
  2. dissolve the buffers which overlap;
  3. 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

image

image

image

Dissolve the buffers which overlap

image

image

image

image

I reduced the buffer sales

image

Calculate the centroids of dissolved buffers

image

image

image

References

  1. https://gis.stackexchange.com/questions/77043/merge-point-features-within-a-given-radius

Leave a Reply

Your email address will not be published. Required fields are marked *