Skip to content

Commit 81bd6ff

Browse files
committed
Properly handle empty point data nodes for COPC.
1 parent 1024024 commit 81bd6ff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/loader/ept/LaszipLoader.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ export class CopcLaszipLoader {
5151
// isolate the compressed data buffer, which is passed to the worker.
5252
// The time-consuming decompression and extracting the data into
5353
// GPU-compatible buffers happens in the worker.
54-
const { pointDataOffset, pointDataLength } = node.nodeinfo
54+
const { pointCount, pointDataOffset, pointDataLength } = node.nodeinfo
55+
56+
// Note that COPC explicitly allows nodes to exist with no data. They
57+
// may have children, but there is no point cloud data. Make sure we
58+
// don't try to fetch a slice of point data in this case.
59+
if (!pointCount) return this.parse(node, new ArrayBuffer())
5560
const compressed = await node.owner.getter(
5661
pointDataOffset,
5762
pointDataOffset + pointDataLength)

0 commit comments

Comments
 (0)