Scan angle as attribute in lascanopy

59 views
Skip to first unread message

christoph hütt

unread,
May 24, 2023, 5:51:33 AM5/24/23
to LAStools - efficient tools for LiDAR processing
Hi all,
I am using lascanopy to calculate LiDAR metrics (per strip). I use a fixed (polygon-)grid to combine it with other data. Can I also get the average scan angle per grid cell of the points within my grid?
I see the option in Lasgrid, but there is no option to include a shapefile in Lasgrid or to create my grid (e.g., via shapefile). Any ideas?

Best, Christoph

christoph hütt

unread,
May 25, 2023, 6:00:46 AM5/25/23
to LAStools - efficient tools for LiDAR processing
Could I exchange the Intensity with the scan angle attribute and get the average scan angle using avg_int from lascanopy?
I tried with las2las, which offers to "-copy_attribute_into_intensity", but how do I get the attribute or the n called "scan_angle_rank" to the intensity? It only takes numbers, and only numbers 1-3 contain data...

Jochen Rapidlasso

unread,
May 26, 2023, 7:12:31 AM5/26/23
to LAStools - efficient tools for LiDAR processing
Hi Christoph,
good idea to use the intensity field to do your calculations.
There is no straight way to put your scan_angle_rank to intensity.
Easiest is may to do it the good old ascii way:
    las2txt -i in .laz -o tmp.txt -parse xyza -translate_scan_angle 128
    txt2las -i tmp.txt -o out.laz -parse xyzi
Because scan angle is a signed byte with a range of (-128..127) and intensity is 
unsigned you have to shift your scan angle by 128 to avoid range violations.

Good luck!

Jochen @rapidlasso

christoph hütt

unread,
Jun 6, 2023, 3:06:56 AM6/6/23
to LAStools - efficient tools for LiDAR processing
Thx Jochen, that worked.
here is my code for all the las files in my folder

las2txt -i "c:\temp\in\*.las" ^
        -odir " c:\temp\ascii" ^
        -parse xyza -translate_scan_angle 128

txt2las -i "c:\temp\ascii\*.txt" ^
-odir "c:\temp\out" ^
        -parse xyzi ^
-translate_intensity 128 

The scan angle turned out to be irrelevant to my current model, as the scan angle is directly correlated with the number of points per polygon (abv), which I already included in my model.
One of those things we scientists check that turned out to be irrelevant. At least the people here know.

Read my latest paper if you are interested in my research. The processing is done with lastools: 
https://link.springer.com/article/10.1007/s41064-022-00228-6

Best, Christoph
Reply all
Reply to author
Forward
0 new messages