【发布时间】:2020-09-15 22:02:27
【问题描述】:
import osmnx as ox
ox.__version__ # '0.13.0'
我想使用出色的 OSMNX 模块在地图上显示German subway OSM data 中已知的subway in Hannover。但与New York example 不同的是,不会返回以下结果:
G = ox.graph_from_place('Hannover, Germany',
retain_all=False, truncate_by_edge=True, simplify=True,
network_type='none', custom_filter='["railway"~"subway"]')
# EmptyOverpassResponse: There are no data elements in the response JSON
我确实获得了使用“德国汉诺威”作为地区的其他类似查询的结果。我也没有得到巴黎或伦敦的地铁结果。而且我没有得到类似查询的结果,例如 custom_filter='["railway"~"tram"]' 或 '["railway"~"s-bahn"]' 或 '["network"~"metro"]'。
另外,如果我使用基础设施关键字参数来选择“铁路”,则会返回一个广泛的 gdf:
G = ox.graph_from_place('Hannover, Germany', retain_all=False, truncate_by_edge=True, simplify=True,
network_type='none', infrastructure='way["railway"]')
gdfox = ox.graph_to_gdfs(G, nodes=False, edges=True, node_geometry=True, fill_edge_geometry=True)
gdfox.shape # (4422, 14)
但是我无法使用返回的列来识别地铁?:
['u', 'v', 'key', 'osmid', 'service', 'oneway', 'length',
'geometry', 'name', 'maxspeed', 'ref', 'bridge', 'tunnel',
'access']
我还觉得奇怪的是,如果我(尝试)使用 custom_filter 检索所有铁路,则只返回 2 个 LINESTRINGS:
G = ox.graph_from_place('Hannover, Germany', retain_all=False, truncate_by_edge=True,
simplify=True, network_type=None, custom_filter='["railway"~""]')
gdfox = ox.graph_to_gdfs(G, nodes=False, edges=True, node_geometry=True, fill_edge_geometry=True)
gdfox.shape # (2, 10) # returns only 2 LINESTRINGS: Altenbekener Damm
【问题讨论】:
标签: openstreetmap osmnx