Priorisation of classified points in lasduplicate

45 views
Skip to first unread message

jean.franc...@gmail.com

unread,
May 11, 2022, 12:45:59 PM5/11/22
to LAStools - efficient tools for LiDAR processing
I had to run lasduplicate on a LAZ file containing duplicated points but ran into the issue that the points removed were all the ground points leaving me with only the unclassified remaining points. Upon more inspection, I found that the tile had probably add been delivered with one file containing all points but no classification and another containing only the ground points classified as so and that at one time the files had been merged together.

I want to untangle it but I don't want to lose the classified ground points. Only having access to the "merged" file, I had to:
  1. lasduplicate -i tangle.laz -unique_xyz -record_removed -olaz -odir duplicate
  2. Rename the resulting tangle_removed.laz file to 1.laz and the resulting tangle.laz to 2.laz. The need to specifically rename the _removed file to 1 is to ensure that those points will be added first as lasduplicate only keep the first point encountered.
  3. lasmerge -i duplicate\*.laz -o merged.laz
  4. lasduplicate -i merged.laz -unique_xyz -o untangle.laz
Now my file untangle.laz doesn't contain any duplicated points and I kept the original ground classification.

My suggestion:
Could a switch be added that would allow the user to prioritise keeping the classified points? The switch could work like the filter switch where a list of number is given and that the enumerated classes would be given priority in case of duplicates. Better, the order in which the number of given could be also respected so that -priority 2 9 3 would keep only point of class 2 if a duplicated point of class 0/1/3/4/... is also present and arrive before in the file records. If the switch -priority isn't used, then the tool works as it does currently (first point met is kept).

Thanks!

Jochen Rapidlasso

unread,
May 12, 2022, 7:02:13 AM5/12/22
to LAStools - efficient tools for LiDAR processing
Hi Jean-Francois,
thanks for this suggestion and for sharing this trick you did to solve your problem.
Another thought about this:
Couldn't you just use a standard import filter like
-drop_class 0 1
to get rid of the unclassified duplicate points?
Best regards,
Jochen @rapidlasso

jean.franc...@gmail.com

unread,
May 12, 2022, 10:57:34 AM5/12/22
to LAStools - efficient tools for LiDAR processing
Your right, my first step could have been done using an import filter. Something like las2las -keep_class 2 to save in one file the ground points and then another las2las -drop_class 2 to save the full point cloud. Steps 2, 3 and 4 would have been the same. The thing is I wasn't sure at first that all points classified as ground were duplicates... but they were.
Best regards,

Reply all
Reply to author
Forward
0 new messages