Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain unique attribute values when consolidating nodes #1144

Merged
merged 7 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix comment
gboeing committed Mar 13, 2024

Verified

This commit was signed with the committer’s verified signature.
Exirel Florian Strzelecki
commit a6eda887d9efbb5c3df34ec2ca2978e3bee7dddf
3 changes: 1 addition & 2 deletions osmnx/simplification.py
Original file line number Diff line number Diff line change
@@ -622,8 +622,7 @@ def _consolidate_intersections_rebuild_graph( # noqa: C901,PLR0912,PLR0915
# get the unique non-null values (we won't add null attrs)
unique_vals = list(set(nodes_subset[col].dropna()))
if len(unique_vals) == 1:
# if there's 1 unique value for this attribute, keep that
# one value
# if there's 1 unique value for this attribute, keep it
node_attrs[col] = unique_vals[0]
elif len(unique_vals) > 1:
# if there are multiple unique values, keep all uniques