是否可以在 OSmnx 中将街道段划分为更小的部分?例如,假设我们要将一条街道划分为 10 米的路段或将一条街道划分为 10 个相等的部分。
G = ox.graph_from_place('Piedmont, California, USA', network_type='drive')
fig, ax = ox.plot_graph(G, node_zorder=2, node_color='w', bgcolor='k')
假设在此示例中,我希望在长度大于 50 米的街道上有 10 个等距节点。这可能吗?我已经看过了OSmnx 文档 https://osmnx.readthedocs.io/en/stable/但我不确定这个功能是否存在。
您可以细分道路geometry像这样通过使用重新分布顶点 https://osmnx.readthedocs.io/en/stable/osmnx.html#osmnx.utils_geo.redistribute_vertices功能。然后,您必须在每个几何顶点手动创建图形节点。另请注意,您最初可以通过简单地传递来获得更细粒度的图simplify=False
当您创建图表时。
编辑:请注意redistribute_vertices
该函数已被弃用。使用interpolate_points
函数代替:https://osmnx.readthedocs.io/en/stable/osmnx.html#osmnx.utils_geo.interpolate_points https://osmnx.readthedocs.io/en/stable/osmnx.html#osmnx.utils_geo.interpolate_points
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)