copy atttribute extra byte (riegl) to user_data

132 views
Skip to first unread message

Maja Ettel

unread,
Jun 30, 2023, 2:16:36 AM6/30/23
to LAStools - efficient tools for LiDAR processing
Hi everybody,

I have LAS files with Riegl extra byte (pulse width) and have to copy these values into the user_data attribute because the client cannot work with VLRs.
This means I have to move values with 2 bytes into an attribute that only has 1 byte.
Is it possible to edit user_data or how can I do that?

Maja

Input data:
LAS 1.2

LAsinfo.JPG

Jochen Rapidlasso

unread,
Jun 30, 2023, 3:05:08 AM6/30/23
to LAStools - efficient tools for LiDAR processing
Hi Maja,
your pulse_width extrabyte is 2 bytes with a range of 1 - 10000.
If you put this into a 1 byte (0 - 255) user data you would need to scale this value by factor 40. You will loose a lot of information.
Right now our file is LAS 1.2 with point data format 1:
In this format you have this 2 byte fields:
    intensity and point_source_id.
If one of this fields are unused you may use one of them.
Otherwise you may can use another point format. E.g. in Point Data Record Format 6 you also have
a 2 byte scan_angle.
Anyway: It's never a good idea to bend fields to use for something different. Best ist to force your client to use a system which support VLRs.
May they should use LAStools  :)

Best regards,

Jochen @rapidlasso

Maja Ettel

unread,
Jul 11, 2023, 8:58:47 AM7/11/23
to LAStools - efficient tools for LiDAR processing
The customer really wants the data in the "User_data" attribute.
Do I have to first outsource the pulse width to an attribute (e.g. attribute1) in order to then scale it?
(las2las ... -remove_vlr)

Sorry, I'm not very good at this topic yet. :-(

Maja

Jochen Rapidlasso

unread,
Jul 11, 2023, 5:37:50 PM7/11/23
to LAStools - efficient tools for LiDAR processing
Hi Maja,
there are probably several ways to do this - best is to test with a small sample.

I generated a small LAZ file with a value in attribute 0 and converted this (range 1...10000) scaled to user byte (0...255):

:: first scale the attribute so it will fit in a 0..255 range
las2las -i test2.laz -o test3.laz -scale_attribute 0 0.025

:: copy this value into user data
las2las -i test3.laz -o test4.laz -copy_attribute_into_user_data 0

:: optional: generate a test text output to check the values
las2txt -i test4.laz -o test4.txt -parse xyz0u

:: optional: remove the attribute vlr
las2las -i test4.laz -o test5.laz -remove_vlr 0

Good luck!

Jochen @rapidlasso

Reply all
Reply to author
Forward
0 new messages