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

Problem when plotting #108

Open PeterKammLab opened 1 year ago

PeterKammLab commented 1 year ago

I had a problems with importing prettymaps, that's solved now. However there is a specific problem now (see image):

import prettymaps plot = prettymaps.plot('Stad van de Zon, Heerhugowaard, Netherlands') C:\Users\pkoljensic\Anaconda3\envs\prettymaps\Lib\site-packages\osmnx\geocoder.py:110: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. gdf = gdf.append(_geocode_query_to_gdf(q, wr, by_osmid)) C:\Users\pkoljensic\Anaconda3\envs\prettymaps\Lib\site-packages\prettymaps\draw.py:109: ShapelyDeprecationWarning: Iteration over multi-part geometries is deprecated and will be removed in Shapely 2.0. Use the geoms property to access the constituent parts of a multi-part geometry. layers = dict(zip(k, v))

AttributeError Traceback (most recent call last) Cell In[3], line 1 ----> 1 plot = prettymaps.plot('Stad van de Zon, Heerhugowaard, Netherlands')

File ~\Anaconda3\envs\prettymaps\Lib\site-packages\prettymaps\draw.py:251, in plot(query, backup, postprocessing, radius, layers, drawing_kwargs, osm_credit, figsize, ax, title, vsketch, x, y, scale_x, scale_y, rotation) 244 ############ 245 ### Plot ### 246 ############ 247 248 # Matplot-specific stuff (only run if vsketch mode isn't activated) 249 if vsketch is None: 250 # Ajust axis --> 251 ax.axis("off") 252 ax.axis("equal") 253 ax.autoscale()

AttributeError: 'NoneType' object has no attribute 'axis'

finnharbeke commented 1 year ago

I came across the same error when trying to install prettymaps. This is due to the vsketch dependency conflict I think. Anyways, the dev fixed it in the newest beta version which should soon be released officially. For now install prettymaps with pip like so:

pip install prettymaps==0.2b2

Hope this solves your problem!

marceloprates commented 1 year ago

I have released v1.0.0, you can install it with pip install prettymaps