2

I'm trying to decimated a point shapefile to remove points close to each other. If you look at the example below, you can see points are 30cm apart, but other are closer. I just need to remove duplicate and keep just 1 point in the cluster using a distance threshold

enter image description here

Using Geodesic Point Decimate in SHAPE pluging, I cannot find the the correct Minimum Distance Between Points to use, likely because I cannot compute a geodesic value that make sense with my projection. How can I do that ?

I also tried this tool (SAGA Point thinning) but I keep running into an error (.LAS output are not supported) and cannot find a way around it -- eventhough I'm using SHP

point thinning/point selection based on distance threshold in QGIS/GRASS

Babel
  • 71,072
  • 14
  • 78
  • 208
Gil
  • 121
  • 5
  • So you want to delete points if they are closer than a certain threshold. But which of the points you want to keep and which one to delete? Based on what criteria? – Babel Nov 14 '23 at 19:55
  • It does not matter which point to keep in the cluster of point close to each other. It can be random – Gil Nov 14 '23 at 19:58

1 Answers1

1

Solution: the idea

Buffer/dissolve you points, then select only one (the first) point per buffer, inverse the selection (to select duplicate points), delete the selected points (see below for details).

By the way: using EPSG:32618 (UTM zone 18N), measurements should not be a problem. Cartesian or ellipsoidal distances should return more or less the same values as long as you are inside the area valid for this CRS.

Buffers 35, 37 and 38 contain more than one point; using the expression from step 3, only one point per buffer remains unselected (red), if there are further points inside the same buffer, they are selected (yellow) and can be deleted: enter image description here

Solution: how to do in detail

  1. Buffer the points with the distance within which you want to keep just one point (I used 5 cm) - be sure to dissolve the buffers.

  2. Run Multipart to single parts.

  3. On the point layer, run Select by Expression and get: A) the @id of the buffer each point is within, B) aggregate all points with the same buffer @id to an array, C) select only one (the first) of these points, D) create the inverse of these selection. See below for the expression to use.

     not @id =
     array_agg (
         @id,
         group_by:=overlay_within(
             'buffer',
             @id,
             limit:=-1
         )
     )[0]
    
  4. Like this, you have selected duplicate points within the same buffer and you just keep only one point per buffer unselected: you can now delete the selected points.

Babel
  • 71,072
  • 14
  • 78
  • 208