我目前正在尝试从这个坐标(-70.74213872499999,-33.411204874999996)中获取ID节点。我使用的是ox.get_nearest_node()函数,但不幸的是我意识到它已被弃用。有什么我可以使用的替代方案吗?坐标不是精确的节点,因为它们是其他节点的平均值的乘积。
lugar = 'Provincia de Santiago, Chile'
city = ox.graph_from_place(lugar)
ox.get_nearest_node(city, (-70.74213872499999, -33.411204874999996))
发布于 2021-10-14 20:55:32
是的,正如弃用警告所说的那样,还有一个替代方案:
UserWarning:
get_nearest_node
函数已弃用,将在未来版本中删除。改用效率更高的distance.nearest_nodes
。
因此,请改用nearest_nodes:
ox.nearest_nodes(G, -70.74213872499999, -33.411204874999996)
https://stackoverflow.com/questions/69576163
复制相似问题