python osmnx

编程入门 行业动态 更新时间:2024-10-22 20:22:49
本文介绍了python osmnx-仅提取一个国家的大型高速公路的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我知道可以通过OSMNX python软件包提取城市的道路网.在 geoffboeing/2016/11/osmnx-中查看详细信息python-street-networks/.

I know it is possible to extract the road network of a city via the OSMNX python package. See details at geoffboeing/2016/11/osmnx-python-street-networks/ .

paris_network = ox.gdf_from_place("Paris")

但是,比方说,我不希望这么高的细节水平,而只想要整个国家的大型高速公路.我正在寻找类似的东西:

But, let's say I do not want that level of high details, but rather only big freeways of a whole country. I'm looking for something like :

france_big_expressway_network = ox.gdf_from_place("France", road_type = "freeway")

我想它可能来自基础设施"论点,但是作为一个新手,我真的不知道如何精确地使用它.

I guess it might comes from the "infrastructure" argument but as a newbie I really do not get how to use it precisely.

推荐答案

是的,您可以使用OSMnx执行此操作:

Yes you can do this with OSMnx:

import osmnx as ox ox.config(use_cache=True, log_console=True) G = ox.graph_from_place('France', network_type='drive', infrastructure='way["highway"~"motorway"]') fig, ax = ox.plot_graph(G)

如果您想按多种高速公路类型(例如,保留所有高速公路和主要高速公路)进行过滤,另请参见此答案.道路).

See also this answer if you'd like to filter by multiple highway types (e.g., retain all motorways AND primary roads).

更多推荐

python osmnx

本文发布于:2023-10-29 08:09:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539170.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:python   osmnx

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!