Skip to content

Commit

Permalink
fix bug in osm_xml module
Browse files Browse the repository at this point in the history
  • Loading branch information
gboeing committed Dec 7, 2023
1 parent 15ba6fb commit 4c0a1f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion osmnx/osm_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def _append_nodes_as_edge_attrs(xml_edge, sample_edge, all_edges_df):
ET.SubElement(xml_edge, "nd", attrib={"ref": sample_edge["v"]})
else:
# topological sort
all_edges_df = all_edges_df.reset_index()
try:
ordered_nodes = _get_unique_nodes_ordered_from_way(all_edges_df)
except nx.NetworkXUnfeasible:
Expand Down Expand Up @@ -516,7 +517,6 @@ def _get_unique_nodes_ordered_from_way(df_way_edges):
design schema.
"""
G = nx.MultiDiGraph()
df_way_edges.reset_index(inplace=True) # noqa: PD002
all_nodes = list(df_way_edges["u"].to_numpy()) + list(df_way_edges["v"].to_numpy())

G.add_nodes_from(all_nodes)
Expand Down

0 comments on commit 4c0a1f5

Please sign in to comment.