Modify

Opened 3 years ago

Last modified 2 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 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 2 years ago.
add code to check for self-intersection or self-crossing ways
21154-core.patch (6.0 KB ) - added by GerdP 2 years ago.
possible patch for JOSM core to perform geometry checks on a way

Download all attachments as: .zip

Change History (7)

comment:1 by skyper, 3 years ago

Description: modified (diff)

comment:2 by GerdP, 2 years ago

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 2 years ago by GerdP (previous) (diff)

comment:3 by GerdP, 2 years ago

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.

by GerdP, 2 years ago

Attachment: 21154.patch added

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

comment:4 by GerdP, 2 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 GerdP, 2 years ago

Attachment: 21154-core.patch added

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

comment:5 by GerdP, 2 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;
            }

Modify Ticket

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

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.