Id: Prevent self-intersecting lines without a junction node?

Created on 2 Jan 2018  Ā·  13Comments  Ā·  Source: openstreetmap/iD

Following #4602 , iD won't allow users to draw self intersecting polygons anymore:

self intersecting polygon

This would be really easy to do for lines too. I just didn't include it because I wasn't completely sure if there is a valid use for this in OSM:

self intersecting line

Is a line that self intersects (without a junction node) always an error?

question

Most helpful comment

Perhaps let power users override it by holding some modifier key.
Like in JOSM you can prevent newly created points from snapping to existing ways by holding CTRL.

All 13 comments

I don't think we should disallow self intersecting lines, as I use it to map things like carparks..
Example:

Yes @JamesKingdom - self intersecting lines _with a junction node_ are common and valid.. I'm asking about the case of _without a junction node_.

We can put up the nope 🚫 cursor if the user tries to cross their line without adding a junction node.

Another thought: for power infrastructure mapping, it's probably normal for wires and busbars to cross over themselves without a junction point.

I’m not sure if it’s valid, but I’ve seen some spiraling staircases mapped as single ways that double back on themselves without intersecting:

http://www.openstreetmap.org/way/147561713
http://www.openstreetmap.org/way/147561712

Perhaps let power users override it by holding some modifier key.
Like in JOSM you can prevent newly created points from snapping to existing ways by holding CTRL.

Perhaps let power users override it by holding some modifier key.
Like in JOSM you can prevent newly created points from snapping to existing ways by holding CTRL.

Alt/Option does the same thing in iD. I like this idea: Alt/Option would become sort of a ā€œforce it to go hereā€ modifier. Though I’m not sure what to do about the case where the user still wants to snap after doubling back on the way.

I really loved if ID could NOT allow self intersecting lines of any kind without a junction node not just for polygons, but any kind of "ways"

I’m not sure if it’s valid, but I’ve seen some spiraling staircases mapped as single ways that double back on themselves without intersecting:

This is a great example, you could have a bridge that circles back on itself so you end up with a single way with a self intersection without a junction node. Now ideally these would be split into non-self intersecting sections with a layer tag to know the actual order, but I think iD shouldn't prevent someone mapping it out as a single way.

This isn't quite it but a close example:
https://www.mapillary.com/app/?lat=-33.817064583333284&lng=151.2013371388889&z=17&pKey=pYSPbO5JFJcL8CyxdMb3WA&focus=photo&x=0.8825145612600467&y=0.5257477211896819&zoom=0

Alt/Option does the same thing in iD. I like this idea: Alt/Option would become sort of a ā€œforce it to go hereā€ modifier. Though I’m not sure what to do about the case where the user still wants to snap after doubling back on the way.

I prefer Ctrl like in JOSM, as Alt+Mouse on my window manager moves the whole window if dragging and detaches it from the grid if clicking. (I'm talking about on a PC keyboard)

https://en.wikipedia.org/wiki/Spiral_(railway)

I think there's at least one in China which is all-underground. Generally I guess you'd split these to have layer tags, but a single self-crossing way would be reasonable as a first pass. Still, it's pretty much a one-in-a-million edge case, and I like @mvexel's suggestion of a modifier key.

Now ideally these would be split into non-self intersecting sections with a layer tag to know the actual order

I think the rationale in cases like these is that the incline tag already implies the correct layering, but yeah, splitting the way up would be more convenient for some data consumers.

Alt/Option does the same thing in iD. I like this idea: Alt/Option would become sort of a ā€œforce it to go hereā€ modifier. Though I’m not sure what to do about the case where the user still wants to snap after doubling back on the way.

Thanks for your feedback everyone!.. I added this šŸ‘

iD will prevent you from drawing self-intersecting lines, but you can still override the geometry check by holding down Alt/Option.

I've found a use case for self-intersecting lines, areas, multipolygons, or whatever. When I'm fixing a badly-traced object, I'll usually have nodes flying all over the place as I get them out of the way of my work. It's much easier if I can have things temporarily self-intersecting.

(Incidentally, holding down "Alt" won't let me override the default behavior: my window manager uses "Alt+Click" to drag windows.)

I agree that permitting self-intersectiong lines should be possible even if it requires a modifier key before clicking a new point position that creates such intersection.. So yes "Alt+Click" is OK: the user normally knows it adds a self intersection.
But most quality controls should be done in the final validation step before sending: these self-intersections can be warned and listed before proceeding to confirm the data submission: a user may forget that he created and left a self-intersecting way.

The warning may be avoided automatically if the way is marked as "inclined" (spiraling highway in underground tunnels or within buildings, typically for parkings, where some levels in the spiral may not be publicly accessible so you'll turn several times and won't want to map every level), or as outdoor and indoor "stairs" (or "steps") (including stairs around towers to reach an elevated platform or sometimes the level for a bridge built between buildings (over streets or rivers) or from a tower building to the border of a hilll.

Was this page helpful?
0 / 5 - 0 ratings