I am trying to compute the area of an irregular polygon.
I used "ConvexHull" and "alpha_shape" but the output of the surface(area) is not the same.
any suggestions please?
you will find the data, and the code used to compute the area below:
###################################################################
data = [(1.866200,4.379100),
(1.128700,4.814700),
(2.036000,3.074600),
(1.077500,6.100000),
(1.833300,7.126600),
(2.061200,8.399900),
(2.710500,9.418000),
(3.426000,9.141000),
(2.795400,2.644300),
(2.773300,1.400700),
(3.554100,1.084300),
(4.338900,2.025600),
(4.365600,9.981400),
(5.284800,9.657300),
(6.305400,10.194400),
(6.829000,9.124800),
(5.889000,4.120900),
(4.884500,1.854300),
(5.694300,2.821400),
(6.825100,6.487400),
(6.698000,5.189600),
(7.676500,8.884200),
(7.670500,7.610700)]
####################################################
import numpy as np
from shapely.geometry import Polygon
from scipy.spatial import ConvexHull, convex_hull_plot_2d
####################################################
hull = ConvexHull(data)
print('area of the surface = ', hull.volume)
####################################################
polygon = Polygon(data)
print('area of the surface = ', polygon.area)