【发布时间】:2020-06-20 05:13:46
【问题描述】:
我使用 OSmnx 的 osmnx.graph_project 首先将我的图形投影到 UTM 坐标系上,以便使用 consolidate_intersections 函数,然后 ox.project_graph(G_proj_ConsolidateIntersection, to_crs='epsg:4326') 将其投影到纬度-经度坐标系上,以便使用 ox.get_nearest_nodes .最后一个投影需要很长时间(5 分钟),而第一个投影在几秒钟内完成。有没有更好更快的投影到 epsg:4326 的方法?我有looked at this answer 但是当我执行这行gdf = gpd.GeoDataFrame(geometry=intersections) 时,我收到以下错误:
ValueError: Unknown column
这是一个极端的例子(我正在处理的图表较小,但我希望它能说明我的观点):
import osmnx as ox
G = ox.graph_from_place('Edmonton, Canada', network_type='drive', simplify=False)
# 39.1 s
G_proj = ox.project_graph(G)
# 15.9 s
G_proj_ConsolidateIntersection = ox.consolidate_intersections(G_proj)
# 14 min 45 s
G_proj_ConsolidateIntersection_LatLon = ox.project_graph(G_proj_ConsolidateIntersection, to_crs='epsg:4326')
# 44 min 35 s
gpd.GeoDataFrame(geometry=G_proj_ConsolidateIntersection) 也会引发 Unknown column 错误。
【问题讨论】:
-
请提供一个完整的最小可重现示例,我会看看。
-
@gboeing 刚刚用一个例子更新了这个问题。如果您需要更多信息,请告诉我。