[[TranslatedPages]] = turnrestrictions plugin = {{{ #!html

The turnrestrictions plugin is currently under development.
You can download the current version from the OSM SVN. It isn't integrated into JOSMs plugin management feature yet. By 04/2010 you'll be able to download and update it via JOSM preferences too.

}}} [[TOC(inline)]] == Introduction == In OpenStreetMap a '''turn restriction''' limits navigation options. They restrict whether one can navigate from one [wiki:/Help/Concepts/Object way] to another or not. For instance, the turn restriction depicted below forbids to drive straight. Vehicles have to turn left at the junction. [[Image(only_left_turn_sample.png)]][[BR]] 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 Toggle Dialog''' - the turn restrictions toggle dialog is displayed on the right in the Toggle Dialogs Section. 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''' - the Turn Restriction Editor is a special purpose editor for turn restrictions. == Terminology == Technically, a turn restriction is an OSM [wiki:/Help/Concepts/Object relation]. A turn restriction * must have a relation member with role {{{from}}} referring to a [wiki:/Help/Concepts/Object way]. We call this way the '''''from'''''-'''way'''. * must have a relation member with role {{{to}}} referring to a [wiki:/Help/Concepts/Object way]. We call this way the '''''to'''''-'''way'''. * must have at least of relation member with role {{{via}}} referring to a [wiki:/Help/Concepts/Object node] or [wiki:/Help/Concepts/Object way]. We call these objects '''''via'''''-'''object'''. == Use Cases == === Creating a turn restriction === There are several possibilities to create a new turn restriction. Firstly, you can lauch the Turn Restriction Editor for a new turn restriction from the Turn Restriction Toggle Dialog: 1. Click on [[Image(source:/trunk/images/new.png)]] in the Turn Restriction Toggle Dialog. Alternatively, select [[Image(source:/trunk/images/new.png)]]'''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 plattforms the shortcut is '''Ctrl-Shift-T'''. 2. If objects in the current JOSM selection already participate in a turn restriction, the following window pops up.[[BR]] [[Image(create-turn-restriction-popup.png)]] [[BR]] Just click on [[Image(source:/trunk/images/new.png)]] '''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 the ''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 '''Ctrl-Shift-T''' 3. Choose the type of the turn restriction and save it. === Editing a turn restriction === #EditingATurnRestriction There are several possible ways to launch a Turn Restriction Editor in order to edit a turn restriction. Firstly, you can lauch the Turn Restriction Editor for an existing turn restriction from the Turn Restriction Toggle Dialog: 1. Select a turn restriction in the Turn Restriction Toggle Dialog 2. Click on [[Image(source:/trunk/images/dialogs/edit.png)]]. Alternatively, select [[Image(source:/trunk/images/dialogs/edit.png)]]'''Edit''' 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 plattforms the shortcut is '''Ctrl-Shift-T'''. 2. If objects in the current JOSM selection already participate in a turn restriction, the following window pops up.[[BR]] [[Image(create-turn-restriction-popup.png)]] [[BR]] 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 '''Ctrl-Shift-T''' 3. Type '''1''' to lauch the Turn Restriction Editor === Deleting a turn restriction === There are several possible ways to delete a turn restriction. Firstly, you can delete it in the Turn Restriction Toggle Dialog: 1. Select a turn restriction in the Turn Restriction Toggle Dialog 2. Press '''DEL''' or click on [[Image(source:/trunk/images/dialogs/delete.png)]]. Alternatively, select [[Image(source:/trunk/images/dialogs/delete.png)]]'''Delete''' from the popup menu. Alternatively, you can [#EditingATurnRestriction launch a Turn Restriction Editor] and click on [[Image(source:/trunk/images/dialogs/delete.png)]] in its toolbar. {{{ #!comment ********************************************************************************************* Turn Restriction Toggle Dialog ********************************************************************************************* }}} == Turn Restriction Toggle Dialog == The Turn Restriction Toggle Dialog helps you to keep track of the turn restrictions in the current edit layer. Here's a screenshot of the toggle dialog and its popup menu:[[br]] [[Image(toggle-dialog-screenshot.png)]] 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 actions to the turn restrictions displayed in this dialog. ||'''Create''' a new turn restriction|| Click [[Image(source:/trunk/images/new.png)]] or select [[Image(source:/trunk/images/new.png)]]'''New''' from the popup menu|| ||'''Edit''' a turn restriction||Select the turn restriction and click [[Image(source:/trunk/images/dialogs/edit.png)]] or select [[Image(source:/trunk/images/dialogs/edit.png)]]'''Edit''' from the popup menu|| ||'''Delete''' a turn restriction||Select one or more turn restrictions, press '''DEL''', or click on [[Image(source:/trunk/images/dialogs/delete.png)]] or select [[Image(source:/trunk/images/dialogs/delete.png)]]'''Delete''' from the popup menu.|| ||'''Select''' the turn restriction||In 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 [[Image(source:/trunk/images/selectall.png)]]'''Select in current data layer''' from the popup menu.|| ||'''Zoom''' to the turn restriction|| Select the turn restriction in the list and then select [[Image(source:/trunk/images/dialogs/autoscale/selection.png)]]'''Zoom to''' from the popup menu.|| {{{ #!comment ********************************************************************************************* Turn Restriction Editor ********************************************************************************************* }}} == 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 === #BasicEditor The Basic Editor allows you to set the ''from''-way, the ''to''-way, and a list of ''via''-objects. In order to set the ''from''-way 1. Select a way in the current edit layer 2. '''Drag''' it from the list of selcted 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 [[Image(source:/trunk/images/copy.png)]]'''Copy''' in the popup menu) in the list of selcted objects on the right of the Turn Restriction Editor 3. Click on the '''From:''' field and paste the copied way (using '''Ctrl-V''' or [[Image(source:/trunk/images/paste.png)]]''Paste'' from the popup menu) You can also drag-and-drop and copy/paste objects from the list of selected objects in order to set the ''to''-way and the ''via''-objects. [[Image(sample-screen-shot-1.png)]][[br]] === Advanced Editor === #AdvancedEditor [[Image(sample-screen-shot-2.png)]][[br]] === Resolving Errors and Warnings === #ErrorsAndWarnings [[Image(sample-screen-shot-3.png)]][[br]]