您可以使用OSMnx查询方式标签/值组合,如文档和用法示例中所述。例如,如您在OSM上看到的,标签为
cycleway:right,其值为
lane。
import networkx as nximport osmnx as oxox.config(use_cache=True)place = 'Bologna, Italia'# get everything with a 'cycleway' tagcf = '["cycleway"]'G = ox.graph_from_place(place, custom_filter=cf)print(len(G))# get everything with a 'cycleway:left' tagcf = '["cycleway:left"]'G = ox.graph_from_place(place, custom_filter=cf)print(len(G))# get everything with a 'cycleway:right' tagcf = '["cycleway:right"]'G = ox.graph_from_place(place, custom_filter=cf)print(len(G))# get everything with a 'cycleway:right' tag if its value is 'lane'cf = '["cycleway:right"="lane"]'G = ox.graph_from_place(place, custom_filter=cf)print(len(G))# get everything with a 'cycleway:right' or 'cycleway:left' tagcf1 = '["cycleway:left"]'cf2 = '["cycleway:right"]'G1 = ox.graph_from_place(place, custom_filter=cf1)G2 = ox.graph_from_place(place, custom_filter=cf2)G = nx.compose(G1, G2)print(len(G))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)