xugrid.earcut_triangulate_polygons#

xugrid.earcut_triangulate_polygons(polygons: geopandas.GeoDataframe, column: str | None = None) xugrid.UgridDataArray[source]#

Break down polygons using mapbox_earcut, and create a mesh from the resulting triangles.

If no column argument is provided, the polygon index will be assigned to the grid faces.

Parameters:
  • polygons (geopandas.GeoDataFrame) – Polygons to convert to triangles.

  • column (str, optional) – Name of the geodataframe column of which to the values to assign to the grid faces.

Returns:

triangulated

Return type:

UgridDataArray