qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.34k stars 2.98k forks source link

Unable to load point cloud layer #50585

Closed saberraz closed 6 months ago

saberraz commented 1 year ago

What is the bug or the crash?

When I try to load a point cloud layer, I get the following error from terminal. The layer opens correctly in QGIS 3.26 but fails to open in master.

untwine: /home/saber/apps/QGIS/external/untwine/bu/../untwine/GridKey.hpp:28: untwine::GridKey::GridKey(int, int, int): Assertion `j < (std::numeric_limits<uint8_t>::max)()' failed.
src/core/qgsmessagelog.cpp:29 : (logMessage) [184118ms] 2022-10-18T07:53:57 [1] Failed to calculate statistics of the point cloud PARQUE_ABELARDO_2
untwine: /home/saber/apps/QGIS/external/untwine/bu/../untwine/GridKey.hpp:27: untwine::GridKey::GridKey(int, int, int): Assertion `i < (std::numeric_limits<uint8_t>::max)()' failed.
src/core/qgsmessagelog.cpp:29 : (logMessage) [459411ms] 2022-10-18T08:01:36 [1] Failed to calculate statistics of the point cloud PARQUE_ABELARDO_1

Steps to reproduce the issue

Date can be provided for testing the issue.

Versions

master (3.27 https://github.com/qgis/QGIS/commit/6f9da191b4)

Supported QGIS version

New profile

Additional context

No response

wonder-sk commented 1 year ago

Looks like upstream issue: https://github.com/hobuinc/untwine/issues/125

wonder-sk commented 1 year ago

A quick look at the file causing problems indicates that the bounding box given in the file header does not match the true bounding box of data, causing this issue. While untwine could have a better way to report such mismatch, in fact the input file is incorrect and should be fixed.

Bounding box as reported in the LAZ file header:

    "minx": -145,
    "miny": -137,
    "minz": -7,

    "maxx": 96,
    "maxy": 85,
    "maxz": 35,

True bounding box of data:

    "minx": -145.317,
    "miny": -137.38,
    "minz": -6.574,

    "maxx": 96.3397,
    "maxy": 85.0856,
    "maxz": 34.9464,
wonder-sk commented 1 year ago

(not a regression as the 3.26 test was done using release build - asserts do not get triggered)

alexbruy commented 10 months ago

Is this still an issue?