wiki:Help/Plugin/TurnRestrictions

Languages:

Plugin -> Turn Restrictions

source:osm/applications/editors/josm/plugins/turnrestrictions/images/preferences/turnrestrictions.png

Introduction

In OpenStreetMap a turn restriction limits navigation options. It represents the restriction that one cannot navigate from a way to another way. For instance, the turn restriction depicted below forbids to drive straight. Vehicles have to turn left at the junction where the two ways meet (the so called via-node). Turn restrictions are important for routing and navigation software which are based on OSM data.

The turnrestrictions plugin supports editing of turn restrictions. It consists of two major components:

  1. Turn Restriction Panel - the turn restrictions panel is displayed on the right in sidebar. It displays the list of turn restrictions in the current data set and allows to create or delete turn restrictions, or to launch the Turn Restriction Editor to edit a turn restriction.
  2. Turn Restriction Editor (Alt+Shift+2) - the Turn Restriction Editor is a special purpose editor for turn restrictions.

Tagging model

Turn restrictions a standard map feature decribed on the OSM wiki.

Technically, a turn restriction is an OSM relation. A turn restriction

  • must have a relation member with role from referring to a way. We call this way the from-way.
  • must have a relation member with role to referring to a way. We call this way the to-way.
  • must have at least one relation member with role via referring to a node or way. We call these objects via-object.

Use Cases

Creating a turn restriction

There are several possibilities to create a new turn restriction. First, you can lauch the Turn Restriction Editor for a new turn restriction from the Turn Restriction Panel:

  1. Click on source:trunk/resources/images/new.svg in the Turn Restriction Panel. Alternatively, select source:trunk/resources/images/new.svg New from the popup menu.

Alternatively, you can launch a new editor with a keyboard shortcut:

  1. Press the shortcut for creating or editing a turn restriction. On most platforms the shortcut is Alt+Shift+2.
  2. If objects in the current JOSM selection already participate in a turn restriction, the following window pops up.


Just click on source:trunk/resources/images/new.svg Create new turn restriction to launch the turn restriction editor for a new turn restriction. Alternatively, press the key N or hit Enter.

In both cases, the turnrestrictions plugin initializes the new turn restriction with objects from the current JOSM selection:

  1. The first selected way in the JOSM selection becomes the from-way.
  2. The last selected way in the JOSM selection becomes the to-way
  3. If the from- and to-way have a node in common, this node becomes a via-object.

A fast way to create a turn restriction is therefore to

  1. Select the from- and to-way in JOSM
  2. Press Alt+Shift+2
  3. Choose the type of the turn restriction and save it.

Editing a turn restriction

There are several possible ways to launch a Turn Restriction Editor in order to edit a turn restriction. First, you can lauch the Turn Restriction Editor for an existing turn restriction from the Turn Restriction Panel:

  1. Select a turn restriction in the Turn Restriction Panel
  2. Click on source:trunk/resources/images/dialogs/edit.svg. Alternatively, select source:trunk/resources/images/dialogs/edit.svg Edit from the popup menu.

Second, you can launch a new editor with a keyboard shortcut:

  1. Press the shortcut for creating or editing a turn restriction. On most platforms the shortcut is Alt+Shift+2.
  2. If objects in the current JOSM selection already participate in a turn restriction, the following window pops up.


Just double-click on the turn restriction you want to edit. Alternatively, for the top 9 turn restrictions displayed in the popup window you can use the shortcuts 1 to 9 to launch the Turn Restriction Editor. In the example above, you would press 1 to start editing.

A fast way to edit a turn restriction is therefore to

  1. Select the from- or to-way in JOSM
  2. Press Alt+Shift+2
  3. Type 1 to launch the Turn Restriction Editor

Deleting a turn restriction

There are several possible ways to delete a turn restriction. First, you can delete it in the Turn Restriction Panel:

  1. Select a turn restriction in the Turn Restriction Panel
  2. Press DEL or click on source:trunk/resources/images/dialogs/delete.svg. Alternatively, select source:trunk/resources/images/dialogs/delete.svg Delete from the popup menu.

Alternatively, you can launch a Turn Restriction Editor and click on source:trunk/resources/images/dialogs/delete.svg in its toolbar.

Turn Restriction Panel

The Turn Restriction Panel helps you to keep track of the turn restrictions in the current edit layer.

Here's a screenshot of the panel and its popup menu:

If you tick the checkbox Only participating in selection the dialog displays only turn restrictions in which objects from the current selection are participating. If the checkbox isn't selected, then all turn restrictions in the current edit layer are displayed.

You can apply some commands to the turn restrictions displayed in this dialog.

CommandDescription
Create a new turn restrictionClick source:trunk/resources/images/new.svg or select source:trunk/resources/images/new.svg New from the popup menu.
Edit a turn restrictionSelect the turn restriction and click source:trunk/resources/images/dialogs/edit.svg or select source:trunk/resources/images/dialogs/edit.svg Edit from the popup menu.
Delete a turn restrictionSelect one or more turn restrictions, press DEL, or click on source:trunk/resources/images/dialogs/delete.svg or select source:trunk/resources/images/dialogs/delete.svg Delete from the popup menu.
Select the turn restrictionIn order to select the turn restriction and its members in the current edit layer, first select the turn restriction in the list and then select source:trunk/resources/images/selectall.svg Select in current data layer from the popup menu.
Zoom to the turn restrictionSelect the turn restriction in the list and then select source:trunk/resources/images/dialogs/autoscale/selection.svg Zoom to from the popup menu.

Turn Restriction Editor

The Turn Restriction Editor allows you to create and edit turn restriction. It provides two user interfaces:

  • a Basic Editor. This is a special purpose user interface for editing the properties of a turn restriction.
  • an Advanced Editor. This is a generic user interface for editing the raw data elements of the OSM relation which represents a turn restriction.

You can use either of these user interfaces. Regardless of whether you use the Basic Editor or the Advanced Editor you should make sure that the resulting turn restriction is valid. The turn restriction editor checks the turn restriction and shows error messages and warnings in a third user interface, i.e. the list of issues.

Basic Editor

The Basic Editor allows you to set the from-way, the to-way, and exceptions to the turn restriction for a selection of vehicle types.

In order to set the from-way

  1. Select a way in the current edit layer
  2. Drag it from the list of selected objects (on the left in the editor) onto the input field From:

Alternatively, you can

  1. Select a way in the current edit layer
  2. Copy it (using Ctrl+C or source:trunk/resources/images/copy.svg Copy in the popup menu) in the list of selected objects on the right of the Turn Restriction Editor
  3. Click on the From: field and paste the copied way (using Ctrl+V or source:trunk/resources/images/paste.svg Paste from the popup menu)

In the standard configuration, via-objects aren't displayed in the Basic Editor. You have to switch to the Advanced Editor to edit them. In the preferences for the turnrestrictions plugin you can change the default configuration, though. Launch the preference dialog and enable displaying/editing of via-objects in the Basic Editor.

The following screen shot shows the Basic Editor configured to display/edit via-objects too.

Advanced Editor

The Advanced Editor allows you to edit the raw OSM data, i.e. the tags and the relation members of the relation representing the turn restriction.

Editing the tags

In the upper half of the Advanced Editor you can edit the tags of the turn restriction. You can add tags with arbitrary keys and values but please note that some tags have a special meaning in turn restrictions:

Editing the members

In the lower half of the Advanced Editor you can edit the members of the turn restriction relation.

In addition to the from-way and the to-way, which you can edit in the Basic Editor too, you can also enter via-objects. (The role location_hint is deprecated as it is not verifiable on the ground).

To add members just drag-and-drop or copy/paste objects from the JOSM selection view on the right to the list of relation members.

You can reorder the relation members:

  1. Select one or more members
  2. Press Alt-Up to move them up by one position. Alternatively you can select Move up from the popup menu.

Press Alt-Down to move them down by one position. Alternatively you can select Move down from the popup menu.

To edit the role of a relation member

  1. Double-click on the table cell with the role
  2. Edit the role and press ENTER

Resolving Errors and Warnings

Preferences

To launch the preferences panel for the turnrestrictions plugin:

  1. Click on source:trunk/resources/images/preference.svg in the JOSM toolbar or press F10.
  2. Click on source:osm/applications/editors/josm/plugins/turnrestrictions/images/preferences/turnrestrictions.png to display the preferences panel for the turnrestrictions plugin

Preferences without shortcut

Select icon set for road signs

The turnrestrictions plugin uses one of two icon sets for the type of turn restrictions. In the preferences panel you can configure which icon set should be used, see screenshot above.

Toggle editing of via-objects in the Basic Editor

Most turn restrictions entered in OSM have a simple structure. They restrict navigation from one way to another where the two ways have exactly one node in common. This node becomes the only via-object in the turn restriction. In most cases it isn't necessary to display and/or edit it in the Basic Editor. In order to keep simple things simple, the default configuration is therefore not to show via-objects in the Basic Editor.

You can override the standard setting, though. If you tick the respective checkbox in the preferences (see screen shot above) the list of via-objects is displayed in the Basic Editor too.

See also


Back to Plugin Help
Back to Main Help

Last modified 3 years ago Last modified on 2021-08-26T18:43:07+02:00

Attachments (10)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.