Template:Sketch Line

From OpenStreetMap Wiki
Jump to: navigation, search
[Edit] [purge] Template-info.svg Template documentation


This template can be used for inserting links to sketch diagrams of public transportation line.

The SVG sketch diagrams are generated by the German Overpass API instance.


  • {{Sketch Line|ref|network}}
    Simplest form for use in plain-text as an external standard link (no coloring, only display the ref number).
  • {{Sketch Line|ref|network|style|
    Enhanced form showing colored line labels.
  • {{Sketch Line|ref|network=network|operator=operator|
    Full syntax with all supported parameters.

Data selection parameters

  • ref (required) - line number as specified in ref=* tag of relation.
  • network (optional) - network name as specified in network=* tag of relation.
  • operator (optional) - operator name as specified in operator=* tag of relation.

You should select either an operator or network, or both, as the ref line number alone is very frequently ambiguous around the world. Note that some networks are managing distinct routes for lines with the same reference number, but with distinct operators.

Other optional parameters

tuning the generated SVG sketch diagram
  • style (optional) – A template to be used with certain display definitions, such as common abbreviations for names and automatic insertion of some connecting lines. Currently, the following style templates are defined (new ones can be added on request):
    • The default (empty) value has generic settings (also uses the English language).
    • padua has specific settings for Italy (also uses the Italian language).
    • paris has specific settings for Paris (also uses the French language).
    • wuppertal has specific settings for Germany (also uses the German language).
  • width (optional) – A number specifying the maximum display width in pixels of the generated SVG diagram (above this threshold, it will be split on several rows). The default value is 700.
  • height (optional) – A number specifying the maximum height in pixels of the generated SVG diagram. The default value is 495.
  • force-rows – This field can have values 1 or 2 or can be empty. If it is empty, the generator chooses whether to display the line in one or two rows. If it is set to 1 resp. 2, the generator displays the line in an case in one resp. two rows.
  • font-size (optional) – The font size in pixels for the stopname in the generated SVG. The default value is empty: this means that the generator takes font size is 16 for lines displayed on one row, or 10 for lines displayed on two rows.
  • correspondences (optional) – A nonempty value in this field enables the display of correspondences. This slows down the response times but gives more information. The value is interpreted as maximum acceptable distance in meters between two stations or bus stops to still be acceptable for changing vehicles. The default value is 100.
  • max-cors-per-line (optional) – The limit for the acceptable number of line numbers to be printed per row. This option is only effective when correspondences are enabled. The default value is 6.
  • max-cors-below (optional) – The limit for the acceptable number of line numbers to be printed below the line bar. This option is only effective when correspondences are enabled. The default value is 0.
changing the display style for the label inserted in the wiki page
  • bg (optional) – Main background color of the line: used as background color for the displayed label (otherwise "transparent" by default to display the page background).
  • fg (optional) – Contrasting foreground color of the line: used as foreground color for the displayed label, usually #000 or #FFF (otherwise "inherit" by default to display the usual color for links).
  • b (optional) – Contrasting border color of the line: used as the color of the thin border box around the background of the displayed label, usually unset or grey if the background is white (otherwise "transparent" by default to display the background color). If a non transparent border is specified, the font-size of the label will be slightly reduced to 95% to avoid external expansion of rendered line height caused by the thin margin, border and padding.
  • r (optional) – Any non-empty value will display a rounded label instead of a rectangular one (this parameter has no effect if there's no border and/or background colors specified). The internal horizontal padding of the box will be automatically increased to avoid collision of the internal label with these rounded corners.
  • line (optional) – Label to display for the line number when it does not match exactly the line reference number in ref=* tag.


  • {{Sketch Line|95|ATM}} produces 95.
  • {{Sketch Line|1|AMI Ferrara|padua|bg=#2c8839|fg=#FFF|b=transparent|r=1}} produces 1.
  • {{Sketch Line|625|VRR|wuppertal|bg=yellow|fg=black|b=orange}} produces 625.
  • {{Sketch Line|625|VRR|wuppertal|width=2000|bg=#51772c|fg=white}} produces 625.
  • {{Sketch Line|KL|fr_star|style=paris|bg=#FD0|fg=#3D3C3F|b=#3D3C3F|r=1|line=KER<small>LANN</small><sub>ex</sub>}} produces KERLANNex.
  • {{Sketch Line|T8|RATP|paris|bg=#FFF|fg=#333|b=#DDD}} produces T8.

See also