Simple editor for turn restrictions

What could be an easy turn restriction editor?

In our community, a person is notifying about incorrect turns and he could create them with a simple editor. But i only know complex editors like id, josm o vespucci for that simple thing. Btw, he is a user nad he is not looking to become an epxert mapper.

id would be the answer. It’s not “complex” like you’re implying it is, it’s actually exceptionally painful to use for more than trivial edits like the one you’re discussing.

2 Likes

Mapping is easy when you already map. But explaining the UI, the way, relation and member concepts, the changesets, to someone that doesn’tnot map is very difficult. The learning curve is high, and there is no tutorials for this particular case.

This is not a tool like streetcomplete or even every door, where simplicity and a subset of options is privileged for usability. Id is a full mapping tool, and from the mobile phone is even more complex to use.

That what I was asking that, something for the masses, simple and only focussed on this relation type.

1 Like

I agree, basic OSM knowhow is necessary to use OSM-edit tools, and turn restrictions OSM-style are not easy without the basic knowhow.
Question is, can you describe an approach which would be easy to understand for a non-OSM-er?

Somehow the user needs to indicate from where, to where, at what exact point. It’s not enough to pin a general “No U-turn” marker on a map.

1 Like

None of this is needed knowledge in order to map a turn restriction in id. Select the intersection node, and a turn restriction pane just opens automagically on the left with a fairly intuitive visual editor that deals with all that for you.

Unfortunately the approach with ID that you describe might break history and also many changes are displayed instead of just one relation that should be added. Furthermore there are problems when viewing and editing turn restrictions that are valid e.g. only for hgv. There are more issues and they are the reasons that adding turn restrictions can get complex. Another related issue is that the turn restrictions are not yet well integrated when other things are edited. E.g. when changing the involved ways the user not even gets a warning which can lead to broken turn restrictions and there are now thousands of them.

It’s not enough to pin a general “No U-turn” marker on a map.

IMO for simple junctions it should be as simple as that: an icon in the right direction on the map (just like a sign on the road).

And as @AngocA asked for a tutorial and I planned a blog post about it, but never released as it did not feel complete, here is a copy. Maybe the community can comment and improve this approach. I also would prefer to have a simpler method in ID without the mentioned limitations but the matter is a bit tricky if you go into the details and so I can surely understand why ID has not yet implemented this.

Now to the tutorial…

Add turn restrictions “manually”:

A turn restriction is a relation between ways and nodes. Let’s start with the most basic work:

Add Turn Restriction: No Left Turn

What you need to forbid left turns is a relation that contains the start way, the via node and the destination way (“the left turn”). Click the way where the turn restriction should start and on the left sidebar scroll down to the “Relations” and click the + button.

Then click into the input “Choose a parent relation” and select “New relation”:

Search for “left” and select “no left turn”:

The relation has now a single entry in the “Members” list, where have to enter the “Role” as “from”:

Now you need to add two members to the relation: the “via” node and the “to” way.

To add the “via” node you click on the node (the junction where the turn is forbidden), click the + button in the relations and select the “No Left Turn” relation:

and set the “Role” as “via”:

For the last member (“from” way) you click on the destination way, click again the + button, click into the “Choose parent relation”:

Now select the “No Left Turn” relation again and set the “Role” as “to”:

Click on “No Left Turn” in the relation list to review your edits. Now you successfully created a turn relation with 3 members:

The order of the members does not matter, this is the reason you always assign the correct “Role” (from, via, to).

You can now upload these changes via clicking on the “Save” button in the top right corner and enter a Changeset comment. And routing services like GraphHopper will consider all changes typically after the a few days.

Add Turn Restriction: No Straight On

In this section a more complex turn restriction is created, but as you’ll see it is nearly identical to the “No Left Turn” example. In our example a truck can turn left and right, but the straight turn is slightly shifted which makes it dangerous/impossible for a lengthy truck to turn there and therefor it is forbidden.

One difference to the previous example is that the second member is not a node, but a way and the second difference is that this restriction should be applied only to heavy good vehicles (hgv).

To start, click the start way and on the left sidebar scroll down to the “Relations” and click the + button. In this case there are already two other relations but they do not matter for your new turn relation. Click inside the “Choose a parent relation”:

Select “New relation…” and search for “straight”:

Select “No Straight Ahead”. Under “Members” change “Role” to “from”:

Now click the middle way (“via way”) which in our case is a very short segment and under “Relations” click the + button. Click inside the “Choose a parent relation”:

And select the previously created “No Straight Ahead” relation. Set the “Role” to “via”:

And finally click on the destination way. There, under “Relations”, click the + button:

And again choose the “No Straight Ahead” relation:

And set the “Role” as “to”:

Now click the “No Straight Ahead” relation and for a general restriction you would already be finished. But we want to limit the turn restriction to “hgv” only. For that click on the “restriction” key in the “Tags” list and change “restriction” to “restriction:hgv” and review all your changes:

Now you are ready and you can submit your changes to OpenStreetMap via clicking on the “Save” button in the top right corner.

Tips When Working With Turn Restrictions

Too Long Ways

If there is a rather long way involved where it is likely that it will be split later it might be worth to split the way. This reduces the problems in the future for this particular turn restriction. To do this double click on the way to create a node or just select a node if it already exists. Now right click this node and select “Split”:

Now you can select the shorter way e.g. as a start for your turn restriction:

Too Many Data Displayed

Another problem I faced was that a boundary was hiding a way. If that’s the case you can easily hide them in the settings box on the right side:

1 Like

A lot to unpick here …

@karussell do you have any stats on “error” types?

In quotes because a lot of them seem to be a misunderstanding: just as with normal conditional (that is outside of turn restrictions), the use of the non-conditional tag as the default value is IMHO legit and should be supported be a data consumer.

The other major issue seems to be incomplete (missing at least one of from/via/to members) restrictions. The problem there is likely less one of not warning that you are potentially breaking something if you delete one of the members (for example because the road has gone), but because the editor can’t know if this is an intermediate state that you intend to fix or if it is just an oversight, it can’t really automatically delete the relation (see iDs area type for similar intermediate state issues).

I’m assuming that all current editors handle splitting and merging of the restriction members correctly (it is the standard example for geometry operations being tagging dependent), so that is unlikely to be a major source of issues.

Isn’t this (in iD) what you want?

2 Likes

Actually in JOSM it’s beyond easy. Aside from adding the turn restriction plugin which helps to add supplemental tagging, even in the regular relation editor it’s easy. Chose the from way , via point or way(s), to way, hit the plus icon in the relation panel, enter the type=restriction + restriction=type, hit the to-left button to move the pre-selection into the tagging column and add the from-via-to roles. OK & Done.

Regular relation editor screen

Restriction plugin screen

1 Like

I have found OSMPIE, and this could be the answer I was looking for.

1 Like