I would like to triangulate the following polygon:
The wkt for the geometry is given as follows:
POLYGON ((3 0, 2 0, 2 0.75, 2.5 0.75, 2.5 0.6, 2.25 0.6, 2.25 0.2, 3 0.2, 3 0))
I ran this code to generate the triangles
triangles = shapely.ops.triangulate(res_intersection.geometry.values) triangles_gdf = geopandas.GeoDataFrame() triangles_gdf.geometry = triangles
When I take a look at the resulting polygon this is what I get:
However this is not what I want. The algorithm seems to generate some extra triangles which Are not contained in the original geometry. Why does this occur? Is there a workaround for this? Ultimately I would like to triangulate a large irregular polygon with holes.