openstreetmap / iD

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

Train users how to create multipolygons with holes #3610

Open simonpoole opened 7 years ago

simonpoole commented 7 years ago

Seems as if some users are using the area tool in a slightly unexpected way:

fake_inner

While not strictly illegal in the OSM data model, it is likely something that iD should catch in one way or the other (only the outer node is shared in the example). The question is, naturally, if iD should create the inner ring automatically or not. In any case joining nodes as in this example should not be possible.

pnorman commented 7 years ago

Topologically, is it the same as

image

It seems likely that they're trying to do this

image

So maybe the issue is that the method to create areas with holes isn't discoverable?

note: the correct way to represent the latter is

image

But this requires manually editing the tags.

1ec5 commented 6 years ago

Perhaps we could add a validator warning about self-intersecting areas, by checking whether a node ID is repeated within a way? There are some valid self-intersecting areas, such as the one that @pnorman points out. But I wonder if we can detect this case:

only the outer node is shared in the example

Let’s call the repeated node A. In this example, a node adjacent to A is far from A but near another edge of the area. Sounds like something that could be cobbled together using turf-point-to-line-distance, but I haven’t considered performance.

bhousel commented 6 years ago

After I merge #4602, users won't be able to draw self intersecting polygons anymore.

It will still be possible for someone really dedicated to manually construct a multipolygon like this out of ways and relations, but at least casual users will be discouraged from creating them with the area drawing mode.

That still doesn't really solve the problem of training users to do the right thing to create a hole. So I'll leave this issue open until we have added some better help text and/or training in the walkthrough.