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:
- lasduplicate -i tangle.laz -unique_xyz -record_removed -olaz -odir duplicate
- 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.
- lasmerge -i duplicate\*.laz -o merged.laz
- 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!