I have a shapely MultiPoint object but need to extract the boundaries into a Polygon object.
I'm currently using the convex_hull
of the MultiPoint object but my MultiPoint sets can have sharp inward angles (e.g. L X or U shaped) this solution is not ideal.
I'm looking for a function which would convert this MultiPoint:
. . . . . . .
. . . . . . .
. . . . . .
. . . . .
into a polygon with these coordinates:
. .
. .
. . . .
The point data is fixed on grid with 0.25 meter between each point.
My naive approach would be to loop over all points and checking whether the point is fully enclosed by neighbors in all directions. If no, the point must be on an edge. Once I have the edges I could simplify those lines further by removing points in between start and end.
Is there a solution available in Python to do this, preferably in Shapely?