pygeoops.remove_inner_rings#

pygeoops.remove_inner_rings(geometry: Polygon | MultiPolygon | None, min_area_to_keep: float, crs: str | CRS | None) Polygon | MultiPolygon | None#

Remove (small) inner rings from a (multi)polygon.

Parameters:
  • geometry (Union[shapely.Polygon, shapely.MultiPolygon, None]) – polygon geometry.

  • min_area_to_keep (float) – keep the inner rings with at least this area in the coordinate units (typically m). If 0.0, no inner rings are kept.

  • crs (Union[str, pyproj.CRS]) – the projection of the geometry. Passing None is fine if min_area_to_keep and/or the geometry is in a projected crs (not in degrees). Otherwise the/a crs should be passed.

Raises:

Exception – if the input geometry is no (multi)polygon.

Returns:

the resulting (multi)polygon

Return type:

Union[shapely.Polygon, shapely.MultiPolygon, None]