import { type CoverageCell, type LayerManifest } from "@mailwoman/core/layers"; import type { PathBuilderLike } from "path-ts"; export { FarmlandScope, farmlandScope, SSURGO_PRODUCT_LIMITS } from "#vocabulary"; /** * The kinds of answer the layer gives for a coordinate, where `DesignatedNoRating` * and `Unknown` must stay apart. */ export declare const SoilReadingKind: { /** * The survey mapped this location and assigns at least one capability class. */ readonly Designated: "designated"; /** * The survey mapped this location and assigned no rating. * Every share is reported as an absence share. */ readonly DesignatedNoRating: "designated_no_rating"; /** * The layer has no coverage for this location. * This doesn't imply low capability. */ readonly Unknown: "unknown"; }; /** * One of the {@link SoilReadingKind} values. */ export type SoilReadingKind = (typeof SoilReadingKind)[keyof typeof SoilReadingKind]; /** * The capability-class distribution of one cell. */ export interface SoilCapabilityDistribution { /** * The authority's class codes mapped to their area-weighted shares, largest first. */ classShares: Record; /** * The share of mapped soil components that have a NULL rating. */ unratedShare: number; /** * The share of miscellaneous areas that the rating doesn't apply to. */ notRateableShare: number; /** * The share of polygons that have no soil mapping. */ noDataShare: number; /** * The share of the truncated minority classes. * The class shares and the four other shares sum to 1. */ otherShare: number; /** * The fraction of the cell covered by any delineation. * It falls below 1 at a survey-area edge. */ mappedShare: number; /** * The class with the largest share, null when the cell has no class. * * A caller that reads `topClass` should also report `topClassShare`, * because the top class can hold a small plurality. */ topClass: string | null; topClassShare: number | null; /** * The weighting that produced these shares. */ weighting: string; /** * The number of delineations that reached the cell. */ delineations: number; } /** * One survey area in the layer. */ export interface SoilSurveyAreaRecord { areaSymbol: string; areaName: string; /** * The date on which this version of the survey data was established. */ saverest: string; /** * The field survey date. * It can be much older than `saverest`. */ surveySourceDate: string | null; surveySourceTitle: string | null; sourceScale: number | null; mappingScale: number | null; } /** * One reading at a coordinate, with the provenance a caller needs to check it. */ export interface SoilCapabilityReading { kind: SoilReadingKind; /** * The cell's distribution, present on both designated kinds and null on `unknown`. */ distribution: SoilCapabilityDistribution | null; /** * The authority's definition of the top class, from its vocabulary. */ topClassDefinition: string | null; /** * The survey area that covers the location. */ surveyArea: SoilSurveyAreaRecord | null; /** * The coverage row that supports the reading, when one exists. */ coverage: (CoverageCell & { h3CellIndex: string; resolution: number; }) | null; /** * The H3 index cell that the lookup probed. */ indexCellIndex: string; /** * The authority's own statements of what the product doesn't cover. * * Every reading includes them because the survey supports planning only and doesn't replace onsite study. */ limits: ReadonlyArray; } /** * The layer's identity, read once when the database opens. */ export interface SoilLayerIdentity { manifest: LayerManifest; indexResolution: number; coverageResolution: number; /** * The survey areas the layer covers, ordered by area symbol. */ surveyAreas: SoilSurveyAreaRecord[]; /** * The class codes that the layer's vocabulary declares. */ classCodes: string[]; /** * The code of the weighting used for every stored share, with its description. */ weighting: { code: string; description: string; }; databasePath: string; } /** * Options for {@link SoilCapabilityLookup}. */ export interface SoilCapabilityLookupOptions { databasePath: PathBuilderLike; } /** * Reads a sealed `soil.db`, throwing at construction on a manifest for a different product, * an empty coverage table, an empty class vocabulary, or a missing share weighting. */ export declare class SoilCapabilityLookup implements Disposable { #private; readonly identity: SoilLayerIdentity; constructor(options: SoilCapabilityLookupOptions); /** * Returns what the soil survey assigns at this coordinate. */ lookup(latitude: number, longitude: number): SoilCapabilityReading; [Symbol.dispose](): void; } //# sourceMappingURL=index.d.ts.map