首页 > 解决方案 > osmnx simple_graph 不会删除所有不是交集的节点

问题描述

我正在使用 Osmnx 来简化我的图表。我已经尝试过严格的 True 和 false,但我的图表仍然有中间节点,它们不是交互。

G3 = ox.graph_from_file( osm_simplified_file, bidirectional=False,simplify=False, retain_all=False, name='unnamed')
G3 = ox.simplify_graph(G3, strict=False)
G3 = ox.remove_isolated_nodes(G3);
G3 = ox.get_largest_component(G3,strongly=True);
ox.plot_graph(G3,......)

在此处输入图像描述

在此处输入图像描述

简化后的路网仍然包含度数为二的节点(两个邻居)。如何完全删除所有没有交集的中间节点?

标签: pythonosmnx

解决方案


推荐阅读