【问题标题】:Getting XY Coordinates/Lat Lon from OSMNX Consolidate Intersections从 OSMNX Consolidate Intersections 获取 XY 坐标/纬度
【发布时间】:2020-08-09 00:36:08
【问题描述】:

参考OSMnx Get Lat Lon Coordinates of Clean Intersection Nodes 最近从 clean_intersections 更改为 consolidate_intersections,原始链接中的 sn-ps 似乎不起作用。我们现在如何使用 consoilidate_intersections 获得相同的 XY 坐标和纬度?

【问题讨论】:

    标签: osmnx


    【解决方案1】:

    如果您提供 rebuild_graph=TrueFalse 作为 consolidate_intersections 参数化,这将有所不同。见the docs。我假设您的意思是默认参数化。只需将您的图表转储到 GeoDataFrame,然后 x、y、lat 和 lon 就会出现在列中:

    import osmnx as ox
    ox.config(use_cache=True, log_console=True)
    G = ox.graph_from_place('Piedmont, CA, USA', network_type='drive')
    Gc = ox.consolidate_intersections(ox.project_graph(G))
    nodes = ox.graph_to_gdfs(Gc, edges=False)
    nodes[['x', 'y', 'lat', 'lon']]
    

    【讨论】:

      猜你喜欢
      • 2021-04-15
      • 2017-12-03
      • 2018-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多