Skip to content

Commit

Permalink
Merge pull request #1093 from gboeing/xml
Browse files Browse the repository at this point in the history
fix bug in osm_xml module
  • Loading branch information
gboeing authored Dec 7, 2023
2 parents 15ba6fb + b6fcca2 commit e9ccbb0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- fix a bug arising from the save_graph_xml function (#1093)
- under-the-hood code clean-up (#1092)

## 1.8.0 (2023-11-30)
Expand Down
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 e9ccbb0

Please sign in to comment.