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

fixed issue Merging two ways corrupts step_count #10492 #10633

Closed
wants to merge 0 commits into from

Conversation

Darshit42
Copy link

@Darshit42 Darshit42 commented Dec 28, 2024

this pr fixes #10492 ,changes are such that it adds up the values of tags

before fixing the issue tags such as step_count , parking:left, etc values were not adding up when lines were merged, this creates confusion to user on how merging works
merging two ways resulted in 3+4 => Error (values are not same) or 2+2 => 2 (values are not summed)

after this , when lines are merged it adds up the values of tags successfully
merging two ways resulted in 3+4 => 7

Screen-Recording.mp4

@Darshit42 Darshit42 changed the title fixed issue 10492 fixed issue #10492 Dec 28, 2024
@Darshit42
Copy link
Author

to anyone who's reading this , if i made any mistakes in raising this pr feel free to criticize it's my first time raising a pr in other repo besides mine 🙃

@Darshit42 Darshit42 changed the title fixed issue #10492 fixed issue Merging two ways corrupts step_count #10492 Dec 29, 2024
Copy link
Collaborator

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this pull request – the test failures appear to be pointing to unintended consequences of the proposed changes.

utilArrayUnion(t1.split(/;\s*/), t2.split(/;\s*/)).join(';'),
255 // avoid exceeding character limit; see also context.maxCharsForTagValue()
);
merged[k2] = `${t1};${t2}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code intentionally eliminated duplicates from the list. Merging two features with identical values for a given key shouldn’t result in the value being repeated twice. Tests are failing because this code unconditionally concatenates the two values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill change it and fix the repeated value error

merged[k2] = t2;
} else if (!isNaN(t1) && !isNaN(t2)) {
changed = true;
merged[k2] = String(Number(t1) + Number(t2));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it may be appropriate to treat step_count=* as a summable number, this is not necessarily the case with every tag value that consists of digits. For example, if I merge two ways with maxspeed=30 and maxspeed=35, iD should reject the merge because of conflicting tags rather than resulting in maxspeed=65 (a speed limit of 65 kilometers per hour).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill look into these tags and make a list to exclude them from being adding up , this might fix the issue, if there's anything im missing please let me know @1ec5

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

step_count=* is probably an outlier as a summable key. Some other keys like hoops=* (for the number of hoops on a basketball court) and capacity=* might be summable in some cases but not others, so I don’t think it would be safe to assume we can sum them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merging two ways corrupts step_count
2 participants