Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Peque opened this issue Dec 12, 2021 · 1 comment

Comments

@Peque
Copy link

Peque commented Dec 12, 2021

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
@rowanwins
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants