Opened 4 years ago
Last modified 3 years ago
#21154 new defect
Split Object: Invalid, self-crossing closed ways created
Reported by: | skyper | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Plugin utilsplugin2 | Version: | |
Keywords: | template_report Split Object self-intersecting overlapping ways | Cc: |
Description (last modified by )
What steps will reproduce the problem?
- Have a closed way
- Draw a new way between two nodes of the closed way crossing the closed way (area outline), example file
- Select the new unclosed way
- Split Object
What is the expected result?
A notification about crossing ways and not action
What happens instead?
Two invald, self-crossing ways which additionally overlap are created
Please provide any additional information below. Attach a screenshot if possible.
See #21153 for another problem with overlapping result.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2021-07-21 20:57:29 +0200 (Wed, 21 Jul 2021) Revision:18079 Build-Date:2021-07-22 01:31:13 URL:https://josm.openstreetmap.de/svn/trunk Plugins: + utilsplugin2 (35792)
Attachments (2)
Change History (7)
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
by , 3 years ago
Attachment: | 21154.patch added |
---|
add code to check for self-intersection or self-crossing ways
comment:4 by , 3 years ago
We have similar code in core action AlignInCircleAction
and CombineWayAction
, I'll have a closer look how to reduce the code duplication. I am not sure if we should really deny the action or just show a warning.
by , 3 years ago
Attachment: | 21154-core.patch added |
---|
possible patch for JOSM core to perform geometry checks on a way
comment:5 by , 3 years ago
With the core patch the code in the plugin could look like this:
for (Way w : ds.getSelectedWays()) { if (!OsmValidator.validateGeometry(w, true)) break; }
I agree the split in the top-left example should be allowed.
I can add a check for self-intersection but I'm tempted to say "Garbage in -> Garbage out" for the other cases. JOSM allows to draw these invalid geometries as well and you only get a warning when running the validator.