From 201d0ddcfe00796d92ca33fcea6728cbeeb3a409 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Fri, 9 Feb 2024 15:48:54 +0100 Subject: [PATCH] build_shapes: handle europe_shape multipolygon with shapely>=2 (closes #852) --- scripts/build_shapes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_shapes.py b/scripts/build_shapes.py index 35bae147..c5faf597 100644 --- a/scripts/build_shapes.py +++ b/scripts/build_shapes.py @@ -158,7 +158,7 @@ def country_cover(country_shapes, eez_shapes=None): shapes = pd.concat([shapes, eez_shapes]) europe_shape = shapes.unary_union if isinstance(europe_shape, MultiPolygon): - europe_shape = max(europe_shape, key=attrgetter("area")) + europe_shape = max(europe_shape.geoms, key=attrgetter("area")) return Polygon(shell=europe_shape.exterior)