User:Marek kleciak/Stairs modelling

From OpenStreetMap Wiki
Jump to: navigation, search

The page describes tagging the stairs for the modeling of stairs in 3D

Usecases: F3DB OSM-4D. This concept allows (regardless of the 3D modeling in F3DB) a better 2D rendering of the stairs in the classical 2D map.


OSM maps are more and more detailed. Large stairs, mostly located outdoors are drawn in OSM maps as simple midlines. More and more users are unhappy about that. This mapping concept allows development of more advanced rendering techniques for 2D maps. With advanced tagging can such steps also act as 3D models.


In order to allow a more precise mapping stairs should be drawn (and supported by rendering software) in 3 different ways:

  1. middle axis vector or polyline highway=steps, with width=* and optionally height=* or
  2. middle axis vector or polyline highway=steps and start and end stairs polyline or
  3. as a combination of middle axis vector or polyline with the closed area=*=steps and optionally area=*=footway.

(Compare with drawing of rivers as area in OSM)


Key Description Value
width=* Width of steps m
step_count=* Number of slopes Integer
height=* Total height stairs m
material=* Material of the stairs See Material library
steps_type=* Type of single-stage Sehe Form library
handrail_height=* height railing m
handrail_form=* The form of the railing See Form library
handrail:left/right/both/center=* railing on the left/right/both/center side of the stairs yes/no
stairs_thickness=* Thickness of the stair construction m
stairs_start_angle=* Rotation of the bottom step to upgrade axis degree (°)
stairs_end_angle=* Rotation of the top step to upgrade axis degree (°)
depth_step=* Depth of a single stage m
height_step=* Height of a single step m
in area-relation: role:lower Polyline, start line irregular steps Polyline connected with highway=steps via relation
in area-relation: role:upper Polyline, end line irregular steps Polyline connected with highway=steps via relation
in area-relation: role:lateral Polylinie, Außenkante unregelmässiger Treppe Polyline connected with highway=steps via relation
stairs_inline=* Polylinie, Innenkante unregelmässiger Treppe Polyline connected with highway=steps via relation

see Relations/Proposed/Area#area-steps for the area-relation model of steps.

Parameter description

Type of staircase

Used for 3D purposes only.

MarekStairsTypeFull.JPG stairs:type=*= full

MarekStairsTypeStandard.JPG stairs:type=*= standard

MarekStairsTypeOverlapped.jpg stairs:type=*= overlapped

MarekStairsTypeEinzeln.JPG stairs:type=*= touched

MarekStairsTypeFreeSteps.jpg stairs:type=*= separated

Stages with offset

Used for 3D purposes only.

All stages can have offset.

Examples forming of stages for 3D rendering:

MarekStairsTypeFullwithOffset.JPG stairs:type=*= full_offset.

MarekStairsTypeStandardWithOffset.JPG stairs:type=*= touched_offset.

Railing position


Position of railing:

Start and end angle stairs

Sometimes is the start of end angle of stair steps not at right angle to the ascending direction.

In such cases add tags for initial slope of first and last point of steps:

MarekStartEndWinkelTreppe.jpg Anfangsneigung Treppe (alpha s) :Treppe im Punkt S, Endneigung Treppe (alpha e) Treppe im Punkt E

Exkursion rendering

A staircase with many wrinkles and without stairway landings is rendered as in the following example:

  • F3DBstepsHowToDo1.jpg highway=steps
  • F3DBstepsHowToDo2.jpg width=value
  • F3DBstepsHowToDo3.jpg rendering machine calculates section points M12-M23-M34 by use of angle bisectors.
  • F3DBstepsHowToDo4.jpg step_count=7
  • F3DBstepsHowToDo5.jpg rendering machine divides polyline P1 - P2 - P3 - P4 in 7 sections of equal length.
  • F3DBstepsHowToDo6.jpg Sketch: final result after rendering.

Mockup rendered example:


Importance of height for 2D rendering

For plain 2D rendering under use of width=* is it not important to know where the up and down point of stairs is unless:

  • Start and end of the staircase is located one above the other.
  • Polyline of the staircase has intersections.

Example: two possible rendering results of stairs with intersections:


A staircase with stairway landings.


Möchte man Treppen mit Zwischenpodesten erhalten, was für längere Treppen überwiegend Standard ist, so muss man einen OSM Grundriss wie in unterem Beispiel konstruieren: Anstatt einer Polylinie mit mehreren Zwischenpunkten wird pro Relation eine miteinander verknüpfte Abfolge von Treppen (S) und "Podestlinien" (P) konstruiert.

Depth of the single step

depth_step=*, (Ds, necessary for 3D purposes only)


Start- and end point

Thus, the stairs can be interpreted properly in 3D, the bottom and top of the stairs must be marked:

Start- and end line

Stairs with complicated geometry can be drawn, by drawing of uppermost and lowermost outer edge of the stairs as a polyline. Tagging of the lowermost line: steps:startline=yes the uppermost: steps:endline=yes.


These two lines are connected together. The connector line is the midline of stair geometry tagged as: highway=steps. This line should still be used for routing.


Result after Rendering (mockup)*


  • Neccesary Assumptions for the renderer, which can be developed based on this proposal:

The starting point of the polyline stairs:startline=yes is connected to the start point of stairs:endline=yes.. The line is divided into n-step sections for rendering. The same with the end points of polylines stairs:startline=yes andstairs:endline=yes

The approach solves problems arise when drawing large, complex stairs, because of differences between logical connectors for routing (graph network) and the desire, to reflect reality.

Design options

A. Both polylines have the same number of nodes.

Zwischen den entsprechenden Nodes beider Linien wird die Anzahl der Stufen gleichmäßig aufgeteilt:


  • Stairs:startline=yes yellow
  • Stairs:endline=yes green
  • Treppenvektor, highway=steps:rot (Start und Endline werden beliebig mit dem Treppenvektor miteinander verbunden)
  • Verlauf der Stufenkanten nach dem Rendering:schwarz

Der Ansatz basiert auf den in der Kartografie bekannten Höhenlinien. Die technische Schwierigkeit: hier könnten Selbstverschneidungen auftreten.

B. Both polylines have a different number of nodes.

In diesem Fall werden die Endpunkte beider Linien miteinander verbunden. Die einzelnen Punkte der Linie die mehr Punkte besitzt, werden über das Kriterium der kürzesten Entfernung mit den Punkten der zweiten Linie verbunden.

MarekStairsDownAndTopLineDifferentEdges.jpg MarekStairsDownAndTopLineDifferentEdgesB.jpg

Weitere Gestaltungsbeispiele:


Special nodes for advanced modeling

Rendering the stairs can sometimes lead to an undesirable result if one draw start and end line with different number of nodes:


In particular, this can result in an undesirable geometry of lines after rendering:

  • F3DBStepsByTwoLines1Start.JPG

drawn outline shapes

  • F3DBStepsByTwoLines2triangulated.JPG

internal triangulation by renderer

  • F3DBStepsByTwoLines3stepsRendered.JPG

unclean renderer output

  • F3DBStepsByTwoLines4useOfElePointsForOptimization.JPG

result optimized by use of tagging solution described below.

If you want to avoid this and get the wishful result, the start and end line must be divided by use of additionally tagging of points they should be connected corresponding to their position with:

If the real height values are known, you can use ele=* ( 3D)

The number of this points must be the same for start and end line!

(See sketch below: blue lines connect points that have the same tagging schema)


This tagging should be taken into account by the renderer.

Result mockup:


Outline and Inline

An "outline" multipolygon with tagging area:steps=yes, draws the irregular outer surface of the stair from top.


Therefore is it possible to combine several steps and footways as connected elements in ONE outline shape:


The surface after rendering:



Mockup rendering of a sequence of highway=steps and highway=footway with the same width=*:

MarekStairsWithPlattform1.jpg Classical OSM 2D representation

MarekStairsWithPlattform2.jpg OSM-4D, F3DB representation

MarekStairsWithPlattformKnickExample1.jpg Example: Rendering of a curved platform in OSM-4D

Combination of several connections within one outline:

MarekOutlineExample1.jpg stairs outline (Outline shape)

MarekOutlineExample2.jpg Stairs and footway lines.

MarekOutlineExample2Tagging.jpg Tagging

MarekOutlineExample3.jpg Mockup: result after rendering

Roof direction

For right 3D interpretation of stairs one need the lowest and heighest point of steps. There are following possibilities:

Describe the lowest point of stairs as: "lowest:point=yes" Describe the highest point of stairs as: "highest:point=yes"

How to draw stairs for wishful steps look

Do we want to achieve the following stairs shape in 3D:


we must add an additional break point of the polyline - a step further than the start of the turned steps:


Dadurch bleibt der Stufenverlauf links senkrecht zu der Verlaufachse ohne Notwendigkeit der Parametrisierung. Analogously, for example, a half-turn staircase are drawn:


Example modeling of barock stairs

The staircase consists of three outline areas; two stpes areas and one footway area:

  • F3DBAreaStepsAndAreaFootwayExample.jpg
  • F3DBAreaStepsAndAreaFootwayExample1.jpg Steps (black midline) and footway (red midline)
  • F3DBAreaStepsAndAreaFootwayExample1result.jpg Rendering mockup