diff --git a/lidro/merge_mask_hydro/vectors/close_holes.py b/lidro/merge_mask_hydro/vectors/close_holes.py index 3eb3f57b..cec8047c 100644 --- a/lidro/merge_mask_hydro/vectors/close_holes.py +++ b/lidro/merge_mask_hydro/vectors/close_holes.py @@ -20,7 +20,7 @@ def close_holes(polygon, min_hole_area): # Create polygons from each exterior contour without holes exterior_polygons = [Polygon(ring) for ring in exterior_contours] # Merge all polygons into a single encompassing shape - unified_shape = unary_union(polygons) + unified_shape = unary_union(exterior_polygons) # Interior Hydro Mask interiors_to_keep = [ diff --git a/test/vectors/test_merge_vector.py b/test/vectors/test_merge_vector.py index 7facd361..5f160cf5 100644 --- a/test/vectors/test_merge_vector.py +++ b/test/vectors/test_merge_vector.py @@ -37,5 +37,5 @@ def test_create_hydro_vector_mask_default(): assert gdf.crs.to_string() == crs # CRS is identical assert all(isinstance(geom, Polygon) for geom in gdf.geometry) # All geometry should Polygons - expected_number_of_geometries = 1 + expected_number_of_geometries = 3 assert len(gdf) == expected_number_of_geometries # One geometry