Modify

Opened 3 years ago

Last modified 3 years ago

#21153 assigned defect

Split Object: Overlapping areas created

Reported by: skyper Owned by: GerdP
Priority: normal Milestone:
Component: Plugin utilsplugin2 Version:
Keywords: Split Object overlapping ways relations Cc: Woazboat

Description (last modified by skyper)

What steps will reproduce the problem?

  1. Have a closed way or a multipolygon relation
  2. Draw a new way between two nodes of the closed way completely outside of area, or in case of a relation with some parts outside, example file
  3. Select the new unclosed way (and the relation)
  4. Split Object

What is the expected result?

Either the split is denied or better add the outer part as a new closed way connected to the other closed way. For relations only add the former outer part to one relation

What happens instead?

A new closed way/relation is created as expected but additional the former outer part is added two both areas, resulting in overlapping areas.

Please provide any additional information below. Attach a screenshot if possible.

See #21154 for another problem with invalid 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 (4)

josm_SplitObject_examples.osm (3.8 KB ) - added by skyper 3 years ago.
example file
mp_self_intersecting.png (46.2 KB ) - added by Woazboat 3 years ago.
Multiplygon with self-intersecting ways
mp_shared_node.png (48.3 KB ) - added by Woazboat 3 years ago.
The same multipolygon with members reordered to form separate rings with a shared node (but otherwise unchanged)
bad-mp-split.osm (3.5 KB ) - added by GerdP 3 years ago.
another example that gives unexpected result when a multipolygon is split with a split way that is outside of the multipolygon

Download all attachments as: .zip

Change History (11)

comment:1 by skyper, 3 years ago

Description: modified (diff)

by skyper, 3 years ago

example file

comment:2 by skyper, 3 years ago

Cc: Woazboat added
Description: modified (diff)
Keywords: relations added
Summary: Split Object: Overlapping closed ways createdSplit Object: Overlapping areas created

Ah, relations have this problem, too.

comment:3 by Woazboat, 3 years ago

Currently only TestErrors with severity ERROR are considered blocking for multipolygon splitting. This detects split ways that cross any multipolygon ring without connecting to it via a shared node (i.e. the 'self-crossing' example in the test files). Split ways that cross multipolygon rings with shared nodes (i.e. the 'only overlapping' example) are not detected because this is only considered a WARNING and not an error. This could be added as a special case here:

https://josm.openstreetmap.de/browser/osm/applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java#L300

I'm not sure if there's an easy way to detect if a split way is completely outside of the area to split.

in reply to:  3 comment:4 by skyper, 3 years ago

Replying to Woazboat:

I'm not sure if there's an easy way to detect if a split way is completely outside of the area to split.

Is it possible to check the opposite, e.g. is not inside, like the opposite of "All inside area" action? Only the end nodes but no middle node of the "split" way should be "inside" area.

Last edited 3 years ago by skyper (previous) (diff)

comment:5 by Woazboat, 3 years ago

I'm sure there is, I'm just not familiar enough with the JOSM source code to know how that could be done. #18295 is the first time I have worked on JOSM.

On another note, why are self-intersecting multipolygon rings treated as an error if they are crossing without a shared node, but only as a warning if there is a shared crossing node? Maybe the second case should also be promoted to an error. (Although I guess detecting the difference between a self-intersecting ring and different rings sharing a node is problematic as the interpretation can depend on the order of the relation members. Maybe only intersecting ways that don't start/end on an intersection node should be treated as errors since there is no way they could be reordered to form separate rings.)

by Woazboat, 3 years ago

Attachment: mp_self_intersecting.png added

Multiplygon with self-intersecting ways

by Woazboat, 3 years ago

Attachment: mp_shared_node.png added

The same multipolygon with members reordered to form separate rings with a shared node (but otherwise unchanged)

comment:6 by GerdP, 3 years ago

See also https://wiki.openstreetmap.org/wiki/Relation:multipolygon/Algorithm
JOSM doesn't implement the backtracking and I don't know how this could be done. There's a ticket about this but I cannot find it.

by GerdP, 3 years ago

Attachment: bad-mp-split.osm added

another example that gives unexpected result when a multipolygon is split with a split way that is outside of the multipolygon

comment:7 by GerdP, 3 years ago

Owner: changed from team to GerdP
Status: newassigned

With my example I also would expect a warning that the split way is outside of the multipolygon area.
A possible, rather simple check could be to compare the sizes of the covered areas before and after the split. They should not differ much.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain GerdP.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from GerdP to the specified user. Next status will be 'new'.
Next status will be 'needinfo'. The owner will be changed from GerdP 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.

Add Comment


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