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 fails: Unable to convert scaled value to int32 for dimension 'X' #53

Closed
wonder-sk opened this issue Feb 23, 2021 · 4 comments
Closed

Comments

@wonder-sk
Copy link
Contributor

Trying to index a LAZ file with untwine in QGIS, it fails when reprocessing one of the voxels:

untwine fatal error: writers.las: Unable to convert scaled value (-2148197772) to int32 for dimension 'X' when writing LAS/LAZ file /home/martin/tmp/las/bug-41765/ept_Boot_4-Selection/ept-data/8-9-250-66.laz.

Data not allowed to be shared publicly, but I have a link available on request.

@kannes
Copy link
Contributor

kannes commented Feb 24, 2021

Found another one: https://github.com/CloudCompare/CloudCompare/blob/master/plugins/core/Standard/qCompass/sample%20data/example_data.laz

untwine fatal error: writers.las: Unable to convert scaled value (-2548837016) to int32 for dimension 'Z' when writing LAS/LAZ file /path/to/cloudcompare-git/src/cloudcompare/plugins/core/Standard/qCompass/sample data/ept_example_data/ept-data/2-0-2-0.laz.

Disclaimer: This happened when trying to load it through QGIS. Not sure which untwine binary was used.

@abellgithub
Copy link
Collaborator

abellgithub commented Feb 24, 2021

This is a dup of #48. The combination of the crazy scale factor in this file along with PDAL's failure to transit that value exactly causes this failure.

Current scale values are:

    "scale_x": 3.92021617186116e-08,
    "scale_y": 4.23730798425091e-08,
    "scale_z": 2.58534683391082e-08,

One could fix this using PDAL by setting a scale factor with less precision:

pdal translate <input> <output> --writers.las.scale_x=.000001 --writers.las.scale_y=.0000001 --writers.las.scale_z=.00000001

or something like that.

@wonder-sk
Copy link
Contributor Author

Another instance of the problem (likely created by OpenDroneMap):
https://www.dropbox.com/s/41ci0l4klc192ed/nuage1.laz?dl=0

untwine fatal error: writers.las: Unable to convert scaled value (-1.25622979e+10) to int32 for dimension 'Z' when writing LAS/LAZ file ept_nuage1/ept-data/4-1-10-1.laz.

Also using very low scale of coordinates:

    "scale_x": 3.3503324508667e-08,
    "scale_y": 3.46638383865356e-08,
    "scale_z": 4.75634241104126e-09,

Like Andrew suggested, this fixes the file:

pdal translate nuage1.laz nuage2.laz --writers.las.scale_x=.0001 --writers.las.scale_y=.0001 --writers.las.scale_z=.0001

and it makes the file much smaller as well, because it lowers unnecessary precision of coordinates from nanometers to 0.1 millimeter precision :-)

@kannes
Copy link
Contributor

kannes commented Mar 15, 2021

and it makes the file much smaller as well, because it lowers unnecessary precision of coordinates from nanometers to 0.1 millimeter precision :-)

But how will it match to my 15 decimal GeoJSONs then!!!?

;)

Sorry, couldn't resist. Thanks for looking into this!

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

3 participants