/** * One-shot terrain elevation sampling (spec: "Cut/fill volume measurement"). * Kept separate from terrain.ts, whose header documents it as PURE and * unit-testable without a GPU — this module is deliberately the DOM-touching * half (fetch + canvas), for the one thing nothing else in this codebase * needed before: "what is the real ground height at this lng/lat". * * Fetches the DEM tile as a blob (never an ``) so the canvas read * below is never tainted regardless of the provider's CORS posture — and * since deck.gl's own TerrainLayer already fetches this exact URL template * cross-origin to RENDER the surface, a caller only ever reaches this with a * URL that's already proven fetchable. */ import type { LngLat } from "./geodesy"; import type { TerrainIR } from "./terrain"; /** Slippy-map tile + fractional pixel covering `lngLat` at `zoom` (256px tiles). Exported for `terrain-heightfield.ts`'s bulk loader — same tile math, no reason to duplicate it. */ export declare function tilePixel(lngLat: LngLat, zoom: number): { x: number; y: number; px: number; py: number; }; /** * Ground elevation (meters) at `lngLat`, decoded from `terrain`'s DEM at its * configured `maxZoom`. `null` on any fetch/decode failure — the caller * treats that the same as "no terrain": flat ground at 0m, not a thrown error. * Ignores `terrain.exaggeration` deliberately: that scales the RENDERED * surface for legibility, volume math wants the true decoded height. */ export declare function sampleTerrainElevation(lngLat: LngLat, terrain: TerrainIR): Promise;