@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
30 lines • 1.2 kB
JavaScript
import { overlapPolygonArea } from "./overlapPolygonArea.js";
import { overlapPolygonSum } from "./overlapPolygonSum.js";
/**
* Calculates overlap between sketch(es) and an array of polygon features.
* Supports area or sum operation (given sumProperty), defaults to area
* If sketch collection includes overall and per sketch
* @param metricId unique metric identifier to assign to each metric
* @param features to intersect and get overlap stats
* @param sketch the sketches. If empty will return 0 result.
* @param options
* @returns array of Metric objects
* @deprecated use overlapPolygonArea or overlapPolygonSum directly, this function now just calls them
*/
export async function overlapFeatures(metricId, features, sketch, options) {
const newOptions = {
includeChildMetrics: true,
operation: "area",
chunkSize: 5000,
truncate: true,
...options,
};
const { operation } = newOptions;
if (operation === "area") {
return overlapPolygonArea(metricId, features, sketch, newOptions);
}
else {
return overlapPolygonSum(metricId, features, sketch, newOptions);
}
}
//# sourceMappingURL=overlapFeatures.js.map