I currently use OSMnx for a project to draw road networks in an area.
I'd now like to add water bodies so that we can clearly see which parts of an area are water and land.
So far, I've been able to identify waterbodies using the custom_filter argument to OSMnx's graph functions. I can then outline the waterbodies using the plot_graph function.
Ideally, I'd want to fill the waterbodies in (rather than only outline them). I feel like this should be possible, as in OpenStreetMap water bodies are filled, but I can't figure out how to do this with OSMnx. Does anybody have any ideas?
Here's what I have currently:
import osmnx as ox
# Get water bodies map of the New York City area
G = ox.graph_from_bbox(40.9666,40.4362,-73.6084,-74.3254, custom_filter='["natural"~"water|coastline"]', retain_all = True)
# Plot the graph in blue on a white background
ox.plot_graph(G, bgcolor='white', node_size=0, equal_aspect=True, edge_color='blue')
Which produces this image:
Do I need to somehow use a geodataframe with PlotShape? Or is plot_footprints what I need? I haven't been able to find examples of people plotting waterbodies. It seems the GDF is generally used for plotting the map of a place, and footprints is used for buildings. Though as those are both polygon-oriented plots, I feel that might be the right way.


