Plotting different area objects in OSMnx

时光怂恿深爱的人放手 提交于 2020-01-06 07:31:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!