polygon-clipping icon indicating copy to clipboard operation
polygon-clipping copied to clipboard

Feature request: provide a function to calculate the area of a (multi)polygon

Open Peque opened this issue 2 years ago • 1 comments

In example:

const polygonClipping = require('polygon-clipping')

const polygon = [[[0,0],[2,0],[0,2],[0,0]]]
polygonClipping.area(polygon) == 2
const multi = [[[[0,0],[2,0],[0,2],[0,0]]], [[[2,2],[4,2],[2,4],[2,2]]]]
polygonClipping.area(multi) == 4

Peque avatar Dec 12 '21 16:12 Peque

There are many other libraries already available which do this, for example @turf/area does it with geojson data or 2d-polygon-area.

rowanwins avatar Oct 07 '22 03:10 rowanwins