import { type H3Cell } from "@sister.software/h3"; import type { SoilCapabilityCellTable, SoilComponentTable, SoilMapUnitTable } from "#schema"; /** * The number of H3 levels below the index resolution at which the weighting lattice samples. * * Children at a finer resolution have equal area, so counting which delineation * covers each child center estimates the covered area. * A depth of 2 gives 49 children, or about 2% per child. * * NRCS publishes component shares no finer than 2%, and each extra level costs seven times as much. */ export declare const WEIGHT_LATTICE_DEPTH = 2; /** * The class share below which a class is added to `other_share` instead of stored. * * The floor is below the lattice's 2% step, so it only removes the small shares * that minor components contribute. * The reducer adds them to `other_share` so all shares sum to 1. */ export declare const CLASS_SHARE_FLOOR = 0.01; /** * One delineation that reaches a cell. */ export interface CellCandidate { areaID: string; mukey: string; containment: string; minLat: number; minLon: number; maxLat: number; maxLon: number; rings: Uint8Array; } /** * The shares that a map unit contributes per unit of area. */ export interface MapUnitProfile { /** * Each class code's share of the map unit. * These shares and the three absence shares sum to 1. */ classShares: ReadonlyMap; unrated: number; notRateable: number; noData: number; } /** * Builds the profile of one map unit from its components. * * A `no_mapping` map unit contributes only to `noData`, because it has no soil mapping. * * Components are weighted by `comppct_r`, the component's representative percentage of its map unit. * The weights are divided by their actual total, because the percentages may not sum to 100. */ export declare function mapUnitProfile(mapUnit: Pick, components: ReadonlyArray>): MapUnitProfile; /** * The stored row for one cell, plus diagnostics for the build report. */ export interface ReducedCell { row: SoilCapabilityCellTable; /** * Whether the top class covers less than half the cell. */ topClassUnderHalf: boolean; /** * Whether the lattice was used instead of the whole-cell fast path. */ sampled: boolean; } /** * Reduces one cell. * * @throws {Error} When a candidate's map unit has no profile. * A missing profile means the attribute join is incomplete. * The remaining candidates would describe only part of the cell. */ export declare function reduceCell(cell: H3Cell, resolution: number, candidates: ReadonlyArray, profiles: ReadonlyMap, h3Cell: number): ReducedCell; /** * Returns the sum of a stored row's class shares and four other shares. * * Tests use it to check that the shares sum to 1. */ export declare function shareTotal(row: SoilCapabilityCellTable): number; //# sourceMappingURL=reduce.d.ts.map