overlapPolygonArea()
function overlapPolygonArea(
metricId,
features,
sketch,
options): Promise<Metric[]>
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
Parameters
| Parameter | Type | Description |
|---|---|---|
metricId | string | unique metric identifier to assign to each metric |
features | Feature<Polygon | MultiPolygon, GeoJsonProperties>[] | to intersect and get overlap metrics |
sketch | SketchCollection<Polygon | MultiPolygon> | Sketch<Polygon | MultiPolygon> | Sketch<Polygon | MultiPolygon>[] | the sketches. If empty will return 0 result. |
options | object | - |
options.chunkSize? | number | number of features to intersect at a time, to avoid infinite loop error, defaults to 5000 features |
options.includeChildMetrics? | boolean | if false and sketch is collection, child sketch metrics will not be included in results, defaults to true |
options.solveOverlap? | boolean | 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 |
options.truncate? | boolean | truncate results to 6 digits after decimal point, defaults to true |
Returns
Promise<Metric[]>
array of Metric objects