How can I delete duplicate LiDAR points? I incorrectly read the same las twice and saved as a one file resulting in duplicate XY points. How should I delete these duplicate points?
You can delete all duplicate points from a las, laz or ascii file using
lasduplicate in LAStools.
Finds and removes all duplicate points from a LAS/LAZ/ASCII file. In the default mode those are xy-duplicate points that have identical x and y coordinates. The first point survives, all subsequent duplicates are removed. It is also possible to keep the lowest points amongst all xy-duplicates via ‘-lowest_z’.
It is also possible to remove only xyz-duplicates points that have all x, y and z coordinates identical via ‘-unique_xyz’.
lasfilterduplicates in the lidR package (documentation p. 51):
Filter points that appear more than once in the point cloud according to their X Y Z coordinates
You can also try a tool in WhiteboxTools - LidarRemoveDuplicates. You can run it separately through CMD line or as QGIS 3.4 plugin. Instruction on how to use and install WhiteboxTools in on their webpage
If you consider to remove duplicated points on X, Y coordinates (with different Z), after using
lasfilterduplicates function from
lidR package, you may use
las <- lasfilter(las, !duplicated(las@data, by = c("X", "Y"))
I think it will retain the first return points (from that duplicated points).