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.
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.