Closed tobias93 closed 2 years ago
Thanks for the example. Pretty sure the culprit is this line here. Of course LAS stores coordinates as i32
and not u32
. Should be easy to fix.
This is fixed in main
now and will be part of pasture 0.2.0
once it gets released.
There seems to be a bug in pasture_io, when reading las files with negative point coordinates.
I used a simple test file for this, that I created using the las crate with the following code. I checked the resulting file with cloudcompare and it seems to be correct:
When reading the file back using pasture_io, I would expect it to read the same values that were written above. However, for negative values, the coordinate are wrong:
The negative numbers seem to be shifted by
4294967.296
, which is0.001 * 2^32
. The factor of0.001
seems to come from the transformation in the las header. I am not sure, where the2^32
comes from, but it could be a hint for a signed integer, that is read as an unsigned one.The problem only occurs when reading uncompressed .las files. The reader for .laz files does not have this problem.