lasheight

120 views
Skip to first unread message

Karin...@ldbv.bayern.de

unread,
Sep 20, 2016, 3:02:41 AM9/20/16
to last...@googlegroups.com

Hello,

 

is there an option to change the classification of points below a certain threshold inside or outside

polygons?

I only know of lasheight to change the classification, but not inside/outside polygons and

lasclip with classify_interior, but this does not accept any threshold.

 

Maybe I missed another tool or option to solve my problem.

 

Thank you

Karin

 

 

 

Martin Isenburg

unread,
Sep 21, 2016, 2:29:13 AM9/21/16
to LAStools - efficient command line tools for LIDAR processing
Hello Karin,

thanks for your interesting question. I've added some functionality to the latest version (160921 released a few minutes ago) to make this happen. Here an example:

:: first we create a sample SHP file using building footprints

lasboundary -i ..\data\fusa.laz ^
                    -keep_class 6 ^
                    -disjoint -concavity 5 ^
                    -o buildings.shp

:: now we flag points inside building footprints as 'withheld'

lasclip -i ..\data\fusa.laz ^
           -poly buildings.shp ^
           -interior -flag_as_withheld ^
           -o fusa_marked.laz

:: now we compute the height above the ground points and store it as extra bytes

lasheight -i fusa_marked.laz ^
               -store_as_extra_bytes ^
               -o fusa_marked_with_height.laz

:: now we do a filtered transform using the new '-keep_attribute_above' filter

las2las -i fusa_marked_with_height.laz ^
            -keep_withheld -keep_attribute_above 0 5 ^
            -filtered_transform ^
            -set_classification 9 ^
            -o fusa_marked_with_height_class.laz

:: as you can see, only the points in the buildings footprints that are higher
:: than 5 meter above the ground were marked.

lasview -i fusa_marked_with_height_class.laz

===========================================

You can achieve the same without using "extra bytes" (hence also in older LAStools versions) by using the fact that lasheight stores heights between 0.0 and 25.5 meters multiplied by 10 into the user data field.

:: now we flag points inside building footprints as 'withheld'

lasclip -i ..\data\fusa.laz ^
           -poly buildings.shp ^
           -interior -flag_as_withheld ^
           -o fusa_marked.laz

:: now we compute the height above the ground points and store it into user data

lasheight -i fusa_marked.laz ^
               -o fusa_marked_with_height.laz

:: now we do a filtered transform using the old '-keep_user_data_above' filter

las2las -i fusa_marked_with_height.laz ^
            -keep_withheld -keep_user_data_above 50 ^
            -filtered_transform ^
            -set_classification 9 ^
            -o fusa_marked_with_height_class.laz

:: as you can see, only the points in the buildings footprints that are higher
:: than 5 meter above the ground were marked.

lasview -i fusa_marked_with_height_class.laz

In a final step you may want to unset the withheld flags again. For the LAStools professionals: try to realize that much more I/O efficient with LASlayers ... (-:

Regards,

Martin @rapidlasso

las2las_filtered_transform_attribute_above.jpg

Karin...@ldbv.bayern.de

unread,
Sep 22, 2016, 6:49:54 AM9/22/16
to last...@googlegroups.com

Hello Martin,

 

thank you for your support.

 

When I tested the workflow with my LiDAR data, it seemed that las2las -keep_attribute_above does not accept any signed numbers or a minimum other than 0.

 

My problem are basement stairs. There are ugly craters in the dtm if they are classified as ground.

So my idea is to use a buffer around the buildings and to reclassify ground points below x.xxx m inside this polygon

 

Maybe something like

-keep_attribute_between -100 -0.3

 

could be an option?

 

Regards

Karin

keller.jpg
keller2.jpg

Martin Isenburg

unread,
Sep 23, 2016, 10:45:27 AM9/23/16
to LAStools - efficient command line tools for LIDAR processing
Hello,
I should have been more descriptive. There are four new filters implemented. The first argument specifies which attribute to use. These are the attributes listed as "extra bytes" in an lasinfo report and as there can be more than one per point we need to specify which one. Some LAS files already contain pre-existing attributes listed as "extra bytes" so then the newly created "height above ground" will have a higher index. The index will be between 0 and n-1 with n being the number of attributes.

-keep_attribute_above 0 5
-keep_attribute_below 1 0.25

-drop_attribute_above 2 1.5
-drop_attribute_below 0 -0.5

The '-drop_attribute_between' is a good suggestion. I was just lazy ... (-:

Regards,

Martin

Karin...@ldbv.bayern.de

unread,
Oct 5, 2016, 10:00:57 AM10/5/16
to last...@googlegroups.com

Hello,

 

this works for me now, thank you.

 

I had to change my workflow a bit, but the result is as expected:

 

lasclip -i *.laz ^

        -poly geb_buffer.shp ^

        -interior ^

        -flag_as_withheld

 

Since all points are classified already, all ground points do not get any height difference!

So I have to change the classification of the ground points inside the buffer polygon first:

 

las2las -i *_withheld.laz ^

           -keep_withheld ^

          -filtered_transform ^

          -change_classification_from_to 2 22 ^

          -odix _22 

 

lasheight -i *_22.laz ^

             -store_as_extra_bytes ^

             -skip_files ^

             -odix _bytes

 

las2las -i *_bytes.laz ^

           -keep_withheld ^

           -keep_attribute_below 0 -0.1 ^

           -filtered_transform ^

          -set_classification 10 ^

          -odix _filtered

 

changing back the classification:

 

las2las -i *_filtered.laz ^

           -keep_withheld ^

           -filtered_transform ^

           -change_classification_from_to 22 2 ^

           -odix _fertig

 

las2las -i *_fertig.laz ^

           -set_withheld_flag 0 ^

           -ocut 34

 

 

This improves the DTM in urban areas.

 

Regards

Karin

 

Von: last...@googlegroups.com [mailto:last...@googlegroups.com] Im Auftrag von Martin Isenburg
Gesendet: Freitag, 23. September 2016 16:27
An: LAStools - efficient command line tools for LIDAR processing
Betreff: Re: [LAStools] lasheight

 

Hello,

Reply all
Reply to author
Forward
0 new messages