Modify

Opened 13 months ago

Last modified 10 months 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 skyper)

What steps will reproduce the problem?

  1. Have a closed way
  2. Draw a new way between two nodes of the closed way crossing the closed way (area outline), example file
  3. Select the new unclosed way
  4. 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)

21154.patch (2.2 KB) - added by GerdP 10 months ago.
add code to check for self-intersection or self-crossing ways
21154-core.patch (6.0 KB) - added by GerdP 10 months ago.
possible patch for JOSM core to perform geometry checks on a way

Download all attachments as: .zip

Change History (7)

comment:1 Changed 13 months ago by skyper

Description: modified (diff)

comment:2 Changed 10 months ago by GerdP

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.

Last edited 10 months ago by GerdP (previous) (diff)

comment:3 Changed 10 months ago by GerdP

In 35833/osm:

see #21154
Don't deny split with message "The selected nodes can not be consecutive nodes in the object." when a splitway is used that has more than two nodes.

Changed 10 months ago by GerdP

Attachment: 21154.patch added

add code to check for self-intersection or self-crossing ways

comment:4 Changed 10 months ago by GerdP

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.

Changed 10 months ago by GerdP

Attachment: 21154-core.patch added

possible patch for JOSM core to perform geometry checks on a way

comment:5 Changed 10 months ago by GerdP

With the core patch the code in the plugin could look like this:

            for (Way w : ds.getSelectedWays()) {
                if (!OsmValidator.validateGeometry(w, true))
                    break;
            }

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to skyper
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.