openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.29k stars 1.19k forks source link

Allow to adjusting nodes of multipolygon objects #9777

Open Sirorezka opened 12 months ago

Sirorezka commented 12 months ago

Description

Hi,

I would propose to adjust some of the settings that make working with multipolygon buildings easier.

Let's say that you have two areas and you combined them into multipolygon and assigned a type to this new object. In my case I've created two building-parts and then combined them into the building using multipoylgon:

object 1:

building=yes
type=multipolygon

object 2: building:part=yes object 3: building:part=yes

Here is an image of my object:

image

Now when I try to move any free nodes or linked nodes in the same relation you will get an error: Areas cannot cross over themselves. Picture below illustrate which edges of the multipolygon I was trying to move:

image

Desired behaviour:

Screenshots

Screenshot 2023-07-14 at 13 32 02 Screenshot 2023-07-14 at 13 26 22 Screenshot 2023-07-14 at 13 33 36
ManDay commented 8 months ago

Do I read the classification wrong or shouldn't that be classified as bug, and as a rather severe one, too? After all, it renders multipolygons ineditable. Plus, the behaviour seems to be erratic: The very same vertex will, with varying probability, sometimes move and sometimes refuse to move.

I found that temporarily disabling the type=multipolygon field by turning it into something like type=nomultipolygon will alleviate the problem, but it's a fairly incovenient workaround.

Before I can look into the issue, what is the rationale behind "Areas cannot cross themselves" message? Is it supposed to be an optional data sanitization or is it something more profound, which is required by iD itself?

For reference, likely the offending code: https://github.com/openstreetmap/iD/blob/c4d1390270291c12bb31af6f8276f9b2f6c9696e/modules/geo/geom.js#L147

cody-somerville commented 8 months ago

Minor mouse movements can temporarily present the action as valid, but this illusion is dispelled once the click is released. Unsure if separate issue.

Also, Kudos @ManDay for the insightful tip regarding the temporary modification of type=multipolygon. I've been employing a more cumbersome method where I temporarily removed and then reinstated relationship memberships. While effective, it was much more of a burden and susceptible to errors.

k-yle commented 1 month ago

According to a comment on https://osm.org/changeset/152328345, this geometry is actually invalid. So that would mean that iD's current behaviour is correct...