PointCloudLayer appears to sub-sample #3914
Replies: 4 comments
-
After doing some digging, I've discovered that this was caused by floating point precision. |
Beta Was this translation helpful? Give feedback.
-
This should be fixed in loaders.gl (or at least make it configurable). @xintongxia |
Beta Was this translation helpful? Give feedback.
-
Hi, @nmonahelis. I have met the same problem. The position values of the las points lost precision during the loading. I've tried to change the ......
parseLASChunked(arraybuffer, skip, (decoder, header) => {
if (!originalHeader) {
originalHeader = header;
const total = header.totalToRead;
positions = new Float64Array(total * 3);
// positions = new Float32Array(total * 3);
...... But problem didn't go away, instead the console promote an error like so:
And the attributes of point cloud data doesn't seem to be changed at all:
Would you please elaborate on how you over come this problem? |
Beta Was this translation helpful? Give feedback.
-
As of registerLoaders(LASWorkerLoader);
new PointCloudLayer({
// ...
data: LAZ_FILE,
loadOptions: {
las: {fp64: true}
}
}) |
Beta Was this translation helpful? Give feedback.
-
I'm attempting to load in and render pointcloud data to accompany the xviz stream in streetscape.gl. After discovering deck.gl had support for rendering pointclouds using the PointCloudLayer class, I was able to easily import the classes and get a PointCloudLayer rendered.
However, I noticed that the data appears to be sub-sampled with some sort of occupancy grid, as there seems to be uniform spacing between the points. In order to confirm that all of the positions were being loaded into memory with deck.gl, I added a counter in the getPosition() method and made sure the number of positions matched the total number of vertices (based on the LAZ file). I also loaded the .laz file into CloudCompare to ensure the data is not compromised. All of the points seem to be rendered in CloudCompare.
Since I was testing this in a streetscape.gl project, I wanted to see if I could reproduce this in a pure deck.gl example.
I cloned the PointCloudLayer example from the website (https://deck.gl/#/examples/core-layers/point-cloud-layer) and loaded in one of our .laz files and I'm still getting the same results.
Here's what it looks like using the PointCloudLayer example:
Here's what it should look like rendered using CloudCompare:
In case you wanted to know how I'm loading in the .laz files, I am using the LASLoader class from loaders.gl - the loader seems to be working just fine as I'm able to see the object with the proper data and it doesn't appear to be missing any of it. The COORDINATE_SYSTEM is LNGLAT.
I've tried initializing PointCloudLayer in two ways: Passing the LAZ object by itself as well as creating an array of the positions, colors and normals like so:
{ "position" : ..., "color": ..., "normal": ... }
Both have the same results.
Anyone know what could be causing this issue?
Beta Was this translation helpful? Give feedback.
All reactions