Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General question about undocumented extra bytes #149

Open
rwiesen opened this issue Jul 5, 2024 · 6 comments
Open

General question about undocumented extra bytes #149

rwiesen opened this issue Jul 5, 2024 · 6 comments
Labels

Comments

@rwiesen
Copy link

rwiesen commented Jul 5, 2024

What is the issue about?

Inquiry about the specification

Issue description

I was coming along an unclear part in the LAS specification concerning extra bytes, and think this group might be a good place to ask for clarification.

The LAS specification states that the number of extra bytes is the Point Data Record Length minus the point size implied by the point format type. As the Point Data Record Length is an unsigned short value, there - theoretically - may be close to 64k extra bytes.

If the extra bytes should be described as "undocumented" using an Extra Bytes VLR, the specification states that the EXTRA_BYTES data_type must be 0 (= "undocumented extra bytes") with the options bit field storing the number of undocumented bytes. However, the options field is an unsigned char and thus has a maximum value of 255.

So, my question is: How to provide a correct Extra Bytes VLR for LAS files where points have more than 255 undocumented extra bytes? Just add multiple descriptors? Or did I miss something?

@BB-Heidelberg
Copy link

Please see answer at the LAStools support group

@esilvia
Copy link
Member

esilvia commented Jul 5, 2024

Copying content from the @rapidlasso reply to the LAStools discussion here:

each extra byte definition will get an table entry in the extra byte vlr.
If you add a extra byte with data_type=0 you give the size in the options field (1..255).
This size will extend your point data record size by this value.
The total size of a point data record is limited by 64k.
The size of the extra byte vlr will be large enough to hold around 340 extra_byte entries (64k / 192byte per table entry).
You can't add more extra_bytes than this.
If your extra bytes has a larger size you hit the 64k point data record size limit maybe earlier.

I concur with Jochen's assessment here. That said, I've personally never seen more than a few dozen extrabytes added to each point record.

@esilvia
Copy link
Member

esilvia commented Jul 5, 2024

@rwiesen Great question! Do you require any further clarification, or was Jochen's reply sufficient to close this thread?

@kjwaters
Copy link

kjwaters commented Jul 5, 2024 via email

@rwiesen
Copy link
Author

rwiesen commented Jul 8, 2024 via email

@hobu
Copy link
Contributor

hobu commented Jul 8, 2024

For those who might be coming to this thread for search engines and such: LAS is not a particularly good format for generic-schema row-interleaved content. I would instead look at Feather or Parquet, which are columnar and have much more sophisticated metadata than LAS for handling the schema description (and generic metadata). LAS is good in a pinch for interchange, but most LAS-reading software is not going to be able handle dozens of extra byte dimensions for anything beyond converting it to another format. If you want that, you probably don't want LAS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants