【问题标题】:How to deal with large maps in osmnxosmnx中如何处理大图
【发布时间】:2020-11-21 10:33:12
【问题描述】:

使用 OSmnx 计算两个位置之间的最短街道距离的最佳方法是什么?例如,如果我想寻找一条穿越美国的路线?

这样做似乎很麻烦,考虑到我的计算资源,也许不可能。

G = ox.graph_from_place('USA', network_type='drive')

orig_node = ox.get_nearest_node(G, (lat, lon))
dest_node = ox.get_nearest_node(G, (lat, lon))

nx.shortest_path_length(G, orig_node, dest_node, weight='length')

有什么有效的方法可以做到这一点?

我确实看到了这个帖子..

python osmnx - extract only big freeways of a country

但即使只是美国的高速公路也会创建一个庞大的网络

【问题讨论】:

    标签: python openstreetmap geopandas osmnx


    【解决方案1】:

    考虑到您的研究站点的庞大和您计算机的可能限制,您最好的选择可能是首先download 一个 OSM 提取然后使用 OSMnx 的 graph_from_xml 函数加载它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-17
      • 1970-01-01
      • 1970-01-01
      • 2013-01-05
      相关资源
      最近更新 更多