openstreetmap / iD

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

When adding Turn Restrictions, split the from and to ways near the intersection #5000

Open bhousel opened 6 years ago

bhousel commented 6 years ago

This is a request from several teams working with turn restrictions (including Mapbox and others). It would be useful to split turn restriction from/to ways near the turn restriction intersection.

split_at_junctions

The benefits here include:

For example:

It's pretty easy to tell what was changed here because the turn restriction is scoped tightly to the intersection:

screenshot 2018-04-19 09 57 39

Not so much for this one, which covers a large portion of Detroit:

screenshot 2018-04-19 09 58 20

(Both changes were made with iD - the first example just happened to involve ways that were already split around there).

cc @maning @planemad

iandees commented 6 years ago

If iD splits the way to limit the scope of the turn restriction, won't that changeset's bounding box will still be big (because the split way will force the changeset bbox to include the original way)? Future changesets that modify the turn restriction will be smaller, of course.

bhousel commented 6 years ago

If iD splits the way to limit the scope of the turn restriction, won't that changeset's bounding box will still be big (because the split way will force the changeset bbox to include the original way)? Future changesets that modify the turn restriction will be smaller, of course.

Yes, the bounds of the changeset will still be just as big - the extent of the change to the ways will be large - but the bounds around the restriction will be small.

Mostly the thing we are trying to avoid is the Detroit screenshot above. It was from OSMCha, but you would see the same thing in JOSM or on openstreetmap.org/relation/ when looking at a turn restriction relation:

screenshot 2018-04-19 10 29 11

https://www.openstreetmap.org/relation/8223161#map=13/42.3946/-82.9343

iandees commented 6 years ago

Yep, I'm just saying that the changeset bounding box (the Detroit screenshot above) would not change if iD split the way.

mmd-osm commented 6 years ago

I put up an Overpass query on our dev server to identify such super large TRs:

http://overpass-turbo.eu/s/y4X - http://overpass-turbo.eu/s/y4Z

Maybe that's useful to identify some interesting test cases. Sometimes a good place to split isn't just around the corner: https://www.openstreetmap.org/relation/5964280 // https://www.openstreetmap.org/relation/6624808 // https://www.openstreetmap.org/relation/2284413 // https://www.openstreetmap.org/relation/4156212 (60km!)

bhousel commented 6 years ago

Yes, that's an excellent example @mmd-osm 😱 I think choosing a place to split could be defined by some rule like

Nakaner commented 6 years ago

I think that this adds an unnecessary change to the from/to way. Please keep in mind that splits and merges of objects are difficult to track with OSM API 0.6.