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

Untwine changes extra bytes attributes from int to float #155

Closed
uclaros opened this issue Feb 2, 2024 · 7 comments
Closed

Untwine changes extra bytes attributes from int to float #155

uclaros opened this issue Feb 2, 2024 · 7 comments

Comments

@uclaros
Copy link
Contributor

uclaros commented Feb 2, 2024

Given the following sample file from qgis/QGIS#54365
https://github.com/qgis/QGIS/files/12435659/example.zip

pdal info --schema example.laz
# Attr0 and Attr1 are _signed_

untwine -i example.laz -o example.copc.laz -s

pdal info --schema example.copc.laz
# Attr0 and Attr1 are now float

9fafef0 built with pdal 2.6.0

@abellgithub
Copy link
Collaborator

abellgithub commented Feb 6, 2024

What I see in the code should generate doubles. Is this what you're seeing?

@uclaros
Copy link
Contributor Author

uclaros commented Feb 6, 2024

Yes. In the input laz file they are unsigned integers. I'd expect them to be the same in the generated copc.

@abellgithub
Copy link
Collaborator

Right. I just wanted to confirm that you were seeing what I expected given the code.

@nazarred
Copy link

nazarred commented Mar 1, 2024

I have a similar problem. In my LAS file, I have short and unsigned short extrabytes with a scale factor, after I converted that file to COPC with untwine all extrabytes with scale are converted to doubles.

image

I used untwine built from the main branch (255d30b)

Attaching the original file and COPC created with untwine.

test_extra_bytes.zip

@abellgithub
Copy link
Collaborator

@nazarred : Currently Untwine uses PDAL to read data and PDAL does not maintain scale/offset for extra bytes dimensions -- that information is lost. At the time the data is read, it is treated as a double (after scale and offset are applied). There are a few reasons for this, but I don't think it's going to change -- it's been this way for at least a decade.

If you need to maintain scale/offset in extra dimensions when transforming from LAS to COPC and can provide funding, please contact us.

@aritchie-usgs
Copy link

@abellgithub Is this why QGIS drops my confidence and x,y,z normal fields (stored in extra byte fields) from a laz pointcloud created with Metashape? How much funding would it take for this capability to be added? Sample laz file containing data in user byte fields attached
lowest_dense_clip.zip

@abellgithub
Copy link
Collaborator

The normals in your file are scaled extra bytes dimensions. If you're converting this file to COPC with Untwine, those dimensions will be transformed into double-precision values. The confidence value is not scaled. I have no idea why this data is being dropped by QGIS. I would ask the QGIS folks.

Extra Byte Descriptions
      data type: 1 (unsigned char), name "confidence", description: "confidence values", scale: 1 (not set), offset: 0 (not set)
      data type: 2 (char), name "normal x", description: "X surface normal", scale: 0.00787402, offset: 0 (not set)
      data type: 2 (char), name "normal y", description: "Y surface normal", scale: 0.00787402, offset: 0 (not set)
      data type: 2 (char), name "normal z", description: "Z surface normal", scale: 0.00787402, offset: 0 (not set)

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

No branches or pull requests

4 participants