User:Ömmes/Wayparts
Purpose of Wayparts
Wayparts should make it possible to define a way not only by its position, function etc. but by seperating it into different parts. These parts will be lanes for "normal" traffic, cycleways, footways, parking lanes and so on. It is possible to add as many parts to a way as needed. Each waypart can contain tags to describe it in particular, i. e. access, function, width, divider and so on.
To be flexible with the definition of wayparts, the parts are created as relations. A relation can be of the type "waypart" for a single part of a way or "wayparts" to define one or more parts in a grouped relation.
Each relation contains at least one member: the way it belongs to. Additional members can be a start node and an end node. With these nodes it is possible to "split" a single way in different waypart "sections" without having to split the way in real (e. g. a single way starts with 2 wayparts, from the middle till the end it has 3 parts). Also more then tow or more contiguous ways can be member of the same waypart(s) by adding them as members and selecting the start node from the first and the end node from the last way of the sequence. Therfore the waypart is not depended to the direction of a way if start and end nodes are set.
Defining wayparts
Each part of a way - a waypart - gets its number to indicate the ordering. Positive numbers define forward parts (usually on the right side of the road), negative numbers mean backward parts.
A relation of the type wayparts is meant to define the "default" parts of a way, i. e. the parts which follow the way for a longer distance. A single waypart might be used to add an extra part to the way.
Example: A motorway with 2 lanes and some exits/exit lanes. The 2 main lanes go into a wayparts relation, each of the exit lanes will be added as a waypart (using a start and end node).
waypart relation (a single part)
Tags
Key | Mandatory | Value | Explanation |
---|---|---|---|
type |
yes | waypart | Always "waypart" |
part |
yes | Number/Text | positive (forward) or negative (backward) Number. May be extended by characters or decimals, e.g. 1, 1.2, -1, -1b. |
parttype |
no | Text | Typically a highway value, e. g. cycleway, footway. If not set it's assumed to be the same as the way. Other values may be something like "grass_strip" |
divider |
no | Text | The divider is drawn on the inner side of the part. Examples: line, doubbleline, dash, doubbledash, curb, none |
outer_divider |
no | Text | Same as divider but drawn on the outer side of the part. |
(outer_)divider:width |
no | Text | Width of divider in meters |
(outer_)divider:crossable |
no | Text | yes, no or list of access types (e. g. "foot;bicycle"). Common dividers like a solid line should be defined with an implicit crossable value. If the value differs it could and should be tagged. |
direction |
no | Text | oneway, opposite, both, variable. Default is oneway except for footways.
The direction is relative to start and end node (see below). So forward parts will point from start to end and backward parts from end to start, by default as oneway. So an "opposite backward part" will be accessible from start node to end node. |
direction_hint |
no | Text | left, right, straight on, half left, half right etc. May be used to draw an arrow if the waypart is visualised |
destination |
nein | Text | Destination, i. e. what is mentioned on the according sign |
width |
no | Number | The width of the part in meters |
other way tags | no | access, surface and so on |
Members
wayparts relation (one or more parts)
A wayparts relation adds one or more parts to a way. The simplest use is setting a value for parts
.
Individual parts can be tagged as partX
and part-X
where X is the part number. Additional tags can be set as partX:key
and part-X:key
.
Tags
Key | Mandatory | Multiple | Value | Explanation |
---|---|---|---|---|
type |
yes | no | wayparts | Always "wayparts" |
parts |
yes, if no individual parts are tagged | no | Number | Amount of automatically created parts. Usefull if there are lanes with same properties. The number will be seperated in backward and foward parts. Even numbers result in the same number of ways for forward/backward, odd numbers have 1 forward way more than backward. |
parts:forward |
no | no | Number | Amount of automatically created parts in forward direction. (Overrides the calculated value from parts .)
|
parts:backward |
no | no | Number | Amount of automatically created parts in backward direction. (Overrides the calculated value from parts .)
|
keys... |
no | yes | Text | Additional (default) tags for all parts.
Possible tags are the same as for a single waypart ( |
partX |
no | yes | Text | The parttype for forward part number X. Typically a highway value, e. g. cycleway, footway. If not set it's assumed to be the same as the way. Other values may be something like "grass_strip" |
part-X |
no | yes | Text | The parttype for backward part number X. Typically a highway value, e. g. cycleway, footway. If not set it's assumed to be the same as the way. Other values may be something like "grass_strip" |
partX:keys... |
no | yes | Text | Additional tags for forward part number X.
Possible tags are the same as for a single waypart ( |
part-X:keys... |
no | yes | Text | Additional tags for backward part number X.
Possible tags are the same as for a single waypart ( |
Members
Examples
Trunk link
| E | <==============]|[======== a, b, c, d: Nodes ]D[ ==a=====b== A =]|[=======> A, B, C, D, E: ways \_____ | B \ C \| c | d | |
Way A
highway=trunk, oneway=yes
Way B highway=trunk_link, oneway=yes
Way D highway=primary, bridge=yes, layer=1
Motorway link (live example)
I added waypart relations to the motorway link A 2/B 239 "Herford/Bad Salzuflen", see Changeset 3125502
http://www.openstreetmap.org/?lat=52.0914&lon=8.6951&zoom=13
Just download that area with JOSM, it should look like this with active Wayparts plugin:
JOSM plugin
The JOSM plugin for Wayparts is in an early state, but you can try it:
Download: http://www.ömmes.de/osm/wayparts.jar
Copy the file to your JOSM plugin directory: see http://wiki.openstreetmap.org/wiki/JOSM/Plugins#Manually
Use the JOSM latest version. As the current version is somehow broken, use this one: http://josm.openstreetmap.de/download/josm-snapshot-2447.jar
Usage
The plugin adds a layer which displays the Wayparts of the active edit layer. You can remove the Wayparts layer but actually not add it again unless you load data into a new edit layer.
Known issues
- Wayparts on closed ways/streets are not detected and might end up in an error
- Gaps between way members (i. e. a way is not connected to the next) of a Waypart relation will be rendered as if there was a way between the two member ways
Overlapping Waypart relations defined in opposite direction are rendered on the wrong side--Ömmes 18:50, 16 November 2009 (UTC)Overlapping Waypart relations might not be rendered with divider--Ömmes 18:50, 16 November 2009 (UTC)- If something is deleted or added all Wayparts are parsed again. This might be slow...
- Only cycleway, footway and grass_strip are rendered different then streets
- Only dash, doubbledash, line, grass_strip and curb are rendered as divider
- "to" members of a Waypart relation is not taken into account for rendering, so the lanes may start or end at wrong other lanes
Todo
- Define strokes and colors in XML file
- Improve performance on data changes
- Fix known issues
- Integrate an Waypart editor
- Proposed_features/lane_and_lane_group
- Relations/Proposed/Segmented_Tag
- Relations/Proposed/Area
- Proposed_features/specifying_the_highwaytype_for_a_lane
- Relations/Proposed/Lane
- Users:cmuelle8/multiple way tagging on single geometry
- Vorschlag Mittelstreifen und Seitenbereiche
- WikiProject Germany/Workshops/Linienbündel
- User:Santiago1504/MultiLane
- DE:Lane Assist
- DE:Key:lanes