From f21b772a33f735f02010b2078291c5f3c84d076c Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Thu, 26 Sep 2024 23:04:37 -0400 Subject: [PATCH] compatible with newer osmnx --- network_wrangler/roadwaynetwork.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/network_wrangler/roadwaynetwork.py b/network_wrangler/roadwaynetwork.py index 621da454..285f6d3b 100644 --- a/network_wrangler/roadwaynetwork.py +++ b/network_wrangler/roadwaynetwork.py @@ -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(