kriging-rs
Geostatistical kriging library with WASM support.
Installation
[]
= "0.1"
Or cargo add kriging-rs.
Usage
use ;
let coords = vec!;
let values = vec!;
let dataset = new?;
let variogram = new?;
let model = new?;
let prediction = model.predict?;
println!;
Features
- Ordinary kriging for spatial interpolation
- Binomial kriging for prevalence surface estimation
- Variogram models: spherical, exponential, Gaussian, cubic, stable, Matérn (stable and Matérn accept an optional shape parameter)
- Geographic coordinate support with Haversine distances
- Optional WASM bindings for browser applications
Realabstraction defaults tof32for compute paths- Optional cross-platform GPU capability path via
wgpu
Build with --features wasm for browser; see below for GPU.
Repository layout
Root is the Rust crate. npm/kriging-rs-wasm/ is the TypeScript/WASM npm package. www/ is a browser demo (see www/README.md).
WASM and npm package
Build WASM:
The TypeScript/npm facade lives in npm/kriging-rs-wasm. See that package’s README for install, verify, and batch/typed-array APIs.
Browser demo: www/README.md.
Development
Install pre-commit and run pre-commit install so fmt and clippy run before each commit and match CI.
GPU
Features: gpu (async WebGPU via wgpu on native + web, including GPU-assisted RHS covariance for batch prediction) and gpu-blocking (native blocking helpers via pollster).
GPU batch prediction APIs are on OrdinaryKrigingModel / BinomialKrigingModel (Rust) and the WASM types (with wasm,gpu). See examples and the npm README for details.
Performance
Run cargo bench for current numbers; see bench-results/README.md for logging and comparison.
License
Licensed under MIT.