@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
22 lines (21 loc) • 1.69 kB
TypeScript
import { Sketch, SketchCollection, Polygon, Feature, Metric } from "../types/index.js";
import { MultiPolygon } from "../types/geojson.js";
/**
* Calculates area of overlap between sketch(es) and an array of polygon features.
* Truncates input geometry coordinates down to 6 decimal places (~1m accuracy) before intersection to avoid floating point precision issues.
* If sketch collection, then calculates area for each child sketch and the whole collection, without overcounting sketch overlap
* @param metricId unique metric identifier to assign to each metric
* @param features to intersect and get overlap metrics
* @param sketch the sketches. If empty will return 0 result.
* @param options.chunkSize number of features to intersect at a time, to avoid infinite loop error, defaults to 5000 features
* @param options.truncate truncate results to 6 digits after decimal point, defaults to true
* @param options.includeChildMetrics if false and sketch is collection, child sketch metrics will not be included in results, defaults to true
* @param options.solveOverlap if true and sketch is collection, remove overlap between child sketches (using union) before calculating collection level metric, setting to false will be faster but will overcount any sketch overlap
* @returns array of Metric objects
*/
export declare function overlapPolygonArea(metricId: string, features: Feature<Polygon | MultiPolygon>[], sketch: Sketch<Polygon | MultiPolygon> | SketchCollection<Polygon | MultiPolygon> | Sketch<Polygon | MultiPolygon>[], options?: {
chunkSize?: number;
truncate?: boolean;
includeChildMetrics?: boolean;
solveOverlap?: boolean;
}): Promise<Metric[]>;