Loading WASM...
| Operation | Time | Details |
|---|
Direction colours: White=E, LightBlue=SE, Cyan=S, Green=SW, Lime=W, Yellow=NW, Orange=N, Red=NE. Pit cell (top-left) = black.
Upstream cell count. White = no upstream (peaks/ridges). Red = high accumulation (streams).
Observer at the yellow cell (2m eye height). Green = visible, Brown = hidden.
// Load WASM from CDN
import init from '@/lib/wasm/openzenith_core.js';
const wasm = await init('/pkg/openzenith_core_bg.wasm');
// D8 flow direction — returns Uint8Array of 0-7 direction codes
const fdPtr = d8_flow_direction_wasm(demPtr, len, rows, cols, nodata);
// Flow accumulation — returns Uint32Array of upstream counts
const accPtr = flow_accumulation_wasm(fdPtr, len, rows, cols, nodataDir);
// Gradient reconstruction from OZT2 residuals
const elevPtr = gradient_reconstruct_wasm(residualsPtr, len, h, w,
nodata, dequantMin, dequantScale);
// Viewshed from DEM
const visPtr = viewshed_wasm(demPtr, len, rows, cols,
observerRow, observerCol,
observerHeight, cellSize, nodata);
// Full OZT2 tile decode (header parsing + decompress + reconstruct)
const { elevations, metadata } = decode_ozt2(tileBytes, decompressFn);