lazyslide.cv.preserve_largest_polygon

lazyslide.cv.preserve_largest_polygon#

preserve_largest_polygon(gdf, buffer_px=0)#

Preserve the largest polygon in each group of overlapping polygons.

Parameters:
gdfGeoDataFrame

The GeoDataFrame containing the polygons.

buffer_pxfloat, default: 0

The buffer size for the polygons to test the intersection.

Returns:
GeoDataFrame

The GeoDataFrame with the largest polygons preserved.