LaszipDecoder

Pure-Kotlin LASzip decompressor for the pointwise-chunked compressor (the dominant real-world .laz layout, point formats 0–3). Reconstructs standard ASPRS point records so earth.worldwind.formats.las.LasReader reads them with its uncompressed field path.

Each chunk stores its first point raw, then range-codes the remaining points; the chunk table (delta-coded byte offsets) lets us decode each chunk from an exact stream position. LAS 1.4 layered compression (formats 6–10) and the legacy pointwise (v1) compressor are out of scope — they surface as a clear error; the uncompressed forms of those formats still load.

Install once at app startup: LasDecoderRegistry.lazDecoder = LaszipDecoder().

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open suspend override fun decode(fileBytes: ByteArray, header: LasHeader, vlr: LaszipVlr): ByteArray

Decompress every point in fileBytes. The chunk table and compressed data start at LasHeader.offsetToPointData.