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.04k stars 516 forks source link

catch empty response instead of failing #57

Closed sacovo closed 2 years ago

sacovo commented 2 years ago

If a street is present in the layers with a custom filter that does not exist in the specified area, osmnx throws an exception and the whole plotting fails. I suggest catching the exception and just returning an empty MultiLineString. Maybe a warning could also be added, to inform that the requested street is not present in the result.