Create a decoder and register a wasm lease (kept until LercDecoder.dispose).
Construction options; see LercDecoderOptions. Defaults to bundler-resolved wasm asset loading.
Decode a LERC blob to a single-band f32 raster (+ optional validity mask).
The raw compressed LERC1/LERC2 blob (e.g. an Esri tile or an
exported .lerc1/.lerc2 file).
A LercRaster: header metadata plus a row-major Float32Array
of the first band (length width * height) and, when not all-valid, a
one-byte-per-pixel mask. Values lie within [zMin, zMax] in the source
raster's units.
If wasm initialization fails (the configured/default .wasm cannot be
fetched or instantiated; see WasmHostInit).
Release this decoder's claim on the wasm runtime. When the last live
LercDecoder is disposed, the singleton WebAssembly.Memory is dropped so
it can be GC'd (see resetWasm) — letting a main-thread terrain layer
reclaim its DEM-decode heap on teardown. Terminal: do not decode() after
disposing. Idempotent.
Decodes Esri LERC1/LERC2 raster blobs (elevation / coverage DEMs) to a single-band
Float32Arrayraster in the browser, backed by the vendored pure-Rustturbolercwasm.Remarks
Integer, float, and double source rasters are all normalized to f32. v1 covers the first band of single-depth rasters (the headline DEM use case); multi-band RGB is a follow-up. The wasm runtime is a process singleton shared by all live decoders — call LercDecoder.dispose when done so its heap can be reclaimed (see resetWasm).
Example
Example