lascanopy with asc-file as input

87 views
Skip to first unread message

Rebekka Wittwer

unread,
Aug 11, 2016, 7:19:37 AM8/11/16
to LAStools - efficient tools for LiDAR processing

Hello,


I would like to compute some forest metrics from a CHM, which I generated according to the tutorial on the rapidlasso website. I used the following script to calculate the metrics:

 

lascanopy -i chm_pit_free.asc ^

                 -lop circles.shp ^

                 -max -avg -std -p 25 75 90 ^

                 -o output_pitfree.asc

 

However, instead of giving me a result of all the 15 field plot circles from the area, it skips 14 of them and only gives me the result for the first plot. I tried the same script with a laz-file as input (ground classified, height normalized and used lasthin to only keep the highest returns), and this works fine, giving me a result for all of the plots. Does anyone have an idea what the problem could be?


Thanks,

Rebekka

Rebekka Wittwer

unread,
Aug 11, 2016, 11:55:45 PM8/11/16
to LAStools - efficient tools for LiDAR processing
I just tried to convert the ascii-file of the CHM to laz with txt2las and with that laz-file it works fine and gives me an output for all 15 field plot circles. But i still don't understand why it does not work with the ascii-input.

Regards,
Rebekka

Martin Isenburg

unread,
Aug 15, 2016, 11:51:59 AM8/15/16
to LAStools - efficient command line tools for LIDAR processing
Hello,

you are correct. There was a small bug in lascanopy for input that is neither LAS nor LAZ. I re-created it with a "fake" example using 'fusa.laz' as follows. But in my defense ... the tools are called LAStools and not ASCtools ... (-;

:: height normalize the LiDAR


D:\LAStools\bin>lasheight -i ..\data\fusa.laz ^
                                          -replace_z ^
                                          -o fusa_norm.laz

:: create some "fake" plot file using the points classified as buildings


D:\LAStools\bin>lasboundary -i fusa_norm.laz ^
                                               -keep_class 6 ^
                                               -concavity 10 -disjoint ^
                                               -o fusa_plots.shp

:: create CHM raster with spike-free algorithms in ASC format


D:\LAStools\bin>las2dem -i fusa_norm.laz ^
                                          -spike_free 0.9 ^
                                          -o fusa_chm.asc

:: current version of lascanopy does not handle ASC raster input well


D:\LAStools\bin>lascanopy -i fusa_chm.asc ^
                                            -lop fusa_plots.shp ^
                                            -all -min -max -p 50 90 ^
                                            -o fusa_plots.csv
WARNING: skipping polygon with index 1
WARNING: skipping polygon with index 2
WARNING: skipping polygon with index 3
WARNING: skipping polygon with index 4

:: after fixing bug (in next version) in lascanopy for non LAS/LAZ input

D:\LAStools\bin>lascanopy -i fusa_chm.asc ^
                                            -lop fusa_plots.shp ^
                                            -all -min -max -p 50 90 ^
                                            -o fusa_plots.csv

:: the output looks correct

D:\LAStools\bin>more fusa_plots.csv
index,min_x,min_y,max_x,max_y,all,min,max,p50,p90
0,277901.100,6122410.410,277999.970,6122499.980,4456,1.37,11.3,3.51,5.32
1,277765.400,6122298.690,277859.260,6122350.270,3785,1.41,14.68,8.73,13.65
2,277846.610,6122490.560,277860.920,6122499.980,94,1.56,5.07,3.86,4.85
3,277766.970,6122434.480,277851.980,6122499.980,3909,1.37,8.67,3.19,4.33
4,277789.160,6122399.040,277829.690,6122424.720,754,1.41,5.23,3.39,4.96

Note. You can create LAZ rasters instead of ASC for more efficient workflows:

:: create CHM raster with spike-free algorithms in LAZ format

D:\LAStools\bin>las2dem -i fusa_norm.laz ^
                                          -spike_free 0.9 ^
                                          -o fusa_chm.laz

:: using a CHM raster in LAZ format as input already works today

D:\LAStools\bin>lascanopy -i fusa_chm.laz ^
                                            -lop fusa_plots.shp ^
                                            -all -min -max -p 50 90 ^
                                            -o fusa_plots.csv

:: identical output using LAZ instead of ASC for CHM raster (and smaller files)

D:\LAStools\bin>more fusa_plots.csv
index,min_x,min_y,max_x,max_y,all,min,max,p50,p90
0,277901.100,6122410.410,277999.970,6122499.980,4433,1.37,11.3,3.51,5.32
1,277765.400,6122298.690,277859.260,6122350.270,3814,1.41,14.68,8.65,13.64
2,277846.610,6122490.560,277860.920,6122499.980,90,1.4,5.07,3.86,4.84
3,277766.970,6122434.480,277851.980,6122499.980,3898,1.37,8.67,3.19,4.34
4,277789.160,6122399.040,277829.690,6122424.720,752,1.41,5.23,3.4,4.96

Regards,

Martin @rapidlasso

lasboundary_buildings_as_fake_plots.png
Reply all
Reply to author
Forward
0 new messages