wiki:Styles/Maxspeed

Languages:

Icon Maxspeed style

Description

This style adds display of driving speed related information to the map view. Therefore the following keys are evaluated:

This style was mainly developed for streets but can be used on railways too.

Left-hand and right-hand traffic are always taken into account. Example:

Example (NOZIP)

You can change the colors in the preferences of JOSM. The default colors and some examples are shown below.

Legend (NOZIP)

On high zoom the maxspeed values are displayed as text. This can be disabled in the style settings of this mappaint style.

How the different keys are supported by this style:

key color text text abbreviation validation
maxspeed yes yes yes
maxspeed:forward yes yes fw yes
maxspeed:backward yes yes bw yes
maxspeed:conditional yes (dashed pattern) yes c (value before @ only) yes
maxspeed:forward:conditional yes (dashed pattern) yes fwc (value before @ only) yes
maxspeed:backward:conditional yes (dashed pattern) yes bwc (value before @ only) yes
maxspeed:variable yes (different dashed pattern) yes (all values except no) v (without the actual value) no
maxspeed:variable:forward yes (different dashed pattern) yes (all values except no) vfw (without the actual value) no
maxspeed:variable:backward yes (different dashed pattern) yes (all values except no) vbw (without the actual value) no
maxspeed:advisory no yes a yes
maxspeed:advisory:forward no yes afw yes
maxspeed:advisory:backward no yes abw yes

Implicit maxspeed values are currently supported for the following countries: BY (Belarus), FR (France), RO (Romania), RS (Serbia), RU (Russia). This needs to be enabled in the style settings of this mappaint style first if wanted.

For ideas/questions/bugs/suggestions or similar please write a message to Klumbumbus.

Feel free to translate this wiki page into more languages. Already translated languages see top right.

Testcenter for quality assurance of this style.

Known problems:

  • When using forward/backward values in combination with conditional values or variable, the dashes on the left and right of the road can sometimes be asynchronous, see JOSM bug #11994.

Changelog

Version 3.1

  • Unify indentation (4 spaces instead of tabulator), no code change

Version 3.0

  • Add display of all supported maxspeed values as text on high zoom (partly shortened and with abbreviation, see table above); can be disabled by style setting
  • Rework error display code to make it compatible with maxspeed values display
  • Add and improve some corner cases of the error display
  • Add support of maxspeed:advisory (by user request); only by text display as a 3rd color (beside maxspeed and maxspeed:conditional) combined with forward/backward and variable would be too confusing
  • Add error display for wrong maxspeed:advisory values

Version 2.9

  • Add color for 80 mph (same as 140) and 85 mph (new color) by user request (used in USA)
  • Make color of 30 and 45 mph a little brighter to better distinguish from 100 and 60 mph

Version 2.8

  • Change style setting "maxspeed=RU:* tagging scheme" to general "implicit maxspeed values" and make it disabled by default. Add support for countries with most usage (RO, FR and BY) and RS by user request
  • A little stricter checking of bad values for some corner cases, e.g. 20 mphh is now reported as wrong value (was simply ignored before)

Version 2.7

  • Add support of maxspeed=* + maxspeed:direction:conditional=* (without maxspeed:direction=*), fixes bug in version 2.5
  • Better display of error messages
  • Remove opacity because of different reasons
  • Adjust color for 120
  • If maxspeed and maxspeed:direction is tagged together (tagging error) it is now no longer displayed both stacked, but direction value overrides normal maxspeed value
  • Support combinations of conditional and variable maxspeed
  • Add 140

Version 2.5

  • Add support of maxspeed:conditional, maxspeed:forward:conditional and maxspeed:backward:conditional
  • Add error message for wrong value of conditional maxspeed
  • Add error message for conditional maxspeed without default maxspeed
  • Add in file table of contents and numbered headings for better understandability of the code structure

Version 2.1

  • Add support of alternitive tagging scheme maxspeed=RU:living_street, maxspeed=RU:urban, maxspeed=RU:rural, maxspeed=RU:motorway. This can be disabled in the style settings of this mappaint style.
  • Add style for maxspeed=5
  • Change color of maxspeed=none for better visibility on aerial imagery

Version 2.0

  • change from xml to mapcss
  • support of maxspeed:forward and maxspeed:backward (considering left and right hand traffic)
  • support of maxspeed:variable, maxspeed:variable:forward and maxspeed:variable:backward (dashed line)
  • highlight color is now below the highway line, to see the highway type (residential, secondary, motorway,...)
  • removed support of values without space between number and unit (e.g. 35mph)
  • added error message for wrong maxspeed values (like 35mph or 35 m/h)
  • added error message if maxspeed direction is opposed to oneway direction
  • adjusted to most used values according to taginfo
    • added 20, 45, none
    • removed unused values like 32.19
  • adjusted opacities, widths and some colors for better display and distinction between the colors
  • widths depends on zoom level

Version 1.5

  • Start version

Code

/*

table of contents

1 - meta data
2 - general settings
 2.1 - create user settings
 2.2 - disable tiger layer from default internal mappaint style
 2.3 - disable street names from default internal mappaint style
 2.4 - read conditional maxspeed values 
3 - display maxspeed=*
 3.1 - kmh
 3.2 - mph
 3.3 - conditional maxspeed
 3.3.1 - kmh
 3.3.2 - mph
 3.4 - general rules
4 - display maxspeed:forward=* for righthandtraffic and maxspeed:backward=* for lefthandtraffic
 4.1 - kmh
 4.2 - mph
 4.3 - conditional righthand-forward and lefthand-backward maxspeed
 4.3.1 - kmh
 4.3.2 - mph
 4.4 - general rules
5 - display maxspeed:forward=* for lefthandtraffic and maxspeed:backward=* for righthandtraffic
 5.1 - kmh
 5.2 - mph
 5.3 - conditional lefthand-forward and righthand-backward maxspeed
 5.3.1 - kmh
 5.3.2 - mph
 5.4 - general rules
6 - display maxspeed values as text
7 - error reporting
 7.1 - report wrong value of maxspeed
 7.2 - report wrong value of maxspeed:conditional
 7.3 - report conditional maxspeed without default maxspeed
 7.4 - report wrong value of maxspeed:advisory 
 7.5 - report if maxspeed direction is opposed to oneway direction
 
*/

/*************************************/

/* 1 - meta data */
meta
{
    title: "Maxspeed";
    version: "3.1.52_2025-01-02";
    description: "Display maxspeed values of ways in the map view.";
    icon: "maxspeed_icon.svg";
    author: "Rubke, Dirk Stöcker, Vclaw, Klumbumbus";
    link: "https://josm.openstreetmap.de/wiki/Styles/Maxspeed";
    min-josm-version: "7450"; /* because of user settings */
}
meta[lang=de]
{
    title: "Höchstgeschwindigkeit";
    description: "Anzeige der Höchstgeschwindigkeiten von Linien in der Kartenanzeige.";
    link: "https://josm.openstreetmap.de/wiki/De:Styles/Maxspeed";
}

/*************************************/

/* 2 - general settings */
/* 2.1 - create user settings */
setting::implicit {
    type: boolean;
    label: tr("Support implicit maxspeed values, e.g. RO:urban (only in BY, FR, RO, RU, RS)");
    default: false;
}
setting::textdisplay {
    type: boolean;
    label: tr("Display maxspeed values as text");
    default: true;
}

/* 2.2 - disable tiger layer from default internal mappaint style */
way["tiger:reviewed"=no]::core_tiger
{
    opacity: 0;
}

/* 2.3 - disable street names from default internal mappaint style */
way[highway]
{
    text: none;
}

/* 2.4 - read conditional maxspeed values */
way["maxspeed:conditional"=~/^(none|[1-9][0-9]*) @ /]::maxspeedlayer
{
    maxsp_cond: get(split(" ", tag("maxspeed:conditional")), 0);
    set cond_kmh;
}
way["maxspeed:forward:conditional"=~/^(none|[1-9][0-9]*) @ /]::maxspeedcasinglayer
{
    maxsp_forward_cond: get(split(" ", tag("maxspeed:forward:conditional")), 0);
    set cond_forward_kmh;
}
way["maxspeed:backward:conditional"=~/^(none|[1-9][0-9]*) @ /]::maxspeedcasinglayer
{
    maxsp_backward_cond: get(split(" ", tag("maxspeed:backward:conditional")), 0);
    set cond_backward_kmh;
}
way["maxspeed:conditional"=~/^[1-9][0-9]* mph @ /]::maxspeedlayer
{
    maxsp_cond: get(split(" ", tag("maxspeed:conditional")), 0);
    set cond_mph;
}
way["maxspeed:forward:conditional"=~/^[1-9][0-9]* mph @ /]::maxspeedcasinglayer
{
    maxsp_forward_cond: get(split(" ", tag("maxspeed:forward:conditional")), 0);
    set cond_forward_mph;
}
way["maxspeed:backward:conditional"=~/^[1-9][0-9]* mph @ /]::maxspeedcasinglayer
{
    maxsp_backward_cond: get(split(" ", tag("maxspeed:backward:conditional")), 0);
    set cond_backward_mph;
}

/*************************************/

/* 3 - display maxspeed=* */
/* Note: With some modifications one could delete chapter three and one could use the casing rendering from forward and backward also for the default maxspeed=* rendering.
This would simplify the style code a bit. However this leads to more asynchronous renderings of the dashes, see JOSM ticket #11994.
Also it makes a nicer rendering for dashes lines, like highway=construction or railway=tram.
Therefore the style is written this way. */
/* 3.1 - kmh */
way["maxspeed"="none"]::maxspeedlayer
{
    set maxspeed;
    color: speed_none#febede;
}
way["maxspeed"="5"]::maxspeedlayer
{
    set maxspeed;
    color: speed_5#ff5656;
}
way["maxspeed"="10"]::maxspeedlayer,
way["maxspeed"="RS:living_street"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_10#b80022;
}
way["maxspeed"="15"]::maxspeedlayer
{
    set maxspeed;
    color: speed_15#00da8b;
}
way["maxspeed"="20"]::maxspeedlayer,
way["maxspeed"="BY:living_street"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RU:living_street"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_20#e3cc82;
}
way["maxspeed"="30"]::maxspeedlayer,
way["maxspeed"="FR:zone30"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_30#4d4dff;
}
way["maxspeed"="40"]::maxspeedlayer
{
    set maxspeed;
    color: speed_40#4d4d00;
}
way["maxspeed"="45"]::maxspeedlayer
{
    set maxspeed;
    color: speed_45#fd6eaa;
}
way["maxspeed"="50"]::maxspeedlayer,
way["maxspeed"="FR:urban"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RO:urban"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RS:urban"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_50#07f807;
}
way["maxspeed"="60"]::maxspeedlayer,
way["maxspeed"="BY:urban"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RU:urban"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_60#9f9fff;
}
way["maxspeed"="70"]::maxspeedlayer
{
    set maxspeed;
    color: speed_70#ee8b00;
}
way["maxspeed"="80"]::maxspeedlayer,
way["maxspeed"="FR:rural"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RS:rural"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_80#f90808;
}
way["maxspeed"="90"]::maxspeedlayer,
way["maxspeed"="BY:rural"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RO:rural"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RU:rural"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_90#07f8f8;
}
way["maxspeed"="100"]::maxspeedlayer,
way["maxspeed"="RO:trunk"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RS:trunk"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_100#f807f8;
}
way["maxspeed"="110"]::maxspeedlayer,
way["maxspeed"="BY:motorway"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RU:motorway"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_110#7807f8;
}
way["maxspeed"="120"]::maxspeedlayer
{
    set maxspeed;
    color: speed_120#b69b20;
}
way["maxspeed"="130"]::maxspeedlayer,
way["maxspeed"="FR:motorway"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RO:motorway"][setting("implicit")]::maxspeedlayer,
way["maxspeed"="RS:motorway"][setting("implicit")]::maxspeedlayer
{
    set maxspeed;
    color: speed_130#c0f100;
}
way["maxspeed"="140"]::maxspeedlayer
{
    set maxspeed;
    color: speed_140#438100;
}
/* 3.2 - mph */
way["maxspeed"="5 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_5_mph#b80022;
}
way["maxspeed"="10 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_10_mph#00da8b;
}
way["maxspeed"="15 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_15_mph#e3cc82;
}
way["maxspeed"="20 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_20_mph#4d4dff;
}
way["maxspeed"="25 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_25_mph#4d4d00;
}
way["maxspeed"="30 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_30_mph#fd6eaa;
}
way["maxspeed"="35 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_35_mph#07f807;
}
way["maxspeed"="40 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_40_mph#9f9fff;
}
way["maxspeed"="45 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_45_mph#ee8b00;
}
way["maxspeed"="50 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_50_mph#f90808;
}
way["maxspeed"="55 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_55_mph#07f8f8;
}
way["maxspeed"="60 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_60_mph#f807f8;
}
way["maxspeed"="65 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_65_mph#7807f8;
}
way["maxspeed"="70 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_70_mph#b69b20;
}
way["maxspeed"="75 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_75_mph#c0f100;
}
way["maxspeed"="80 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_80_mph#438100;
}
way["maxspeed"="85 mph"]::maxspeedlayer
{
    set maxspeed;
    color: speed_85_mph#725600;
}

/* 3.3 - conditional maxspeed */
way.cond_kmh::maxspeedlayer,
way.cond_mph::maxspeedlayer
{
    dashes: 55,25;
}
/* 3.3.1 - kmh */
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="none"]::maxspeedlayer
{
    dashes-background-color:  speed_none#febede;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="5"]::maxspeedlayer
{
    dashes-background-color:  speed_5#ff5656;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="10"]::maxspeedlayer
{
    dashes-background-color:  speed_10#b80022;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="15"]::maxspeedlayer
{
    dashes-background-color:  speed_15#00da8b;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="20"]::maxspeedlayer
/* A selector for implicit scheme is not needed here because e.g. "maxspeed:conditional=RU:living_street @ (...)" is nonsense, better use the actual maxspeed value in this case. The same is true for the others (rural, urban, motorway, ...).  */
{
    dashes-background-color:  speed_20#e3cc82;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="30"]::maxspeedlayer
{
    dashes-background-color:  speed_30#4d4dff;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="40"]::maxspeedlayer
{
    dashes-background-color:  speed_40#4d4d00;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="45"]::maxspeedlayer
{
    dashes-background-color:  speed_45#fd6eaa;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="50"]::maxspeedlayer
{
    dashes-background-color:  speed_50#07f807;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="60"]::maxspeedlayer
{
    dashes-background-color:  speed_60#9f9fff;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="70"]::maxspeedlayer
{
    dashes-background-color:  speed_70#ee8b00;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="80"]::maxspeedlayer
{
    dashes-background-color:  speed_80#f90808;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="90"]::maxspeedlayer
{
    dashes-background-color:  speed_90#07f8f8;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="100"]::maxspeedlayer
{
    dashes-background-color:  speed_100#f807f8;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="110"]::maxspeedlayer
{
    dashes-background-color:  speed_110#7807f8;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="120"]::maxspeedlayer
{
    dashes-background-color:  speed_120#b69b20;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="130"]::maxspeedlayer
{
    dashes-background-color:  speed_130#c0f100;
}
way.cond_kmh[prop(maxsp_cond, maxspeedlayer)="140"]::maxspeedlayer
{
    dashes-background-color:  speed_140#438100;
}
/* 3.3.2 -  mph */
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="5"]::maxspeedlayer
{
    dashes-background-color:  speed_5_mph#b80022;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="10"]::maxspeedlayer
{
    dashes-background-color:  speed_10_mph#00da8b;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="15"]::maxspeedlayer
{
    dashes-background-color:  speed_15_mph#e3cc82;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="20"]::maxspeedlayer
{
    dashes-background-color:  speed_20_mph#4d4dff;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="25"]::maxspeedlayer
{
    dashes-background-color:  speed_25_mph#4d4d00;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="30"]::maxspeedlayer
{
    dashes-background-color:  speed_30_mph#fd6eaa;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="35"]::maxspeedlayer
{
    dashes-background-color:  speed_35_mph#07f807;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="40"]::maxspeedlayer
{
    dashes-background-color:  speed_40_mph#9f9fff;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="45"]::maxspeedlayer
{
    dashes-background-color:  speed_45_mph#ee8b00;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="50"]::maxspeedlayer
{
    dashes-background-color:  speed_50_mph#f90808;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="55"]::maxspeedlayer
{
    dashes-background-color:  speed_55_mph#07f8f8;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="60"]::maxspeedlayer
{
    dashes-background-color:  speed_60_mph#f807f8;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="65"]::maxspeedlayer
{
    dashes-background-color:  speed_65_mph#7807f8;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="70"]::maxspeedlayer
{
    dashes-background-color:  speed_70_mph#b69b20;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="75"]::maxspeedlayer
{
    dashes-background-color:  speed_75_mph#c0f100;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="80"]::maxspeedlayer
{
    dashes-background-color:  speed_80_mph#438100;
}
way.cond_mph[prop(maxsp_cond, maxspeedlayer)="85"]::maxspeedlayer
{
    dashes-background-color:  speed_85_mph#725600;
}

/* 3.4 - general rules */
way.maxspeed::maxspeedlayer
{
    width: 14;
    z-index: -1;
}
way|z16.maxspeed::maxspeedlayer
{
    width: 12;
}
way|z-15.maxspeed::maxspeedlayer
{
    width:10;
}
way.maxspeed[maxspeed:variable]::maxspeedlayer
{
    dashes: 34,6;
    /* *variable* overrides the dashes scheme of *conditional*, but the colors of conditional stay.
    This way you can see conditional and variable together */
}

/*************************************/

/* 4 - display maxspeed:forward=* for righthandtraffic and maxspeed:backward=* for lefthandtraffic */
/* 4.1 - kmh */
way["maxspeed:forward"="none"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="none"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_none#febede;
}
way["maxspeed:forward"="5"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="5"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_5#ff5656;
}
way["maxspeed:forward"="10"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="10"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RS:living_street"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_10#b80022;
}
way["maxspeed:forward"="15"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="15"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_15#00da8b;
}
way["maxspeed:forward"="20"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="20"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="BY:living_street"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RU:living_street"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
/* no left hand traffic in BY, FR, RO, RU, RS, so a selector is not needed here and the similar rules in chapter 5.1 */
{
    set maxspeed_right;
    right-casing-color: speed_20#e3cc82;
}
way["maxspeed:forward"="30"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="30"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="FR:zone30"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_30#4d4dff;
}
way["maxspeed:forward"="40"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="40"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_40#4d4d00;
}
way["maxspeed:forward"="45"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="45"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_45#fd6eaa;
}
way["maxspeed:forward"="50"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="50"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="FR:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RO:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RS:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_50#07f807;
}
way["maxspeed:forward"="60"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="60"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="BY:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RU:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_60#9f9fff;
}
way["maxspeed:forward"="70"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="70"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_70#ee8b00;
}
way["maxspeed:forward"="80"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="80"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="FR:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RS:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_80#f90808;
}
way["maxspeed:forward"="90"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="90"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="BY:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RO:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RU:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_90#07f8f8;
}
way["maxspeed:forward"="100"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="100"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RO:trunk"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RS:trunk"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_100#f807f8;
}
way["maxspeed:forward"="110"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="110"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="BY:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RU:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_110#7807f8;
}
way["maxspeed:forward"="120"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="120"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_120#b69b20;
}
way["maxspeed:forward"="130"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="130"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="FR:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RO:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:forward"="RS:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_130#c0f100;
}
way["maxspeed:forward"="140"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="140"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_140#438100;
}
/* 4.2 - mph */
way["maxspeed:forward"="5 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="5 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_5_mph#b80022;
}
way["maxspeed:forward"="10 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="10 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_10_mph#00da8b;
}
way["maxspeed:forward"="15 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="15 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_15_mph#e3cc82;
}
way["maxspeed:forward"="20 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="20 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_20_mph#4d4dff;
}
way["maxspeed:forward"="25 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="25 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_25_mph#4d4d00;
}
way["maxspeed:forward"="30 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="30 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_30_mph#fd6eaa;
}
way["maxspeed:forward"="35 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="35 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_35_mph#07f807;
}
way["maxspeed:forward"="40 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="40 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_40_mph#9f9fff;
}
way["maxspeed:forward"="45 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="45 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_45_mph#ee8b00;
}
way["maxspeed:forward"="50 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="50 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_50_mph#f90808;
}
way["maxspeed:forward"="55 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="55 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_55_mph#07f8f8;
}
way["maxspeed:forward"="60 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="60 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_60_mph#f807f8;
}
way["maxspeed:forward"="65 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="65 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_65_mph#7807f8;
}
way["maxspeed:forward"="70 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="70 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_70_mph#b69b20;
}
way["maxspeed:forward"="75 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="75 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_75_mph#c0f100;
}
way["maxspeed:forward"="80 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="80 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_80_mph#438100;
}
way["maxspeed:forward"="85 mph"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="85 mph"]!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right;
    right-casing-color: speed_85_mph#725600;
}

/* 4.3 - conditional righthand-forward and lefthand-backward maxspeed */
way.cond_forward_kmh:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh!:righthandtraffic::maxspeedcasinglayer,
way.cond_forward_mph:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph!:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_right_cond;
    right-casing-dashes: 55,25;
}
/* 4.3.1 - kmh */
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="none"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="none"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_none#febede;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="5"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="5"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_5#ff5656;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="10"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="10"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_10#b80022;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="15"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="15"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_15#00da8b;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="20"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="20"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_20#e3cc82;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="30"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="30"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_30#4d4dff;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="40"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="40"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_40#4d4d00;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="45"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="45"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_45#fd6eaa;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="50"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="50"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_50#07f807;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="60"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="60"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_60#9f9fff;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="70"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="70"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_70#ee8b00;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="80"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="80"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_80#f90808;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="90"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="90"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_90#07f8f8;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="100"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="100"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_100#f807f8;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="110"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="110"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_110#7807f8;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="120"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="120"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_120#b69b20;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="130"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="130"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_130#c0f100;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="140"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="140"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_140#438100;
}
/* 4.3.2 - mph */
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="5"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="5"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_5_mph#b80022;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="10"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="10"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_10_mph#00da8b;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="15"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="15"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_15_mph#e3cc82;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="20"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="20"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_20_mph#4d4dff;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="25"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="25"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_25_mph#4d4d00;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="30"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="30"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_30_mph#fd6eaa;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="35"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="35"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_35_mph#07f807;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="40"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="40"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_40_mph#9f9fff;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="45"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="45"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_45_mph#ee8b00;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="50"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="50"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_50_mph#f90808;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="55"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="55"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_55_mph#07f8f8;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="60"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="60"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_60_mph#f807f8;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="65"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="65"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_65_mph#7807f8;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="70"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="70"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_70_mph#b69b20;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="75"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="75"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_75_mph#c0f100;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="80"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="80"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_80_mph#438100;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="85"]:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="85"]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes-background-color: speed_85_mph#725600;
}

/* 4.4 - general rules */
way.maxspeed_right::maxspeedcasinglayer,
way.maxspeed_right_cond::maxspeedcasinglayer
{
    right-casing-width: 6;
    right-casing-offset: 0;
    major-z-index: 3;
    z-index: -1;
}
way|z16.maxspeed_right::maxspeedcasinglayer,
way|z16.maxspeed_right_cond::maxspeedcasinglayer
{
    right-casing-width: 5;
}
way|z-15.maxspeed_right::maxspeedcasinglayer,
way|z-15.maxspeed_right_cond::maxspeedcasinglayer
{
    right-casing-width: 4;
}
way.maxspeed_right_cond!.maxspeed_right::maxspeedcasinglayer
{
    right-casing-opacity: 0;
    right-casing-dashes-background-opacity: 1;
}
way.maxspeed_right[maxspeed:variable:forward]:righthandtraffic::maxspeedcasinglayer,
way.maxspeed_right[maxspeed:variable:backward]!:righthandtraffic::maxspeedcasinglayer,
way.maxspeed_right_cond[maxspeed:variable:forward]:righthandtraffic::maxspeedcasinglayer,
way.maxspeed_right_cond[maxspeed:variable:backward]!:righthandtraffic::maxspeedcasinglayer
{
    right-casing-dashes: 34,6;
}

/*************************************/

/* 5 - display maxspeed:forward=* for lefthandtraffic and maxspeed:backward=* for righthandtraffic */
/* 5.1 - kmh */
way["maxspeed:forward"="none"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="none"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_none#febede;
}
way["maxspeed:forward"="5"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="5"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_5#ff5656;
}
way["maxspeed:forward"="10"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="10"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RS:living_street"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_10#b80022;
}
way["maxspeed:forward"="15"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="15"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_15#00da8b;
}
way["maxspeed:forward"="20"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="20"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="BY:living_street"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RU:living_street"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_20#e3cc82;
}
way["maxspeed:forward"="30"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="30"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="FR:zone30"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_30#4d4dff;
}
way["maxspeed:forward"="40"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="40"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_40#4d4d00;
}
way["maxspeed:forward"="45"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="45"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_45#fd6eaa;
}
way["maxspeed:forward"="50"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="50"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="FR:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RO:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RS:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_50#07f807;
}
way["maxspeed:forward"="60"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="60"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="BY:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RU:urban"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_60#9f9fff;
}
way["maxspeed:forward"="70"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="70"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_70#ee8b00;
}
way["maxspeed:forward"="80"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="80"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="FR:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RS:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_80#f90808;
}
way["maxspeed:forward"="90"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="90"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="BY:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RO:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RU:rural"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_90#07f8f8;
}
way["maxspeed:forward"="100"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="100"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RO:trunk"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RS:trunk"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_100#f807f8;
}
way["maxspeed:forward"="110"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="110"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="BY:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RU:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_110#7807f8;
}
way["maxspeed:forward"="120"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="120"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_120#b69b20;
}
way["maxspeed:forward"="130"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="130"]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="FR:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RO:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="RS:motorway"][setting("implicit")]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_130#c0f100;
}
way["maxspeed:forward"="140"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="140"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_140#438100;
}
/* 5.2 - mph */
way["maxspeed:forward"="5 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="5 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_5_mph#b80022;
}
way["maxspeed:forward"="10 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="10 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_10_mph#00da8b;
}
way["maxspeed:forward"="15 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="15 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_15_mph#e3cc82;
}
way["maxspeed:forward"="20 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="20 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_20_mph#4d4dff;
}
way["maxspeed:forward"="25 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="25 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_25_mph#4d4d00;
}
way["maxspeed:forward"="30 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="30 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_30_mph#fd6eaa;
}
way["maxspeed:forward"="35 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="35 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_35_mph#07f807;
}
way["maxspeed:forward"="40 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="40 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_40_mph#9f9fff;
}
way["maxspeed:forward"="45 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="45 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_45_mph#ee8b00;
}
way["maxspeed:forward"="50 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="50 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_50_mph#f90808;
}
way["maxspeed:forward"="55 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="55 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_55_mph#07f8f8;
}
way["maxspeed:forward"="60 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="60 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_60_mph#f807f8;
}
way["maxspeed:forward"="65 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="65 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_65_mph#7807f8;
}
way["maxspeed:forward"="70 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="70 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_70_mph#b69b20;
}
way["maxspeed:forward"="75 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="75 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_75_mph#c0f100;
}
way["maxspeed:forward"="80 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="80 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_80_mph#438100;
}
way["maxspeed:forward"="85 mph"]!:righthandtraffic::maxspeedcasinglayer,
way["maxspeed:backward"="85 mph"]:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left;
    left-casing-color: speed_85_mph#725600;
}

/* 5.3 - conditional lefthand-forward and righthand-backward maxspeed */
way.cond_forward_kmh!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh:righthandtraffic::maxspeedcasinglayer,
way.cond_forward_mph!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph:righthandtraffic::maxspeedcasinglayer
{
    set maxspeed_left_cond;
    left-casing-dashes: 55,25;
}
/* 5.3.1 - kmh */
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="none"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="none"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_none#febede;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="5"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="5"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_5#ff5656;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="10"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="10"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_10#b80022;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="15"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="15"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_15#00da8b;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="20"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="20"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_20#e3cc82;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="30"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="30"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_30#4d4dff;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="40"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="40"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_40#4d4d00;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="45"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="45"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_45#fd6eaa;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="50"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="50"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_50#07f807;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="60"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="60"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_60#9f9fff;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="70"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="70"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_70#ee8b00;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="80"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="80"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_80#f90808;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="90"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="90"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_90#07f8f8;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="100"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="100"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_100#f807f8;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="110"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="110"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_110#7807f8;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="120"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="120"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_120#b69b20;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="130"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="130"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_130#c0f100;
}
way.cond_forward_kmh[prop(maxsp_forward_cond, maxspeedcasinglayer)="140"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_kmh[prop(maxsp_backward_cond, maxspeedcasinglayer)="140"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_140#438100;
}
/* 5.3.2 - mph */
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="5"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="5"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_5_mph#b80022;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="10"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="10"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_10_mph#00da8b;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="15"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="15"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_15_mph#e3cc82;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="20"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="20"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_20_mph#4d4dff;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="25"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="25"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_25_mph#4d4d00;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="30"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="30"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_30_mph#fd6eaa;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="35"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="35"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_35_mph#07f807;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="40"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="40"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_40_mph#9f9fff;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="45"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="45"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_45_mph#ee8b00;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="50"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="50"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_50_mph#f90808;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="55"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="55"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_55_mph#07f8f8;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="60"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="60"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_60_mph#f807f8;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="65"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="65"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_65_mph#7807f8;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="70"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="70"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_70_mph#b69b20;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="75"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="75"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_75_mph#c0f100;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="80"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="80"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_80_mph#438100;
}
way.cond_forward_mph[prop(maxsp_forward_cond, maxspeedcasinglayer)="85"]!:righthandtraffic::maxspeedcasinglayer,
way.cond_backward_mph[prop(maxsp_backward_cond, maxspeedcasinglayer)="85"]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes-background-color: speed_85_mph#725600;
}

/* 5.4 - general rules */
way.maxspeed_left::maxspeedcasinglayer,
way.maxspeed_left_cond::maxspeedcasinglayer
{
    left-casing-width: 6;
    left-casing-offset: 0;
    major-z-index: 3;
    z-index: -1;
}
way|z16.maxspeed_left::maxspeedcasinglayer,
way|z16.maxspeed_left_cond::maxspeedcasinglayer
{
    left-casing-width: 5;
}
way|z-15.maxspeed_left::maxspeedcasinglayer,
way|z-15.maxspeed_left_cond::maxspeedcasinglayer
{
    left-casing-width: 4;
}
way.maxspeed_left_cond!.maxspeed_left::maxspeedcasinglayer
{
    left-casing-opacity: 0;
    left-casing-dashes-background-opacity: 1;
}
way.maxspeed_left[maxspeed:variable:forward]!:righthandtraffic::maxspeedcasinglayer,
way.maxspeed_left[maxspeed:variable:backward]:righthandtraffic::maxspeedcasinglayer,
way.maxspeed_left_cond[maxspeed:variable:forward]!:righthandtraffic::maxspeedcasinglayer,
way.maxspeed_left_cond[maxspeed:variable:backward]:righthandtraffic::maxspeedcasinglayer
{
    left-casing-dashes: 34,6;
}

/*************************************/

/* 6 - display maxspeed values as text (text always in default layer) */
way[setting("textdisplay")][maxspeed]
{
    maxspeedvalues: tag(maxspeed);
    set text_available;
}
way[setting("textdisplay")][maxspeed:forward]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  fw", tag("maxspeed:forward"));
    set text_available;
}
way[setting("textdisplay")][maxspeed:backward]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  bw", tag("maxspeed:backward"));
    set text_available;
}

/* get rid of the text after "@" as it can be a long text while keeping mph and knots */
way[setting("textdisplay")][maxspeed:conditional]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  c", get(split(" @", tag("maxspeed:conditional")), 0));
    set text_available;
}
way[setting("textdisplay")][maxspeed:forward:conditional]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  fwc", get(split(" @", tag("maxspeed:forward:conditional")), 0));
    set text_available;
}
way[setting("textdisplay")][maxspeed:backward:conditional]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  bwc", get(split(" @", tag("maxspeed:backward:conditional")), 0));
    set text_available;
}

way[setting("textdisplay")][maxspeed:advisory]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  a", tag("maxspeed:advisory"));
    set text_available;
}
way[setting("textdisplay")][maxspeed:advisory:forward]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  afw", tag("maxspeed:advisory:forward"));
    set text_available;
}
way[setting("textdisplay")][maxspeed:advisory:backward]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  abw", tag("maxspeed:advisory:backward"));
    set text_available;
}

/* display "v" only for the values yes or other reasons (as the reason can be a long text), but not for value no */
way[setting("textdisplay")][maxspeed:variable][maxspeed:variable!=no]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  v");
    set text_available;
}
way[setting("textdisplay")][maxspeed:variable:forward][maxspeed:variable:forward!=no]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  vfw");
    set text_available;
}
way[setting("textdisplay")][maxspeed:variable:backward][maxspeed:variable:backward!=no]
{
    maxspeedvalues: concat(prop(maxspeedvalues), "  vbw");
    set text_available;
}

way|z18-[setting("textdisplay")].text_available
{
    font-size: 13;
    text-color: black;
    text-halo-radius: 2;
    text-halo-color: white;
    text: prop(maxspeedvalues);
}


/*************************************/

/* 7 - error reporting (text always in default layer, overwrites text: prop(maxspeedvalues))*/
/* 7.1 - report wrong value of maxspeed (knots has no style support but should not produce a warning anyway) */
way[maxspeed=~/^[1-9][0-9]*( mph| knots)?$/],
way[maxspeed=signals],
way[maxspeed=none],
way[maxspeed=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")],
way[maxspeed=~/^(FR):(zone30)/][setting("implicit")],
way[maxspeed=~/^(RO|RS):(trunk)/][setting("implicit")],
way[maxspeed=~/^(BY|RS|RU):(living_street)/][setting("implicit")]
{
    set correct_value;
}
way[maxspeed:forward=~/^[1-9][0-9]*( mph| knots)?$/],
way[maxspeed:forward=signals],
way[maxspeed:forward=none],
way[maxspeed:forward=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")],
way[maxspeed:forward=~/^(FR):(zone30)/][setting("implicit")],
way[maxspeed:forward=~/^(RO|RS):(trunk)/][setting("implicit")],
way[maxspeed:forward=~/^(BY|RS|RU):(living_street)/][setting("implicit")]
{
    set correct_value_forward;
}
way[maxspeed:backward=~/^[1-9][0-9]*( mph| knots)?$/],
way[maxspeed:backward=signals],
way[maxspeed:backward=none],
way[maxspeed:backward=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")],
way[maxspeed:backward=~/^(FR):(zone30)/][setting("implicit")],
way[maxspeed:backward=~/^(RO|RS):(trunk)/][setting("implicit")],
way[maxspeed:backward=~/^(BY|RS|RU):(living_street)/][setting("implicit")]
{
    set correct_value_backward;
}

way["maxspeed"]!.correct_value,
way["maxspeed:forward"]!.correct_value_forward,
way["maxspeed:backward"]!.correct_value_backward
{
    color: yellow;
    dashes-background-color: red;
    dashes: 4,24;
    width: 5;
    text: tr("wrong maxspeed value!");
    text-color: black;
    font-size: 11;
    text-halo-color: red;
    text-halo-radius: 2;
    left-casing-width: 1;
    left-casing-color: yellow;
    right-casing-width: 1;
    right-casing-color: yellow;
    major-z-index: 3;
}


/* 7.2 - report wrong value of maxspeed:conditional */
way["maxspeed:conditional"=~/^(none|[1-9][0-9]*( mph| knots)?) @ /]
{
    set correct_value_cond;
}

way["maxspeed:forward:conditional"=~/^(none|[1-9][0-9]*( mph| knots)?) @ /]
{
    set correct_value_forward_cond;
}


way["maxspeed:backward:conditional"=~/^(none|[1-9][0-9]*( mph| knots)?) @ /]
{
    set correct_value_backward_cond;
}


way["maxspeed:conditional"]!.correct_value_cond,
way["maxspeed:forward:conditional"]!.correct_value_forward_cond,
way["maxspeed:backward:conditional"]!.correct_value_backward_cond
{
    color: yellow;
    dashes-background-color: red;
    dashes: 4,24;
    width: 5;
    text: tr("wrong conditional maxspeed value!");
    text-color: black;
    font-size: 11;
    text-halo-color: red;
    text-halo-radius: 2;
    left-casing-width: 1;
    left-casing-color: yellow;
    right-casing-width: 1;
    right-casing-color: yellow;
    major-z-index: 3;
}

/* 7.3 - report conditional maxspeed without default maxspeed */
way["maxspeed:conditional"][!"maxspeed"],
way["maxspeed:forward:conditional"][!"maxspeed:forward"][!"maxspeed"],
way["maxspeed:backward:conditional"][!"maxspeed:backward"][!"maxspeed"]
{
    color: yellow;
    dashes-background-color: red;
    dashes: 4,24;
    width: 5;
    text: tr("conditional maxspeed without default maxspeed!");
    text-color: black;
    font-size: 11;
    text-halo-color: red;
    text-halo-radius: 2;
    left-casing-width: 1;
    left-casing-color: yellow;
    right-casing-width: 1;
    right-casing-color: yellow;
    major-z-index: 3;

}

/* 7.4 - report wrong value of maxspeed:advisory */
way[maxspeed:advisory=~/^[1-9][0-9]*( mph| knots)?$/]
{
    set correct_value_advisory;
}
way[maxspeed:advisory:forward=~/^[1-9][0-9]*( mph| knots)?$/]
{
    set correct_value_advisory_forward;
}
way[maxspeed:advisory:backward=~/^[1-9][0-9]*( mph| knots)?$/]
{
    set correct_value_advisory_backward;
}

way["maxspeed:advisory"]!.correct_value_advisory,
way["maxspeed:advisory:forward"]!.correct_value_advisory_forward,
way["maxspeed:advisory:backward"]!.correct_value_advisory_backward
{
    color: yellow;
    dashes-background-color: red;
    dashes: 4,24;
    width: 5;
    text: tr("wrong maxspeed:advisory value!");
    text-color: black;
    font-size: 11;
    text-halo-color: red;
    text-halo-radius: 2;
    left-casing-width: 1;
    left-casing-color: yellow;
    right-casing-width: 1;
    right-casing-color: yellow;
    major-z-index: 3;
}

/* 7.5 - report if maxspeed direction is opposed to oneway direction */
way["maxspeed:backward"][oneway?],
way["maxspeed:forward"][oneway=-1]
{
    color: yellow;
    dashes-background-color: red;
    dashes: 4,24;
    width: 5;
    text: tr("maxspeed opposed to oneway direction!");
    text-color: black;
    font-size: 11;
    text-halo-color: red;
    text-halo-radius: 2;
    left-casing-width: 1;
    left-casing-color: yellow;
    right-casing-width: 1;
    right-casing-color: yellow;
    major-z-index: 3;
}

Styles_Maxspeed-style.mapcss, Styles_Maxspeed.zip

Last modified 4 weeks ago Last modified on 2025-01-02T18:19:09+01:00

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.