Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在osmnx中处理大型映射_Python_Openstreetmap_Geopandas_Osmnx - Fatal编程技术网

Python 如何在osmnx中处理大型映射

Python 如何在osmnx中处理大型映射,python,openstreetmap,geopandas,osmnx,Python,Openstreetmap,Geopandas,Osmnx,使用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(

使用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')
有什么有效的方法可以做到这一点吗

我确实看到了这篇文章


但即使是美国的高速公路也会形成一个巨大的网络

考虑到你的学习网站的巨大规模和你的电脑可能存在的局限性,你最好的选择可能是先下载OSM摘录,然后再加载OSMnx的功能