Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the area of a bounding polygon that encloses a set of points

I have a series of points on a plot of the sky. I want to find the area that these points occupy.

To do this I need to find the vertices of a polygon that encloses these points - convert the points to an equal-area projection and then work out the area.

I have all the code written apart from how to calculate the vertices of a polygon that enclose the points on the graph. What is the best way to do this?

enter image description here

like image 700
Samuel Avatar asked Nov 22 '22 07:11

Samuel


1 Answers

The polygon you chose is not convex, so the popular convex hull algorithm wouldn't work for you.

https://pypi.org/project/alphashape/ seems what you want

like image 178
Chen Xing Avatar answered Dec 15 '22 11:12

Chen Xing