You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
I can try to fix it. It need a proper test/assertion for a MultiPolygon objects, instead of a so called "Duck test" in line 884 (also appears in line 981 and line 1232)
When using geoplot with a geopandas dataframe containing
MultiPolygon
objects in itsgeometry
field, 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
MultiPolygon
is by accessing itsgeoms
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 toshapely==1.7.1
, the problem is alleviated.Potential fixes:
geoms
attributeshapely
versionI wouldn't mind making a PR to implement a fix
The text was updated successfully, but these errors were encountered: