python 包介绍:osmnx_UQI-LIUWJ的博客-CSDN博客
0 数据描述假设我们现在有这样两个graph:(需要import osmnx as ox)
point1=(31.191184,121.516295) G1=ox.graph_from_point(point1,dist=2000) ox.plot_graph(G1)
1 在G1中可视化一下哪些边是G1和G2都有的,哪些只有G1有point2=(31.191469,121.48904) G2=ox.graph_from_point(point2,dist=2000) ox.plot_graph(G2)
edge_color_lst=[]
for i in G1.edges():
if i in G2.edges:
edge_color_lst.append('green')
else:
edge_color_lst.append('red')
ox.plot.plot_graph(G1,edge_color=edge_color_lst,figsize=(100,25))
2 点同理
nodes_color_lst=[]
for i in G1.nodes():
if i in G2.nodes:
nodes_color_lst.append('green')
else:
nodes_color_lst.append('red')
ox.plot.plot_graph(G1,node_color=nodes_color_lst)



