I have used OSmnx's osmnx.graph_project
to first project my graph onto UTM coordinate system in order to use consolidate_intersections
function and then ox.project_graph(G_proj_ConsolidateIntersection, to_crs='epsg:4326')
to project it onto Latitude-Longitude coordinate system in order to make use of ox.get_nearest_nodes
. This last projection takes a long time (5 minute), while the first projection is done within seconds. Is there a better and faster way of projection onto epsg:4326? I have looked at this answer but when I execute this line gdf = gpd.GeoDataFrame(geometry=intersections)
, I get the following error:
ValueError: Unknown column
Here is an example from the extreme side (the graph I am working it is smaller but I hope it illustrates my point):
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
Also gpd.GeoDataFrame(geometry=G_proj_ConsolidateIntersection)
raises the Unknown column
error.