是的,您可以使用OSMnx执行此操作:
import osmnx as oxox.config(use_cache=True, log_console=True)G = ox.graph_from_place('France', network_type='drive', custom_filter='["highway"~"motorway"]')fig, ax = ox.plot_graph(G)如果您想按多个高速公路标签值进行过滤(例如,保留所有高速公路和主要道路),请参阅此答案。
最后,请注意,自OSMnx
v0.15.0起,
gdf_from_place和
gdf_from_places函数已被弃用,并由
geopre_to_gdf函数代替。有关详细信息,请参阅文档。



