Skip to content

Commit

Permalink
compatible with newer osmnx
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-sijia committed Sep 27, 2024
1 parent 955a37c commit f21b772
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions network_wrangler/roadwaynetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,9 @@ def ox_graph(

WranglerLogger.debug("starting ox.gdfs_to_graph()")
try:
if (int(ox.__version__.split('.')[0]) >= 1):
# index required in newer osmnx
graph_links = graph_links.set_index(["u", "v", "key"])
G = ox.graph_from_gdfs(graph_nodes, graph_links)
except AttributeError:
WranglerLogger.debug(
Expand Down

0 comments on commit f21b772

Please sign in to comment.