import { type MultiPolygonRings } from "@mailwoman/spatial"; import { PathBuilder, type PathBuilderLike } from "path-ts"; /** * Returns the path of the shapefile that holds a survey area's map-unit polygons. */ export declare function mapUnitShapefile(spatialDirectory: PathBuilderLike, areaSymbol: string): string; /** * Returns the path of the shapefile holding a survey area's outline. * * The build takes the footprint from this outline because unrated map units such as `notcom` lie inside it. * A union of rated polygons would leave them out. */ export declare function surveyAreaShapefile(spatialDirectory: PathBuilderLike, areaSymbol: string): PathBuilder; /** * One map-unit delineation, reprojected to WGS84. */ export interface SoilDelineation { /** * The delineation's identifier, formed as `:`. */ areaID: string; mukey: string; areasymbol: string; polygons: MultiPolygonRings; } /** * The metadata that a shapefile declares, read before any feature. */ export interface SoilSourceIdentity { epsg: number; featureCount: number; layer: string; /** * The layer's declared extent as `[minLon, minLat, maxLon, maxLat]`. */ bbox: readonly [number, number, number, number]; } /** * Options for reading one SSURGO map-unit shapefile. */ export interface SoilIngestOptions { shapefilePath: string; /** * The layer inside the shapefile. * * The ESRI driver reports that name. * * @defaultValue the file's base name. */ layer?: string; /** * The EPSG code that the source must declare. * * @defaultValue the SSURGO source projection. */ expectEPSG?: number; /** * The inclusive range of shapefile FIDs to read. * A build can use it to read one chunk. */ fidFrom?: number; fidTo?: number; /** * The maximum number of features to read. * Fixture and smoke runs use it. */ limit?: number; } /** * Reads the projection, feature count, layer name and extent that a shapefile declares. * * It throws when the shapefile declares a projection other than `expectEPSG`. */ export declare function readSoilSourceIdentity(options: SoilIngestOptions): Promise; /** * Streams a shapefile's map-unit delineations reprojected to WGS84. * * It throws when a feature lacks geometry or `mukey`. * It also throws when a vertex falls outside the declared extent. * * The extent check catches swapped coordinate axes that the projection check misses. */ export declare function readSoilDelineations(options: SoilIngestOptions & { bbox: readonly [number, number, number, number]; }): AsyncGenerator; /** * Supplies a soil build with its delineations and the source's declared identity. * * The builder takes this instead of a path so that fixtures can run the database * build without network access or GDAL. */ export interface SoilFeatureSource { areaSymbol: string; /** * The feature count that the source declares. * * The build throws when its streamed total differs from this count. */ declaredFeatureCount: number; layer: string; epsg: number; /** * A description of where the delineations came from, such as the shapefile path. */ origin: string; delineations: () => AsyncIterable; } /** * Creates a {@link SoilFeatureSource} for one survey area's shapefile. * * It reads the shapefile's identity immediately and streams features when asked. */ export declare function createShapefileFeatureSource(options: SoilIngestOptions & { areaSymbol: string; declaredFeatureCount?: number; }): Promise; //# sourceMappingURL=ingest.d.ts.map