When using geoplot with a geopandas dataframe containing MultiPolygon objects in its geometry field, geoplot fails to correctly iterate over the MultiPolygon, and then treats it as a single Polygon, resulting in errors.
The fault lies in e.g.
The correct way to iterate over a
MultiPolygon is by accessing its
geoms attribute, rather than directly iterating over the object.
I am using shapely version 2.0.1, I believe this is the package is what's causing the issue. When downgrading to shapely==1.7.1, the problem is alleviated.
Potential fixes:
- use the
geoms attribute
- pinning the
shapely version
I wouldn't mind making a PR to implement a fix
When using geoplot with a geopandas dataframe containing
MultiPolygonobjects in itsgeometryfield, geoplot fails to correctly iterate over theMultiPolygon, and then treats it as a singlePolygon, resulting in errors.The fault lies in e.g.
geoplot/geoplot/geoplot.py
Line 885 in 2da7dc7
The correct way to iterate over a
MultiPolygonis by accessing itsgeomsattribute, rather than directly iterating over the object.I am using
shapelyversion 2.0.1, I believe this is the package is what's causing the issue. When downgrading toshapely==1.7.1, the problem is alleviated.Potential fixes:
geomsattributeshapelyversionI wouldn't mind making a PR to implement a fix