Relation:restriction

From OpenStreetMap Wiki
Revision as of 23:50, 22 November 2008 by Frederik Ramm (talk | contribs) (add some detailed usage hints with the aim of making turn restrictions easy to understand and easy to implement.)
Jump to navigation Jump to search
Public-images-osm logo.svg restriction
France road sign B2b.svg
Description
Used for a set of tags and members to represent a turn restriction. Edit this description in the wiki page. Edit this description in the data item.
Group: Restriction
Members
  • way - from
  • way - to
  • way node - via
  • node - location_hint
Status: de facto

This is a proposal for a set of tags and members making a Relation to represent a turn restriction at a junction or other restrictions (you don't have to be turning - you may not be allowed to go straight on - e.g. a bus gate is a kind of junction where the restriction is no passage from one side to the other - except for buses of course).

There may be several turn restrictions at a junction, represented by separate relations.

There is no need to model no turning into the wrong way of a one way street - we take this for granted.

List of current restriction relations in the database - [1].


Tags

Key Value Discussion
type restriction
restriction no_right_turn / no_left_turn / no_u_turn / no_straight_on / only_right_turn / only_left_turn / only_straight_on / only_left_right / no_halfright

so that a renderer could place an appropriate icon/sign, or a route planner verbalise the restriction. (Proposed icon for "only_right_turn": [[2]]) (Source for other traffic signs used in that context: [[3]])
Please join this discussion.
Note to implementors of routing algorithms. You do not have to parse the "restriction" attribute fully, but you will have to look at the first word. If it starts with "no_", then you know that no routing is possible from the "from" to the "to" member, and if it starts with "only_", then you know that the only routing originating from the "from" member leads to the "to" member.
Note to mappers. The "from" and "to" members must start/end at the "via" node. If you want to add a turn restriction to an intersection of two ways (e.g. "no left turn"), you will have to split both ways at the intersection node so that you can make the correct part a member of the relation. Avoid using ways as the "via" member unless you absolutely have to - not all routing implementations will support ways as "via" members. You are on the safe side if your "via" member is a node.
Note to implementors of validation software. You can check whether the "from" and "to" members really start/end at the "via" member and flag it as an error if the "from" or "to" members are not split at the intersection. The "via" object must touch one end of the "from" and one end of the "to" member.

except psv / bicycle / hgv / motorcar The restriction does not apply to these vehicle types (possible more than one: except=bicycle;psv
day_on day of week for example, no right turn in the morning peak on weekdays might be day_on=Monday;day_off=Friday;hour_on=07:30;hour_off=09:30
day_off day of week
hour_on time of day
hour_off time of day
(and other similar ones from Map_Features)

Members

Way or Node Role Recurrence? Discussion
way from one a way from which restriction starts (e.g. no right turn from here)
way to one the other end of the restriction
way node via one or more the nodes and or ways between the end points across which you would travel if the turn weren't restricted - may just be the simple intersection of the two ways, or consider a dual carriageway where you can't turn across it, where via would be the nodes on each carriageway and/or the little way connecting the two carriageways.
node location_hint optionally one a hint to a renderer as to where might be a good place to position a symbol indicating the restriction. e.g. in a N/S/E/W cross roads where you can't turn from S to E, you might put a node just SE of the junction and the renderer might place a no right turn sign there.

See Also