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

prevent degenerate ways caused by deleting a corner of a triangle #10003

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

k-yle
Copy link
Collaborator

@k-yle k-yle commented Nov 25, 2023

Closes #7946, Closes #9329

@tyrasd had some alternative ideas in #9329 (comment), this PR implements option 1: you can no longer create a degenerate way by deleting the third-last node.

@k-yle
Copy link
Collaborator Author

k-yle commented Nov 25, 2023

edit: unit test fixed by making it more realistic (circularising a triangle)

There's one test failing:

iD.osmWay({id: '-', nodes: ['a', 'b', 'a']})

It's a bit of a weird test, because if you try to use the circularlise operation on a way that loops back on itself (A -> B -> A), nothing happens anyway. I think it's better to change update this test case.

bhousel added a commit to facebook/Rapid that referenced this pull request Nov 29, 2023
@k-yle k-yle added the bug A bug - let's fix this! label Sep 5, 2024
@k-yle k-yle force-pushed the 9329-degenerate-line branch from a33da7b to bba4214 Compare February 4, 2025 09:03
@tyrasd tyrasd added this to the v3.32 milestone Feb 5, 2025
@tyrasd tyrasd merged commit a2e347a into openstreetmap:develop Feb 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create duplicate line segments by deleting node on line. Disallow undoing to a degenerate area
2 participants