UK Transport Wiki:ROUTE


 * Other such lists need to be integrated into that catalog.

Route diagram templates simplify the writing of Wiki tables and provide a uniform layout primarily to railway route-map infoboxes for railway lines, waterways and other modes of transport. A grid of square icons is used to draw a route diagram, and there are over 3000 icons to identify features including railway track, railway stations , bridges , rivers , tunnels , junctions and interchanges.

Structure of the map table
The right image shows the generic structure of the map table constructed by the templates of this project. The format is not compulsory, but some of the syntax does require careful "programming", so that it will not mess up the layout of the article which transcludes the map. The following sections will explain the function and usage of the templates.

Templates
The templates may be considered to be in two classes:
 * General templates defining the product as a route map,
 * Detailing templates carrying information row by row into the route map.

Master table margin style-defining templates

 * }

The opening of a "stand-alone" map (i.e. without transcluded into other template such as infobox.) They do not call for the table themselves, so follow the command  {|  to call for a Wiki table. These templates also include the parameter for extra CSS styling and  to define the collapse state of the table.
 * }

Table title template

 * }

BS-header defines the text title of the table; use it right below the railway line header. They are not necessary especially when included in the infobox. But editor has the option to set the colors for both title background and font, thus indicate the livery color of the line.

Railway company information template
The optional provision of the details of a railway company. Preferably used between the BS-header and BS-table.

Map table templates
These templates define the suitable styling for the route map. They are the must for joining the row templates seamlessly. They have already included the Wiki table opening syntax {|. The BSicon row templates which actually forms the map should follow these templates immediately and ended with 1 table closing syntax |} after the map is complete. Choose either 1 table template to continue:

Both table templates have 2 unnamed parameters. The first determines which type of legend page to be linked to (displayed at the upper-right corner of the map): The second one allows additional CSS styling to be defined for the table and shouldn't be used easily.
 * route or 1 (default): Railway line legend, the most generic legend for railway map.
 * track: Railway track legend for railway track and platform alignment diagram.
 * bus: Bus route legend for any type of bus route map.
 * canal, water or waterway: Waterways legend for waterway or canal map.
 * walkway, foot or footpath: User:David Edgar/Footpath legend for footpath map. (Tentative)
 * no or 0: No legend page link.

Icon and text row templates

 * }

The real meat of designing the map. The number (#) after the template name BS (German abbreviation of B ahn s trecke for stretch of track) indicate how many horizontal icon grids available. Use these templates with icon images continuously on every new row to construct the map.

BS(#) row templates
The unnamed (sequential) parameters of BS are as follow. The order of these parameters are lined up just as how the output will look like:


 * 1: Icon ID for what icon will be displayed in the icon column. (For no icon to be shown leave blank or use "leer" [German for "empty"]).
 * 2: Distance along track or traveling time from the starting point.
 * 3: Text, name of station or other feature.
 * 4: Note 1 - Written after Text with a leading space in smaller characters.
 * 5: Note 2 - Written after Note 1 in the smaller characters but right-aligned. (This case can be used as another Dist./Time case).

BS row templates with a number shift the unnamed parameter order of text column to make way for extra icon grids sequentially:

Named parameters
All BS row templates have named (designated) parameters, providing advanced functions. Remember to distinguish between the uppercase and lowercase alphabets of the parameter name.
 * PX: Width of icon (e.g. PX=50px), 20px by default.
 * PX2, PX3, etc.: further definition of the width of the corresponding icon case. The parameter PX works as the global width or the individual width for the 1st icon.
 * Beware that PX parameters have no effect on the icons of other rows.
 * O1 (Owe one not zero one), O12 - O15: ID of an icon to overlay on the lower icon of the same grid, 5 layers in total. The greater number of the parameter indicates the upper layer which is over the smaller.
 * O2, O22 - O25: ID of an icon to overlay on the icon of the 2nd icon grid.
 * O3, O32 - O35: ID of an icon to overlay on the icon of the 3rd icon grid, etc.
 * alt1, alt2, alt3, etc.: User-defined alt attribute for the icon image to override the alt text generated by BS-alt. See also Alternative text for images.
 * L1, L2, L3, etc.: User-defined internal link for the icon image to override the default link to file description page of the icon.
 * bg: Use color name or HTML RGB hex code (with prefix # ) to "highlight", to emphasize certain sections, transparent by default
 * tw: Width of the text column. This is especially required for joining the icons cohesively when the text length in the "normal" BS row template text column isn't wide enough to override the BS row collapsible sections.


 * }

Lining up BS row templates

 * }
 * }

Except for BS, all BS# row templates will join the icons in the same row cohesively, unless separated by an empty or leer entry. To join the icons vertically, just open the same new BS row template and continue. (Example 1)

Editor can also line up different BS(#) row templates, because their icon column is set to align to center. This is usually done by joining odd number row template by odd number row template, even number row template by even number row template, in order to omit the need of empty entry to stack up grid space. In exmaple 2 and 3, the only icon of BS joins the 2nd icon of BS3 vertically; and the 2nd and 3rd icons of BS4 join the 1st and 2nd icons of BS2 respectively.

When joining odd and even number row templates (example 4), specialized icons such as BS2l and BS2c3  (supplementary corner) are required to patch the seam smoothly, see branching icons catalog.

Fractional text display template
BSkm is a template primarily designed for Dist./Time and Note 2 cases in the BS(#) row template when 2 distances must be shown together vertically in fractional format, for example when a new range of distances starts. Usage:  . Despite its name, this template does not output the unit km after the text entry.

Applying this template in Text and Note 1 cases will lengthen the height of row, thus causing the icons not joining cohesively row to row. If this is still desired, use parameter PX to enlarge the icon size (greater than default width, 20px) on all rows to overtop the height of BSkm.

Closing map table
Use  |} s to close the map table. The exact amount required to close is judged by at least 3 points. 1st for any collapsible section. 2nd for the BS-table. 3rd for the call of table before the railway line header,  {| . As the following example shows, extra notes can be written after the closing  |} s of BS-table.

Example

 * Times shown are fastest timetabled journey from London St Pancras.
 * }
 * }

Note: The code here produces the adjoining map. It does not mean to reflect the current situation.


 * Times shown are fastest timetabled journey from London St Pancras.
 * }
 * }


 * Do not write the row templates and the table closing code  |} </tt>s continuously on the same row, because Wiki table requires each row to be written on the newline. Always hard return after completing 1 row.

Collapsible sections
It is possible to make sections of BS(#) rows collapsible as if it were in a NavFrame. Railway line header and the table header template (eg: BS-header) are used as above. The collapsible section begins with a BS(#)-startCollapsible row template (lacking the parameters Note 1, Note 2 and tw), then include other "ordinary" BS(#) row templates which are set to be collapsible in the map, finally a table closing syntax  |} </tt> to end the collapsible section.

{{BS|STR|| |} }}


 * }
 * }


 * If the map has a combined use of different BS# row templates, the editor should choose the startCollapsible template which provides the same icon grids quantity as the greatest BS# row template used in the map (e.g., use bs5-sc when bs5 is the template with greatest icon grids used in the map).


 * Unlike the ordinary BS(#) row templates, the named parameter bg of startCollapsible template will dye the background of the entire collapsible section rather than a single row. This will allow the reader to distinguish between the non-collapsible and expanded collapsible sections easier.

Flawed collapsible section
The map might look broken between the collapsible and non-collapsible sections. This is because the text of either the startcollapsible template or BS row template inside the collapsible section is too lengthy. Either way the icons will shift to unintended positions and thus do not join vertically.

In the previous collapsible section example we increased the width of a BS(#) row template which is outside of collapsible section by applying the named parameter tw to define its text column width to override the width of the widest "shown" collapsible section. The tw only needs to be input once per BS-table(#) template in one of the non-collapsible BS(#) row template. When more than 1 tw entry exist, the greatest one will take the effect.


 * }

!style="border-top:1px solid #ccf"|Condition 2
 * Text of startCollapsible template is longer than the text column outside of collapsible section.


 * }
 * }


 * Text of BS row template inside collapsible section is longer than the text column outside of collapsible section.
 * }


 * }
 * }

Example
<pre.raw style="border:0px;overflow:auto;">


 * }
 * }

BS(#)-2 row templates
BS(#)-2 templates take text on both sides without the Distance/Time case available as oppose to the previously introduced BS(#) row templates that only allow text to be displayed to the right-hand side of the icon column. All named parameters of BS(#) row templates are applicable here. These templates should not be used with other "right-Text only" BS(#) row templates. Example is shown in the demonstration on the top of this project page. Unnamed parameters are as follow:


 * startCollapsible templates are not yet available for BS"#"-2 map.

Hints



 * }
 * }


 * If a station has a WP article, link to that, not to the town.


 * Avoid overlinkage to a city or railway when its occurrences are close together on the route map.


 * For a line which connects to the subject line link its article particularly if there is a connection for passengers.


 * For vee stations show the lines as already joined in the station to show the connection or use the CPIC set. The mere showing of a vee station shows that it has not been overlooked.


 * At the ends of a line show tracks which go further by STR or CONT set.


 * For lines branching off as the route runs from its start specify 'To X', in the opposite case (lines which join) 'From X'".
 * Template RoutemapRoute (shortcut: rmr) is an option to help describing in the text column with arrow icons ).


 * When your map grows too big like this, it is recommended not to transclude such map inside an infobox or table which floats / aligns to left or right, otherwise it would press the main text outside to the narrow space. This problem exaggerates to user who uses small screen resolution. It is a good idea to use the standalone table with style defined by railway line header (center) or railway line header2 (center) so the table does not float to left or right. If the left/right-aligned table is desired, adjust the map width for a minimum of 1024px display width in monobook Wiki style. Set the table collapsed by default also helps (by applying the parameter collapse=yes in railway line header or railway line header (center)).


 * If an unusual situation requires using a current icon unconventionally, give an explanation either by the text level with the icon or by a note at the top or bottom of the map, separated by an empty row or border line, showing the "misused" icon and its meaning.

Pictograms
A list of the pictograms which are currently available. A separate page lists waterways pictograms. A directory of icons can be found at Wikimedia Commons.

The conventional file name format for image of this project is as follow: BSicon_(pictogram ID).svg. In BS(#) row templates, editor only needs to type the ID for the desired icon. The name of a pictogram, or ID, is constructed by prefix, ROOT and suffix jointly (e.g. forming by u-STR-lg). Prefix and suffix are always lowercase but ROOT is all caps to distinguish from the affixes. All icons contain at least 1 ROOT or combining 2 or more to form some complex icon. Affixes mostly variate the "base" icon in color, directionality, structure, etc and may not apply to simple icons.

Because of the number of projects using these icons, additional codes have been created for special uses, including parallel routes and type changes. A complete index is available at User:AlisonW/Rail Icons for CSS-compatible browsers.

The following tables of icon cover the most basic, commonly used stems:

Prefix
It indicates that infrastructure is not used, disused (or not yet opened), and whether it runs in a tunnel or elevated:

* Alternatives are not recommended because they cause inconsistency with other prefixes and to the naming rule. Editor may use these icons if the desired icon of the formal prefix does not exist.

Root
The core part of the icon ID:

* These icons are accompanied with suffix in most case. Number indicates the variation is also considered suffix in this case.
 * Alphabet Ü (DE: ue) can be input using ASCII by alt+0220 (must type the number on numeric keypad on the righthand side of keyboard). Some non-western language option might alter to the undesired output such as the lowercase ü or non-diacritic U. Some redirects replacing the 'Ü' with 'UE' are already set up (e.g. BRUECKE -> BRÜCKE). You may creat such file name redirect in Wikimedia Commons yourself if you see fit.

Suffix
Affixes in this category indicates the directionality, position or structural variation. Note that directions assume a vertically downward route.
 * The directionality for-, back-, left- and right-ward of ROUTE icon is based on that the line in the map starts the trip from the upper side downward. So the left and right are reversed in the map from objective view, unless the direction is described as backward. Some icon makes exception, such as CPIC and corner sets.

Overlay
If a required icon does not exist it might be produced from 2 to 6 existing icons using the overlay parameter to superimpose one icon over another. Add the overlay parameter in the BS(#) row template, O1 corresponds to icon grid 1, O2 icon grid 2, etc.; O1, O2, O3 represents the 1st layer and O1 2, O2 2 , O3 2 directs to the 2nd layer, etc., 5 overlapping layers in total. The icon of greater-number-overlay parameter will appear over the icon of the smaller-number-overlay parameter and the base icon.


 * }


 * In order to allow the other editors to access the code of the map easier, it is a good practice to line up the overlay parameters right beside the corresponding "base" icon entry. That way we humans do not need to look at the codes back and forth. The following examples A and B give the same result, but example B is recommended for the editors:
 * }
 * A:  </tt>
 * B:  </tt>


 * For unknown reason, in Microsoft Internet Explorer 7 or other browsers based on IE7, overlaid icons might shift horizontally to an unintended position (or simply be invisible.) This will happen when changing the browser size or show/hide any collapsible section that will change the BS table position or its width. This can be cured temporarily after purging the page. Also hide the collapsible map and then show it again has the same effect, but there are several benefits to purge the page.

HUB
HUB is a set of modules which requires overlaying to describe multiple lines within a large transport hub, usually sharing one station name. The naming rule of these icons is different from ordinary railway icons.


 * }

Own icons
In most case the icons available in Wikimedia Commons should be sufficient. However, if you think you need to create an icon of your own, please take note of the following points:


 * Check on Commons Icons for railway descriptions and subcategories whether a such icon already exists.
 * Think if the icon you need can be done via overlaying 2 to 6 existing icons.
 * Use SVG file format only. This can be done by using CORELDraw, Inkscape, Adobe Illustrator or an html/xml (text) editor.
 * Follow the colour scheme and naming conventions listed in the catalog of pictograms and User:AlisonW/Rail_Icons.
 * Names should be of the form: "BSicon prefixROOTsuffix.svg"
 * where ROOT defines a general function/shape,
 * prefix specifies a coloration/style/usage, and
 * suffix is a shape modifier
 * redirects must be made for files containing diacritics from their dediacriticized name on Commons. For example file:BSicon BRUECKE.svg redirects to file:BSicon BRÜCKE.svg.


 * Graphic size isn't restricted, but it should be in square shape, usually 500px by 500px. They will be eventually resized to 20px-high in the map by default.


 * Tompw's Icon Generator may be used to easily create some types of new SVG icons.
 * Upload files to Wikimedia Commons, add proper copyright statement and the.
 * Do not use copyrighted materials such as company logo. Even if you do not upload to Commons, it will violate the terms of fair use when applying them in the map.
 * If you are incapable or having trouble in creating icon, post your question in the talk page.

Colour scheme

 * Existing lines in current use
 * {{legend|#be2d2c|#be2d2c</tt> for heavy rail BSicon BHF.svg}}
 * {{legend|#003399|#003399</tt> for metro / light rail BSicon uBHF.svg}}
 * Lines not in current use (planned or closed)
 * {{legend|#d77f7e|#d77f7e</tt> for heavy rail BSicon exBHF.svg}}
 * {{legend|#6281c0|#6281c0</tt> for metro / light rail BSicon uexBHF.svg}}
 * Other features
 * {{legend|#80a080|#80a080</tt> for elevated BSicon_hSTR.svg, bridge BSicon BRÜCKE.svg or tunnel portal BSicon TUNNELa.svg}}
 * {{legend|#034ea2|#034ea2</tt> for accessible station BSicon ACC.svg}}
 * {{legend|#006e34|#006e34</tt> for Berlin S-Bahn BSicon SBHF legende.svg}}
 * {{legend|#5abf89|#5abf89</tt> for Berlin S-Bahn BSicon exSBHF legende.svg (former/planned)}}
 * {{legend|#000000|#000000</tt> for cross-platform interchange border BSicon CPIC.svg}}
 * {{legend|#b3b3b3|#b3b3b3</tt> for cross-platform interchange strap BSicon CPIC.svg}}
 * {{legend|#007cc3|#007cc3</tt> for water BSicon WASSER.svg}}
 * {{legend|#000000|#000000</tt> for other features in use (such as BSicon FLUG.svg, BSicon ENDEa.svg)}}
 * {{legend|#aaaaaa|<tt>#aaaaaa</tt> for other features not in use (such as BSicon exFLUG.svg, BSicon exENDEa.svg)}}

Test circuit
Not implemented on en: yet

There is a test circuit on German Wikipedia: w:de:Wikipedia Diskussion:Formatvorlage Bahnstrecke/BS Test, where new icons can be safely tested. Please use the template <tt>KBSv</tt> instead of <tt>BS</tt> there

Sandbox area
Experimental design can be produced in Railway line template/sandbox