Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent self-intersecting lines without a junction node? #4646

Closed
bhousel opened this issue Jan 2, 2018 · 13 comments
Closed

Prevent self-intersecting lines without a junction node? #4646

bhousel opened this issue Jan 2, 2018 · 13 comments
Labels

Comments

@bhousel
Copy link
Member

@bhousel bhousel commented Jan 2, 2018

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?

@JamesKingdom
Copy link
Collaborator

@JamesKingdom JamesKingdom commented Jan 2, 2018

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

@bhousel
Copy link
Member Author

@bhousel bhousel commented Jan 2, 2018

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.

@bhousel
Copy link
Member Author

@bhousel bhousel commented Jan 2, 2018

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

@1ec5
Copy link
Collaborator

@1ec5 1ec5 commented Jan 2, 2018

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

@mvexel
Copy link
Contributor

@mvexel mvexel commented Jan 2, 2018

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.

@1ec5
Copy link
Collaborator

@1ec5 1ec5 commented Jan 2, 2018

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.

@jjiglesiasg
Copy link

@jjiglesiasg jjiglesiasg commented Jan 3, 2018

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"

@andrewharvey
Copy link
Contributor

@andrewharvey andrewharvey commented Jan 7, 2018

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)

@systemed
Copy link
Collaborator

@systemed systemed commented Jan 7, 2018

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.

@1ec5
Copy link
Collaborator

@1ec5 1ec5 commented Jan 7, 2018

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.

@bhousel
Copy link
Member Author

@bhousel bhousel commented Jan 9, 2018

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.

@Carnildo
Copy link

@Carnildo Carnildo commented Jan 16, 2018

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.)

@verdy-p
Copy link

@verdy-p verdy-p commented Jan 22, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants