build_shapes: handle europe_shape multipolygon with shapely>=2 (closes #852)
This commit is contained in:
parent
e0dafc50b3
commit
201d0ddcfe
@ -158,7 +158,7 @@ def country_cover(country_shapes, eez_shapes=None):
|
|||||||
shapes = pd.concat([shapes, eez_shapes])
|
shapes = pd.concat([shapes, eez_shapes])
|
||||||
europe_shape = shapes.unary_union
|
europe_shape = shapes.unary_union
|
||||||
if isinstance(europe_shape, MultiPolygon):
|
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)
|
return Polygon(shell=europe_shape.exterior)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user