We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73fd58c commit 3948928Copy full SHA for 3948928
1 file changed
src/spatialdata_plot/pl/render.py
@@ -121,6 +121,8 @@ def _get_collection_shape(
121
) -> PatchCollection:
122
patches = []
123
for shape in shapes:
124
+ # remove empty points/polygons
125
+ shape = shape[shape["geometry"].apply(lambda geom: not geom.is_empty)]
126
# We assume that all elements in one collection are of the same type
127
if shape["geometry"].iloc[0].geom_type == "Polygon":
128
patches += [Polygon(p.exterior.coords, closed=True) for p in shape["geometry"]]
0 commit comments