Will lascopy transfer point flags with classification?

240 views
Skip to first unread message

Ryan Comeaux

unread,
Jun 9, 2020, 1:23:00 PM6/9/20
to LAStools - efficient tools for LiDAR processing
Is it possible to copy 'withheld' and 'keypoint' flags along with the classification in lascopy?

Ken Comeaux

unread,
Jun 11, 2020, 7:44:09 AM6/11/20
to last...@googlegroups.com
Martin or whoever else might know is there an answer to Chase’s question?
  
  

On Tue, Jun 9, 2020 at 12:22 PM Ryan Comeaux <ryan.co...@gmail.com> wrote:
Is it possible to copy 'withheld' and 'keypoint' flags along with the classification in lascopy?

--
Download LAStools at
http://lastools.org
http://rapidlasso.com
Be social with LAStools at
http://facebook.com/LAStools
http://twitter.com/LAStools
http://linkedin.com/groups/LAStools-4408378
Manage your settings at
http://groups.google.com/group/lastools/subscribe
---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lastools+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lastools/01c3a2ed-12fb-451f-986d-be936cf6f1b0o%40googlegroups.com.
--
Ken Comeaux CP

Matthew Taylor

unread,
Jun 11, 2020, 1:03:47 PM6/11/20
to last...@googlegroups.com

Filter points based on classifications or flags.

  -keep_class 1 3 7

  -drop_class 4 2

  -keep_extended_class 43

  -drop_extended_class 129 135

  -drop_synthetic -keep_synthetic

  -drop_keypoint -keep_keypoint

  -drop_withheld -keep_withheld

  -drop_overlap -keep_overlap

 

 

Matthew Taylor
R&D Manager
256.513.8521

 

 

www.atlantic.tech | t 256.971.9991
2223 Drake Avenue SW, Suite 200, Huntsville, AL 35805

 

 



 

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee, you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the organization. Finally, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.

--

Chase Comeaux

unread,
Jun 11, 2020, 3:00:59 PM6/11/20
to last...@googlegroups.com

Here are my results without and then with those commands:

 

lascopy -i %source%\%%G -i %target%\%%G -o %target%\%%G -odix _updated -classification

 

result:   copied 1926491 point attributes. total time 1.577 sec.

 

 

 

lascopy -i %source%\%%G -i %target%\%%G -o %target%\%%G -odix _updated -classification -keep_withheld -keep_keypoint

 

or

 

lascopy -i %source%\%%G -i %target%\%%G -o %target%\%%G -odix _updated -keep_withheld -keep_keypoint

 

result:                   copied 0 point attributes. total time 0.687 sec.

Michael Perdue

unread,
Jun 12, 2020, 5:00:06 PM6/12/20
to LAStools - efficient command line tools for LIDAR processing
Hi Chase,

AFAIK, there is no direct route to move the flags using lascopy at this time. However, there is an indirect route. You can convert the flags into classifications in an intermediate file, move the flags to the target file as classifications, update the flags in the target and then move the classification. It makes use of filtered transforms and is a little tedious, but is easy to script and can be run on multiple cores if set up properly.

:: Given a source file

lasinfo -i source.laz

...

histogram of classification of points:

         6441146  ground (2)

         4447709  medium vegetation (4)

 +-> flagged as keypoints: 1081631

  +--->         1081631 of those are ground (2)

 +-> flagged as withheld:  34

  +--->              34 of those are medium vegetation (4)

 

:: And a target file

lasinfo -i target.laz

...

histogram of classification of points:

        10888855  never classified (0)

 

 

::---------------------------------------------------------------------------

:: Step 1: Convert flags to classes

::---------------------------------------------------------------------------

:: Create copy of source.laz with all classes zero'd

las2las -set_classification 0 ^

        -i source.laz ^

        -o tmp.laz

 

:: Use a filtered transform to set withheld point to class 1

las2las -keep_withheld ^

        -filtered_transform ^

        -set_classification 1 ^

        -i tmp.laz ^

        -o tmp2.laz

 

:: Use a second filtered transform to set keypoints to class 2

las2las -keep_keypoint ^

        -filtered_transform ^

        -set_classification 2 ^

        -i tmp2.laz ^

        -o flagged_classes.laz

 

::---------------------------------------------------------------------------

:: Step 2: transfer the classes to the target file and update the flags

::---------------------------------------------------------------------------

:: Transfer flags as classes to the target file

lascopy -i flagged_classes.laz ^

        -i target.laz ^

        -o tmp_mvflag.laz

 

:: Use a filtered transform to set withheld flag on class 1

las2las -keep_class 1 ^

        -filtered_transform ^

        -set_withheld_flag 1 ^

        -i tmp_mvflag.laz ^

        -o tmp_mvflag2.laz

 

:: Use a filtered transform to set key point flag on class 2

las2las -keep_class 2 ^

        -filtered_transform ^

        -set_keypoint_flag 1 ^

        -i tmp_mvflag2.laz ^

        -o tmp_mvflag3.laz

 

::---------------------------------------------------------------------------

:: Step 3: finally, copy over the proper classes

::---------------------------------------------------------------------------

lascopy -i source.laz ^

        -i tmp_mvflag3.laz ^

        -o finished.laz

 

:: Check the results

lasinfo -i finished.laz

...

histogram of classification of points:

         6441146  ground (2)

         4447709  medium vegetation (4)

 +-> flagged as keypoints: 1081631

  +--->         1081631 of those are ground (2)

+-> flagged as withheld:  34

  +--->              34 of those are medium vegetation (4)


Cheers,


Mike


Ryan Comeaux

unread,
Jun 17, 2020, 2:10:33 PM6/17/20
to LAStools - efficient tools for LiDAR processing
Thanks a ton, Mike! Got me going.

Martin Isenburg

unread,
Jul 10, 2021, 9:27:33 PM7/10/21
to LAStools - efficient command line tools for LIDAR processing
Hello Ryan.

in the next version of LAStools (to be released in a few days) you will be able to select any number of flags along with the classification:

lascopy ^
-i source.laz ^
-i target.laz ^
-classification ^
-keypoint_flag ^
-synthetic_flag ^
-withheld_flag ^
-overlap_flag ^
-o result.laz

Regards,

Martin @rapidlasso 


On Tue, Jun 9, 2020 at 7:22 PM Ryan Comeaux <ryan.co...@gmail.com> wrote:
Is it possible to copy 'withheld' and 'keypoint' flags along with the classification in lascopy?

--
Reply all
Reply to author
Forward
0 new messages