marceloprates / prettymaps

A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries.
GNU Affero General Public License v3.0
11.02k stars 516 forks source link

AttributeError: 'MultiPolygon' object has no attribute 'exterior' #113

Closed antoninpa closed 1 year ago

antoninpa commented 1 year ago
import prettymaps
from matplotlib import pyplot as plt

plot = prettymaps.plot(
    'Bom Fim, Porto Alegre, Brasil', radius = False,
)

plt.show()

This code fails and produces :

Traceback (most recent call last): File "/home/.../prettymaps/Madrid.py", line 5, in plot = prettymaps.plot( File "/home/.../prettymaps/prettymaps/draw.py", line 951, in plot plot_gdf( File "/home/.../prettymaps/prettymaps/draw.py", line 247, in plot_gdf PolygonPatch( File "/home/.../prettymaps/prettymaps/draw.py", line 172, in PolygonPatch exterior = np.array(poly.exterior.xy) AttributeError: 'MultiPolygon' object has no attribute 'exterior'

marceloprates commented 1 year ago

Hi @antoninpa , are you sure you have prettymaps=1.0.0 installed? I couldn't reproduce your error neither on my local machine or Google Colab

antoninpa commented 1 year ago

My bad, I had to reinstall my virtual env. Sorry !

marceloprates commented 1 year ago

No problem, thanks!