问题
I am wondering if it is possible to plot area objects from OSM through OSMnx.
It seems to me, that there is an easy way only to plot buildings. But I would like to be able to plot e.g. rivers, but can't find a place to specify this.
I was hoping for a similar mechanism to plotting different way objects (e.g. power lines) through infrastructure
parameter in graph_from_bbox
function.
Is there something like that but for areas?
What I did already is to try a minimal example:
import osmnx as ox
ox.config(use_cache=True, log_console=True)
point = (50.045199, 19.939229)
dist = 300
north, south, east, west = ox.bbox_from_point(point, distance=dist)
# power lines around southern california
G = ox.graph_from_bbox(north=north, south=south, east=east, west=west,
retain_all=True, truncate_by_edge=True, simplify=False,
network_type='none', infrastructure='way["power"~"line"]')
fig, ax = ox.plot_graph(ox.project_graph(G))
Next I tried to alter the way["power"~"line"]
for other types of things, including areas, but it returned an error. But I did not find any other obvious way to request area objects than this parameter.
来源:https://stackoverflow.com/questions/53271216/plotting-different-area-objects-in-osmnx