wiki:Styles/Lane_and_Road_Attributes

Languages:

Icon (NOZIP) Lanes and Road Attributes mappaint style

This style visualizes a number of lane and road specific attributes. Namely common variants of the following tags are considered:

  • lanes: Number of lanes for motorized traffic.
  • width: The width of the carriageway. Lane-dependent width using width:lanes is fully supported.
  • change: Allowed resp. forbidden lane changes.
  • turn: Indication of turning lanes, including preliminary support for values hook_right and hook_left (this might change!)
  • cycleway: Only cycle tracks are supported if specified with cycleway. Cycle lanes need bicycle:lanes=...|designated|... to be visible.
  • bicycle:lanes: Dedicated bicycle lanes.
  • bus:lanes: Dedicated bus lanes.
  • psv:lanes: Dedicated PSV (public service vehicle) lanes.
  • placement: Placement of the road relative to the OSM-way. The value transition is not supported.
  • man_made=bridge: Used to indicate the outline of a bridge and group together all features of that bridge.
  • lit: Indication if a road is lit or not.
  • highway=street_lamp: Street lamp
  • destination: Signposted destination of a road. Only rudimentary support without lane-dependent values. The subkeys destination:ref and destination:country are also supported.
  • highway=junction: Can be used to indicate the outline of a junction and group together all features of it.
  • Relation enforcement: The to and from members of such relations are highlighted
  • traffic_sign: Traffic signs for speed limits and overtaking are displayed if tagged with traffic_sign=maxspeed/overtaking and maxspeed=<limit> resp. overtaking=yes/no. The value implicit for maxspeed is interpreted as the end of the speed limit. Combinations like traffic_sign=maxspeed;overtaking are also supported.
  • hov:lanes: Dedicated HOV lanes. The minimum requirement can be specified by hov:minimum (supported values: 2 and 3)
  • Relation destination_sign: Experimental and very limited support!
  • driving_side: Used to specify the driving side of the traffic. This is only supported on ways.
  • railway: Tracks of railways are rendered with limited support for gauge, embedded and electrified.
  • transit: Specify how a lane continues in the next road segment. Only verification of valid values!

Furthermore:

  • Common suffixes like :forward, :backward, :left, :right: and :both as well as the proposed :both_ways (for lanes in both directions) are supported where appropriate.
  • Some common tagging errors are detected and displayed, e.g. inconsistent number of lane-dependent values and typos in the keys turn and change.
  • The style also supports left-hand traffic; see section Settings.

Use the Map Style Dialog to download and activate the style. A good starting point to see it in action is the area around Graz in Austria.

To report bugs or provide feedback send me a message.

Settings

Some settings of the style can be configured using Edit -> Preferences -> Display settings -> Colours. All settings start with mappaint.lane.and.road.attributes. Settings that contain the text "boolean" treat white as yes and any other color as no. Settings that contain the text "opacity" use the lightness to specify the opacity (the values for transparency or alpha are completely ignored!)

  • The settings carriage.way.backward, carriage.way.forward and carriage.way.both_ways specify the colour of the respective lanes.
  • The settings sidewalk, cycletrack and combined.sidewalk.and.cycletrack specify the colour of the sidewalk, a cycletrack and a combined sidewalk and cycletrack
  • If boolean.right.hand.traffic is set to white, lanes are rendered for right hand traffic, if set to black for left hand traffic and if set to anything else (which is now the default) the right- and left-hand traffic database from JOSM is used to automatically determine the side.
  • If boolean.use.svg.for.turning.markings is set to white, the markings for turning lanes are rendered more precisely. If you run into memory problems, set this to black. If this is set to black, the setting integer.png.turn.variant can be used to specify which set of png images should be used for turn markings. Currently two sets are supplied (value 000000 and 000001).
  • The settings opacity.lane, opacity.markings and opacity.sidewalk specify the opacity of the lane background, road markings and the sidewalk background. If set to white they are opaque; if set to black they are completely transparent, any grey setting in between is treated an appropriate opacity.

Known limitations/bugs

  • A bug in JOSM leads sometimes to rendering artefacts.
  • Left-hand traffic is nearly untested. Please provide feedback.
  • Roads with oneway=-1 may lead to incorrect results. Please provide feedback.
  • change:lanes without suffix is currently only supported on one-ways and for the special case of change:lanes=no|no.
  • In forward and backward direction a maximum of eight lanes and for lanes in both directions a maximum of four lanes is displayed.

Acknowledgments

  • To Wolfgang Hinsch who created a first style which visualizes many lane-specific features. Before I saw his style I wouldn't believe that this is possible.
  • To Paul Hartmann who implemented some desperately needed extensions for JOSM which made the implementation of this style a lot easier and improved performance significantly.
  • To all who provided valuable feedback during the creation of this style.

Preset

An appropriate preset for lane attributes is available at Lane Attributes.

Screenshot

screenshot (NOZIP)

Code

meta 
{
    title: "Lane and road attributes";
    description: "Visualization of lanes, width, turn lanes, changing the lane, destination, lighting and street lamps, sidewalk, cycletracks, bicycle lanes, bus lanes, psv lanes.";
    link: "http://josm.openstreetmap.de/wiki/Styles/Lane_and_Road_Attributes";
    author: "Martin Vonwald";
    version: "2.10-61_2015-06-02";
    license: "CC-BY-SA";
    icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNyAxOCI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM4NSAtNTI0LjM2KSI+PHBhdGggZmlsbD0iIzIwMmQyMCIgZD0ibSAzODUgNTI0LjM2IGggMTcgdiAxOCBoIC0xNyB6Ii8+PGcgZmlsbD0ibm9uZSI+PGcgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgc3Ryb2tlLXdpZHRoPSIxLjgiPjxwYXRoIGQ9Im0gMzg3LjUgNTI1LjI2IHYgMTYuMiIgc3Ryb2tlPSIjZTRlN2U0Ii8+PHBhdGggZD0ibSAzOTkuNSA1MjUuMjYgdiAxNi4yIiBzdHJva2U9IiNlNWU3ZTUiLz48L2c+PHBhdGggZD0ibSAzOTMuNSA1MjYuMzYgdiA0IiBzdHJva2U9IiNlNWU3ZTUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxLjciLz48L2c+PHBhdGggZD0ibSAzOTMuNSA1MzUuMzYgdiA0IiBmaWxsPSIjZTRlN2U0IiBzdHJva2U9IiNlNWU3ZTUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxLjciLz48L2c+PC9zdmc+";
    min-josm-version: "7287";
}

meta[lang=de]
{
    title: "Fahrspur- und Straßenattribute";
    description: "Anzeige von Fahrspuren, Breite, Abbiegespuren, Spurwechsel, Zielangaben, Beleuchtung inkl. Straßenlampen, Gehsteig/Bürgersteig, Radwege, Fahrradspuren, Busspuren, Öffi-Spuren.";
    link: "http://josm.openstreetmap.de/wiki/De:Styles/Lane_and_Road_Attributes";
}


/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Global settings and initialization                                                                                                              */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way
{
  /* Settings: change if necessary */
  style_right_hand_traffic: yes;  /* Will be overriden by ugly hack below */
  style_lane_opacity: 0.5;        /* Will be overriden by ugly hack below */
  style_sidewalk_opacity: 0.5;    /* Will be overriden by ugly hack below */
  style_markings_opacity: 0.8;    /* Will be overriden by ugly hack below */
  style_show_warnings: yes;       /* Will be overriden by ugly hack below */
  style_show_errors: yes;         /* Will be overriden by ugly hack below */
  style_show_disputed: no;        /* Will be overriden by ugly hack below */
  style_use_svg_turn: yes;        /* Will be overriden by ugly hack below */
  
  /* Ugly hack to make opacity configurable */
  ugly_lane_opacity: Opacity_lane#808080;
  style_lane_opacity: eval((red(prop(ugly_lane_opacity))+green(prop(ugly_lane_opacity))+blue(prop(ugly_lane_opacity)))/3);
  ugly_sidewalk_opacity: Opacity_sidewalk#808080;
  style_sidewalk_opacity: eval((red(prop(ugly_sidewalk_opacity))+green(prop(ugly_sidewalk_opacity))+blue(prop(ugly_sidewalk_opacity)))/3);
  ugly_markings_opacity: Opacity_markings#CCCCCC;
  style_markings_opacity: eval((red(prop(ugly_markings_opacity))+green(prop(ugly_markings_opacity))+blue(prop(ugly_markings_opacity)))/3);

  /* Ugly hack to make boolean configurable */
  ugly_right_hand_traffic: Boolean_right_hand_traffic#888888;
  /*style_right_hand_traffic: eval(red(prop(ugly_right_hand_traffic)))=1;*/
  /*style_right_hand_traffic: eval(is_right_hand_traffic());*/
  style_right_hand_traffic: eval((red(prop(ugly_right_hand_traffic))=1)?yes:((red(prop(ugly_right_hand_traffic))=0)?no:is_right_hand_traffic()));
  ugly_show_warnings: Boolean_show_warnings#FFFFFF;
  style_show_warnings: eval(red(prop(ugly_show_warnings)))=1;
  ugly_show_errors: Boolean_show_errors#FFFFFF;
  style_show_errors: eval(red(prop(ugly_show_errors)))=1;
  ugly_show_disputed: Boolean_show_disputed#000000;
  style_show_disputed: eval(red(prop(ugly_show_disputed)))=1;
  ugly_use_svg_turn: Boolean_use_svg_for_turning_markings#FFFFFF;
  style_use_svg_turn: eval(red(prop(ugly_use_svg_turn)))=1;
  ugly_png_turn_variant: Integer_PNG_turn_variant#000000;
  style_png_turn_variant: eval(round(blue(prop((ugly_png_turn_variant)))*256));
  ugly_use_svg_destination: Boolean_use_svg_for_destination#FFFFFF;
  style_use_svg_destination: eval(red(prop(ugly_use_svg_destination)))=1;

  /* Color of the sidewalk: none (ignored), sidewalk only, cycletrack only, sidewalk and cycletrack */
  style_sidewalk_color: eval(list(#000000,Sidewalk#808080,Cycletrack#8080C0,Combined_sidewalk_and_cycletrack#C08080));

  /* Color of the dashes if lane is access=no */
  style_noaccess_color: No_access#FF0000;
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Decide which roads should be rendered                                                                                                           */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way[lanes][!leisure],
way[lanes:forward],
way[lanes:backward],
way[turn:lanes],way[turn:lanes:forward],way[turn:lanes:backward],way[turn:lanes:both_ways],
way[change:lanes],way[change:lanes:forward],way[change:lanes:backward],way[change:lanes:both_ways],
way[sidewalk][highway],
way[cycleway=track],way[cycleway:left],way[cycleway:right],way[cycleway:both],
way[destination],way[destination:forward],way[destination:backward]
{ ok: yes; }

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* One-ways                                                                                                                                        */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way[is_prop_set(ok)]                                 { oneway_type:  0; }
way[is_prop_set(ok)][oneway?]                        { oneway_type:  1; }
way[is_prop_set(ok)][oneway=-1]                      { oneway_type: -1; }
way[is_prop_set(ok)][junction=roundabout][!oneway]   { oneway_type:  1; }

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Overrule left-hand/right-hand traffic                                                                                                           */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way[driving_side]
{
    style_right_hand_traffic: eval((tag(driving_side)="left")?no:yes);
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Pixel per metre (on average)                                                                                                                    */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
*|z16  { pixel_per_metre: 0.625; }
*|z17  { pixel_per_metre: 1.25; }
*|z18  { pixel_per_metre: 2.5; }
*|z19  { pixel_per_metre: 5; }
*|z20  { pixel_per_metre: 10; }
*|z21  { pixel_per_metre: 20; }
*|z22  { pixel_per_metre: 40; }
*|z23  { pixel_per_metre: 80; }
*|z24  { pixel_per_metre: 160; }
*|z25  { pixel_per_metre: 320; }
*|z26- { pixel_per_metre: 640; }

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Colors                                                                                                                                          */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way[is_prop_set(ok)]
{
    /* Base color of the carriage way */
    /* TODO: obsolete - remove in future release: ground-color:   #404040; */

    /* Individual colors for each direction */
    color_forward:  Carriage_way_forward#405A40;
    color_backward: Carriage_way_backward#5A4040;
    color_bothways: Carriage_way_bothways#40405A;
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Lane initializiation                                                                                                                            */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way|z17- {} /* ATTENTION: For whatever reason this is needed, otherwise the following won't be interpreted correctly */
way|z17-[is_prop_set(ok)]
{
    change_forward_1_left: yes;    change_forward_1_right: yes;
    change_forward_2_left: yes;    change_forward_2_right: yes;
    change_forward_3_left: yes;    change_forward_3_right: yes;
    change_forward_4_left: yes;    change_forward_4_right: yes;
    change_forward_5_left: yes;    change_forward_5_right: yes;
    change_forward_6_left: yes;    change_forward_6_right: yes;
    change_forward_7_left: yes;    change_forward_7_right: yes;
    change_forward_8_left: yes;    change_forward_8_right: yes;

    change_backward_1_left: yes;    change_backward_1_right: yes;
    change_backward_2_left: yes;    change_backward_2_right: yes;
    change_backward_3_left: yes;    change_backward_3_right: yes;
    change_backward_4_left: yes;    change_backward_4_right: yes;
    change_backward_5_left: yes;    change_backward_5_right: yes;
    change_backward_6_left: yes;    change_backward_6_right: yes;
    change_backward_7_left: yes;    change_backward_7_right: yes;
    change_backward_8_left: yes;    change_backward_8_right: yes;

    change_bothways_1_left: yes;    change_bothways_1_right: yes;
    change_bothways_2_left: yes;    change_bothways_2_right: yes;
    change_bothways_3_left: yes;    change_bothways_3_right: yes;
    change_bothways_4_left: yes;    change_bothways_4_right: yes;

    color_forward_1: prop(color_forward);
    color_forward_2: prop(color_forward);
    color_forward_3: prop(color_forward);
    color_forward_4: prop(color_forward);
    color_forward_5: prop(color_forward);
    color_forward_6: prop(color_forward);
    color_forward_7: prop(color_forward);
    color_forward_8: prop(color_forward);

    color_backward_1: prop(color_backward);
    color_backward_2: prop(color_backward);
    color_backward_3: prop(color_backward);
    color_backward_4: prop(color_backward);
    color_backward_5: prop(color_backward);
    color_backward_6: prop(color_backward);
    color_backward_7: prop(color_backward);
    color_backward_8: prop(color_backward);
    
    color_bothways_1: prop(color_bothways);
    color_bothways_2: prop(color_bothways);
    color_bothways_3: prop(color_bothways);
    color_bothways_4: prop(color_bothways);

    sign_forward_1: "";         sign_backward_1: "";
    sign_forward_2: "";         sign_backward_2: "";
    sign_forward_3: "";         sign_backward_3: "";
    sign_forward_4: "";         sign_backward_4: "";
    sign_forward_5: "";         sign_backward_5: "";
    sign_forward_6: "";         sign_backward_6: "";
    sign_forward_7: "";         sign_backward_7: "";
    sign_forward_8: "";         sign_backward_8: "";

    tag_lanes_all_min:  9999; tag_lanes_all_max: 0;
    tag_lanes_fwd_min:  9999; tag_lanes_fwd_max: 0;
    tag_lanes_bwd_min:  9999; tag_lanes_bwd_max: 0;
    tag_lanes_both_min: 9999; tag_lanes_both_max: 0;
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Determine allowed lane changes                                                                                                                  */
/* TODO: change:lanes without oneway, but only with values yes or no                                                                               */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Error checking                                                                                                                                  */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way["change"]
{
    data_error: eval(regexp_test("^(yes|no|only_left|only_right|not_left|not_right)$",tag("change"))?prop(data_error):"invalid change value");
}
way["change:forward"]
{
    data_error: eval(regexp_test("^(yes|no|only_left|only_right|not_left|not_right)$",tag("change:forward"))?prop(data_error):"invalid change:forward value");
}
way["change:backward"]
{
    data_error: eval(regexp_test("^(yes|no|only_left|only_right|not_left|not_right)$",tag("change:backward"))?prop(data_error):"invalid change:backward value");
}
way["change:both_ways"]
{
    data_error: eval(regexp_test("^(yes|no|only_left|only_right|not_left|not_right)$",tag("change:both_ways"))?prop(data_error):"invalid change:both_ways value");
}
way["change:lanes"][!(prop(oneway_type)=0)]
{
    data_error: eval(regexp_test("^(yes|no|only_left|only_right|not_left|not_right|\\|)*$",tag("change:lanes"))?prop(data_error):"invalid change:lanes value");
}
way["change:lanes"][prop(oneway_type)=0]
{
    data_error: eval(regexp_test("^(yes|no|\\|)*$",tag("change:lanes"))?prop(data_error):"invalid change:lanes value");
}
way["change:lanes:forward"]
{
    data_error: eval(regexp_test("^(yes|no|only_left|only_right|not_left|not_right|\\|)*$",tag("change:lanes:forward"))?prop(data_error):"invalid change:lanes:forward value");
}
way["change:lanes:backward"]
{
    data_error: eval(regexp_test("^(yes|no|only_left|only_right|not_left|not_right|\\|)*$",tag("change:lanes:backward"))?prop(data_error):"invalid change:lanes:backward value");
}
way["change:lanes:both_ways"]
{
    data_error: eval(regexp_test("^(yes|no|only_left|only_right|not_left|not_right|\\|)*$",tag("change:lanes:both_ways"))?prop(data_error):"invalid change:lanes:both_ways value");
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Forward lanes                                                                                                                                   */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["change:lanes:forward"],
way|z17-[is_prop_set(ok)]["change:forward"],
way|z17-[is_prop_set(ok)]["change:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)]["change"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("change:lanes"),tag("change:lanes"),cond(has_tag_key("change"),tag("change"),
                                cond(has_tag_key("change:lanes:forward"),tag("change:lanes:forward"),tag("change:forward")))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    change_forward_1_left:  eval((prop(temp_length)>0) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),0)));
    change_forward_1_right: eval((prop(temp_length)>0) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),0)));
    change_forward_2_left:  eval((prop(temp_length)>1) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),1)));
    change_forward_2_right: eval((prop(temp_length)>1) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),1)));
    change_forward_3_left:  eval((prop(temp_length)>2) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),2)));
    change_forward_3_right: eval((prop(temp_length)>2) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),2)));
    change_forward_4_left:  eval((prop(temp_length)>3) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),3)));
    change_forward_4_right: eval((prop(temp_length)>3) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),3)));
    change_forward_5_left:  eval((prop(temp_length)>4) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),4)));
    change_forward_5_right: eval((prop(temp_length)>4) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),4)));
    change_forward_6_left:  eval((prop(temp_length)>5) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),5)));
    change_forward_6_right: eval((prop(temp_length)>5) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),5)));
    change_forward_7_left:  eval((prop(temp_length)>6) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),6)));
    change_forward_7_right: eval((prop(temp_length)>6) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),6)));
    change_forward_8_left:  eval((prop(temp_length)>7) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),7)));
    change_forward_8_right: eval((prop(temp_length)>7) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),7)));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("change:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("change:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("change:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("change:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Backward lanes                                                                                                                                   */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["change:lanes:backward"],
way|z17-[is_prop_set(ok)]["change:backward"],
way|z17-[is_prop_set(ok)]["change:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)]["change"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("change:lanes"),tag("change:lanes"),cond(has_tag_key("change"),tag("change"),
                                cond(has_tag_key("change:lanes:backward"),tag("change:lanes:backward"),tag("change:backward")))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    change_lanes_bwd: eval(length(prop(temp_list)));
    change_backward_1_left:  eval((prop(temp_length)>0) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),0)));
    change_backward_1_right: eval((prop(temp_length)>0) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),0)));
    change_backward_2_left:  eval((prop(temp_length)>1) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),1)));
    change_backward_2_right: eval((prop(temp_length)>1) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),1)));
    change_backward_3_left:  eval((prop(temp_length)>2) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),2)));
    change_backward_3_right: eval((prop(temp_length)>2) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),2)));
    change_backward_4_left:  eval((prop(temp_length)>3) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),3)));
    change_backward_4_right: eval((prop(temp_length)>3) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),3)));
    change_backward_5_left:  eval((prop(temp_length)>4) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),4)));
    change_backward_5_right: eval((prop(temp_length)>4) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),4)));
    change_backward_6_left:  eval((prop(temp_length)>5) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),5)));
    change_backward_6_right: eval((prop(temp_length)>5) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),5)));
    change_backward_7_left:  eval((prop(temp_length)>6) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),6)));
    change_backward_7_right: eval((prop(temp_length)>6) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),6)));
    change_backward_8_left:  eval((prop(temp_length)>7) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),7)));
    change_backward_8_right: eval((prop(temp_length)>7) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),7)));

    /* Lane count based on :lanes values */
    tag_lanes_bwd_min: eval(has_tag_key("change:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("change:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Bothways lanes                                                                                                                                  */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["change:lanes:both_ways"],
way|z17-[is_prop_set(ok)]["change:both_ways"]
{
    temp: eval(cond(has_tag_key("change:lanes:both_ways"),tag("change:lanes:both_ways"),tag("change:both_ways")));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    change_lanes_bth: eval(length(prop(temp_list)));
    change_bothways_1_left:  eval((prop(temp_length)>0) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),0)));
    change_bothways_1_right: eval((prop(temp_length)>0) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),0)));
    change_bothways_2_left:  eval((prop(temp_length)>1) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),1)));
    change_bothways_2_right: eval((prop(temp_length)>1) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),1)));
    change_bothways_3_left:  eval((prop(temp_length)>2) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),2)));
    change_bothways_3_right: eval((prop(temp_length)>2) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),2)));
    change_bothways_4_left:  eval((prop(temp_length)>3) && regexp_test("^(yes|only_left|not_right)$",get(prop(temp_list),3)));
    change_bothways_4_right: eval((prop(temp_length)>3) && regexp_test("^(yes|only_right|not_left)$",get(prop(temp_list),3)));

    /* Lane count based on :lanes values */
    tag_lanes_both_min: eval(has_tag_key("change:lanes:both_ways")?min(prop(tag_lanes_both_min),prop(temp_length)):prop(tag_lanes_both_min));
    tag_lanes_both_max: eval(has_tag_key("change:lanes:both_ways")?max(prop(tag_lanes_both_max),prop(temp_length)):prop(tag_lanes_both_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Extra support for change:lanes=no|no on twoway streets                                                                                          */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["change:lanes"="no|no"][prop(oneway_type)=0]
{
    change_forward_1_left:   false;
    change_forward_1_right:  false;
    change_backward_1_left:  false;
    change_backward_1_right: false;

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(min(prop(tag_lanes_all_min),2));
    tag_lanes_all_max: eval(max(prop(tag_lanes_all_max),2));
    tag_lanes_fwd_min: eval(min(1,prop(tag_lanes_fwd_min)));
    tag_lanes_fwd_max: eval(max(1,prop(tag_lanes_fwd_max)));
    tag_lanes_bwd_min: eval(min(1,prop(tag_lanes_bwd_min)));
    tag_lanes_bwd_max: eval(max(1,prop(tag_lanes_bwd_max)));
}


/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Determine turning lanes                                                                                                                         */
/* Note: rendering of "reverse" only when using svg                                                                                                */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Error checking                                                                                                                                  */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way["turn"] { data_error: eval(regexp_test("^(none|through|left|slight_left|sharp_left|hook_left|right|slight_right|sharp_right|hook_right|merge_to_left|merge_to_right|reverse|;)*$",tag("turn"))?prop(data_error):"invalid turn value"); }
way["turn:forward"] { data_error: eval(regexp_test("^(none|through|left|slight_left|sharp_left|hook_left|right|slight_right|sharp_right|hook_right|merge_to_left|merge_to_right|reverse|;)*$",tag("turn:forward"))?prop(data_error):"invalid turn:forward value"); }
way["turn:backward"] { data_error: eval(regexp_test("^(none|through|left|slight_left|sharp_left|hook_left|right|slight_right|sharp_right|hook_right|merge_to_left|merge_to_right|reverse|;)*$",tag("turn:backward"))?prop(data_error):"invalid turn:backward value"); }
way["turn:both_ways"] { data_error: eval(regexp_test("^(none|through|left|slight_left|sharp_left|hook_left|right|slight_right|sharp_right|hook_right|merge_to_left|merge_to_right|reverse|;)*$",tag("turn:both_ways"))?prop(data_error):"invalid turn:both_ways value"); }
way["turn:lanes"] { data_error: eval(regexp_test("^(none|through|left|slight_left|sharp_left|hook_left|right|slight_right|sharp_right|hook_right|merge_to_left|merge_to_right|reverse|;|\\|)*$",tag("turn:lanes"))?prop(data_error):"invalid turn:lanes value"); }
way["turn:lanes:forward"] { data_error: eval(regexp_test("^(none|through|left|slight_left|sharp_left|hook_left|right|slight_right|sharp_right|hook_right|merge_to_left|merge_to_right|reverse|;|\\|)*$",tag("turn:lanes:forward"))?prop(data_error):"invalid turn:lanes:forward value"); }
way["turn:lanes:backward"] { data_error: eval(regexp_test("^(none|through|left|slight_left|sharp_left|hook_left|right|slight_right|sharp_right|hook_right|merge_to_left|merge_to_right|reverse|;|\\|)*$",tag("turn:lanes:backward"))?prop(data_error):"invalid turn:lanes:backward value"); }
way["turn:lanes:both_ways"] { data_error: eval(regexp_test("^(none|through|left|slight_left|sharp_left|hook_left|right|slight_right|sharp_right|hook_right|merge_to_left|merge_to_right|reverse|;|\\|)*$",tag("turn:lanes:both_ways"))?prop(data_error):"invalid turn:lanes:both_ways value"); }

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Forward lanes (standard images)                                                                                                                 */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)][!prop(style_use_svg_turn)]["turn:lanes:forward"],
way|z17-[is_prop_set(ok)][!prop(style_use_svg_turn)]["turn:forward"],
way|z17-[is_prop_set(ok)][!prop(style_use_svg_turn)]["turn:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)][!prop(style_use_svg_turn)]["turn"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("turn:lanes"),tag("turn:lanes"),
                                cond(has_tag_key("turn"),tag("turn"),
                                cond(has_tag_key("turn:lanes:forward"),tag("turn:lanes:forward"),
                                     tag("turn:forward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    t: eval(get(prop(temp_list),0));
    turn_image_forward_1: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),1));
    turn_image_forward_2: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),2));
    turn_image_forward_3: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),3));
    turn_image_forward_4: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),4));
    turn_image_forward_5: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),5));
    turn_image_forward_6: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),6));
    turn_image_forward_7: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),7));
    turn_image_forward_8: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn forward ",prop(t),".png")
                                )
                                )
                            );

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("turn:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("turn:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("turn:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("turn:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}


/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Backward lanes (standard images)                                                                                                                */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)][!prop(style_use_svg_turn)]["turn:lanes:backward"],
way|z17-[is_prop_set(ok)][!prop(style_use_svg_turn)]["turn:backward"],
way|z17-[is_prop_set(ok)][!prop(style_use_svg_turn)]["turn:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)][!prop(style_use_svg_turn)]["turn"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("turn:lanes"),tag("turn:lanes"),
                                cond(has_tag_key("turn"),tag("turn"),
                                cond(has_tag_key("turn:lanes:backward"),tag("turn:lanes:backward"),
                                     tag("turn:backward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    t: eval(get(prop(temp_list),0));
    turn_image_backward_1: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),1));
    turn_image_backward_2: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),2));
    turn_image_backward_3: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),3));
    turn_image_backward_4: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),4));
    turn_image_backward_5: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),5));
    turn_image_backward_6: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),6));
    turn_image_backward_7: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",prop(t),".png")
                                )
                                )
                            );
    t: eval(get(prop(temp_list),7));
    turn_image_backward_8: eval( 
                                ((prop(t)="none") || (prop(t)=""))?prop(unset_property):
                                ( 
                                (prop(t)="reverse")?(prop(style_right_hand_traffic,"default")?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse righthand.png"):concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward reverse lefthand.png")):
                                (
                                    regexp_test(".*;.*",prop(t))?concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",regexp_test(".*left.*",prop(t))?"left":"",regexp_test(".*through.*",prop(t))?"through":"",regexp_test(".*right.*",prop(t))?"right":"",".png"):
                                    concat("images/png/turn-",prop(style_png_turn_variant),"/turn backward ",prop(t),".png")
                                )
                                )
                            );

    /* Lane count based on :lanes values */
    tag_lanes_bwd_min: eval(has_tag_key("turn:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("turn:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* SVG for turn images                                                                                                                             */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]
{
        turn_svg_through_forward: eval("<path fill='#FFF' d='m0,17.5,0,15,67.5-5,0,7.5,32.5-10-32.5-10,0,7.5z'/>");
        turn_svg_slight_right_forward: eval("<path fill='#FFF' d='m0,17.5,0,15,67.5-5c11.462-1.0193,18.459,10.285,20.46,13.902l-7.96,4.2,17.5,4.3683,2.5-15-7.753,4.1421c-2.247-4.5-6.12-15.4-24.747-16.6z'/>");
        turn_svg_right_forward: eval("<path fill='#FFF' d='m0,17.5,0,15,67.5-5c6.31-0.505,17.5,5,17.5,10h-10l12.5,12.5,12.5-12.5h-10c0-5-8.43-13.3-22.5-15z'/>");
        turn_svg_sharp_right_forward: eval("<path fill='#FFF' d='m0,17.5,0,15l62.497-4.7c7.5026,0.7633,2.5026,7.1294,0.0026,11.156l-7.5-4.0271,2.5,15,17.5-4.3125-7.878-4.2954c4.3284-6.3921,6.7048-17.943-4.6246-19.263z'/>");
        turn_svg_slight_left_forward: eval(concat("<g transform='translate(0,50) scale(1.0,-1.0)'>",prop(turn_svg_slight_right_forward),"</g>"));
        turn_svg_left_forward: eval(concat("<g transform='translate(0,50) scale(1.0,-1.0)'>",prop(turn_svg_right_forward),"</g>"));
        turn_svg_sharp_left_forward: eval(concat("<g transform='translate(0,50) scale(1.0,-1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"));
        turn_svg_reverse_right_hand_forward: eval("<path fill='#FFF' d='m0,40,0-15,62.497,4.6294c12.503,0.4,15.003-10,0.003-12.1v5.4671l-16.238-7.9671,16.238-7.5v5c15-2.1079,22.5,22.5-0.003,22.871z'/>");
        turn_svg_reverse_left_hand_forward: eval(concat("<g transform='translate(0,50) scale(1.0,-1.0)'>",prop(turn_svg_reverse_right_hand_forward),"</g>"));
        turn_svg_merge_to_right_forward: eval("<path fill='#FFF' d='m0,17.5,0,15,50.034-3.7063c7.4655-0.5212,13.016,2.3222,19.541,4.8112l-2.922,6.3951,33.347,5-25-22.5-3.2955,6.6794c-8.1542-5.6073-14.204-7.5071-21.734-7.9779z'/>");
        turn_svg_merge_to_left_forward: eval(concat("<g transform='translate(0,50) scale(1.0,-1.0)'>",prop(turn_svg_merge_to_right_forward),"</g>"));
        turn_svg_hook_right_forward: eval("<path fill='#FFF' d='m0,22.5,0,15,37.474-2.7759c11.051-1.2406,20.026-5.8731,20.026-15.873,0-5,5-3.8509,13.359-3.8509,9.1412,0,14.141-1.3338,14.141,5v17.5h-10l12.5,12.5,12.5-12.5h-10v-17.5c0-11.271-2.5-12.5-19.23-12.5-15.77,0-20.77,1.351-20.77,11.351,0,5-6.8784,6.8562-12.531,6.4246z'/>");
        turn_svg_hook_left_forward: eval(concat("<g transform='translate(0,50) scale(1.0,-1.0)'>",prop(turn_svg_hook_right_forward),"</g>"));
}


/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Forward lanes (SVG)                                                                                                                             */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn:lanes:forward"],
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn:forward"],
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("turn:lanes"),tag("turn:lanes"),
                                cond(has_tag_key("turn"),tag("turn"),
                                cond(has_tag_key("turn:lanes:forward"),tag("turn:lanes:forward"),
                                     tag("turn:forward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    turn_image_forward_1: ""; t: eval(get(prop(temp_list),0)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_forward_1: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_forward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_forward_1: eval(prop(t_test)?concat(prop(turn_image_forward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_forward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_forward_1: eval(prop(t_test)?concat(prop(turn_image_forward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_forward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_forward_1: eval(prop(t_test)?concat(prop(turn_image_forward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_forward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_forward_1: eval(prop(t_test)?concat(prop(turn_image_forward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_forward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_forward_1: eval(prop(t_test)?concat(prop(turn_image_forward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_forward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_forward_1: eval(prop(t_test)?concat(prop(turn_image_forward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_forward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_forward_1: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_forward_1),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_forward_1));
    turn_image_forward_1: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_1),prop(turn_svg_merge_to_right_forward)):prop(turn_image_forward_1));
    turn_image_forward_1: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_1),prop(turn_svg_merge_to_left_forward)):prop(turn_image_forward_1));
    turn_image_forward_1: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_1),prop(turn_svg_hook_right_forward)):prop(turn_image_forward_1));
    turn_image_forward_1: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_1),prop(turn_svg_hook_left_forward)):prop(turn_image_forward_1));
    turn_image_forward_1: eval((prop(turn_image_forward_1)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_forward_1),"</g></svg>"));

    turn_image_forward_2: ""; t: eval(get(prop(temp_list),1)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_forward_2: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_forward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_forward_2: eval(prop(t_test)?concat(prop(turn_image_forward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_forward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_forward_2: eval(prop(t_test)?concat(prop(turn_image_forward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_forward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_forward_2: eval(prop(t_test)?concat(prop(turn_image_forward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_forward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_forward_2: eval(prop(t_test)?concat(prop(turn_image_forward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_forward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_forward_2: eval(prop(t_test)?concat(prop(turn_image_forward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_forward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_forward_2: eval(prop(t_test)?concat(prop(turn_image_forward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_forward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_forward_2: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_forward_2),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_forward_2));
    turn_image_forward_2: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_2),prop(turn_svg_merge_to_right_forward)):prop(turn_image_forward_2));
    turn_image_forward_2: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_2),prop(turn_svg_merge_to_left_forward)):prop(turn_image_forward_2));
    turn_image_forward_2: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_2),prop(turn_svg_hook_right_forward)):prop(turn_image_forward_2));
    turn_image_forward_2: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_2),prop(turn_svg_hook_left_forward)):prop(turn_image_forward_2));
    turn_image_forward_2: eval((prop(turn_image_forward_2)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_forward_2),"</g></svg>"));

    turn_image_forward_3: ""; t: eval(get(prop(temp_list),2)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_forward_3: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_forward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_forward_3: eval(prop(t_test)?concat(prop(turn_image_forward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_forward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_forward_3: eval(prop(t_test)?concat(prop(turn_image_forward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_forward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_forward_3: eval(prop(t_test)?concat(prop(turn_image_forward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_forward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_forward_3: eval(prop(t_test)?concat(prop(turn_image_forward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_forward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_forward_3: eval(prop(t_test)?concat(prop(turn_image_forward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_forward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_forward_3: eval(prop(t_test)?concat(prop(turn_image_forward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_forward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_forward_3: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_forward_3),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_forward_3));
    turn_image_forward_3: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_3),prop(turn_svg_merge_to_right_forward)):prop(turn_image_forward_3));
    turn_image_forward_3: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_3),prop(turn_svg_merge_to_left_forward)):prop(turn_image_forward_3));
    turn_image_forward_3: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_3),prop(turn_svg_hook_right_forward)):prop(turn_image_forward_3));
    turn_image_forward_3: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_3),prop(turn_svg_hook_left_forward)):prop(turn_image_forward_3));
    turn_image_forward_3: eval((prop(turn_image_forward_3)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_forward_3),"</g></svg>"));

    turn_image_forward_4: ""; t: eval(get(prop(temp_list),3)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_forward_4: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_forward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_forward_4: eval(prop(t_test)?concat(prop(turn_image_forward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_forward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_forward_4: eval(prop(t_test)?concat(prop(turn_image_forward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_forward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_forward_4: eval(prop(t_test)?concat(prop(turn_image_forward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_forward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_forward_4: eval(prop(t_test)?concat(prop(turn_image_forward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_forward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_forward_4: eval(prop(t_test)?concat(prop(turn_image_forward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_forward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_forward_4: eval(prop(t_test)?concat(prop(turn_image_forward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_forward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_forward_4: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_forward_4),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_forward_4));
    turn_image_forward_4: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_4),prop(turn_svg_merge_to_right_forward)):prop(turn_image_forward_4));
    turn_image_forward_4: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_4),prop(turn_svg_merge_to_left_forward)):prop(turn_image_forward_4));
    turn_image_forward_4: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_4),prop(turn_svg_hook_right_forward)):prop(turn_image_forward_4));
    turn_image_forward_4: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_4),prop(turn_svg_hook_left_forward)):prop(turn_image_forward_4));
    turn_image_forward_4: eval((prop(turn_image_forward_4)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_forward_4),"</g></svg>"));

    turn_image_forward_5: ""; t: eval(get(prop(temp_list),4)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_forward_5: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_forward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_forward_5: eval(prop(t_test)?concat(prop(turn_image_forward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_forward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_forward_5: eval(prop(t_test)?concat(prop(turn_image_forward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_forward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_forward_5: eval(prop(t_test)?concat(prop(turn_image_forward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_forward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_forward_5: eval(prop(t_test)?concat(prop(turn_image_forward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_forward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_forward_5: eval(prop(t_test)?concat(prop(turn_image_forward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_forward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_forward_5: eval(prop(t_test)?concat(prop(turn_image_forward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_forward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_forward_5: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_forward_5),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_forward_5));
    turn_image_forward_5: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_5),prop(turn_svg_merge_to_right_forward)):prop(turn_image_forward_5));
    turn_image_forward_5: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_5),prop(turn_svg_merge_to_left_forward)):prop(turn_image_forward_5));
    turn_image_forward_5: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_5),prop(turn_svg_hook_right_forward)):prop(turn_image_forward_5));
    turn_image_forward_5: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_5),prop(turn_svg_hook_left_forward)):prop(turn_image_forward_5));
    turn_image_forward_5: eval((prop(turn_image_forward_5)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_forward_5),"</g></svg>"));

    turn_image_forward_6: ""; t: eval(get(prop(temp_list),5)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_forward_6: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_forward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_forward_6: eval(prop(t_test)?concat(prop(turn_image_forward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_forward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_forward_6: eval(prop(t_test)?concat(prop(turn_image_forward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_forward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_forward_6: eval(prop(t_test)?concat(prop(turn_image_forward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_forward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_forward_6: eval(prop(t_test)?concat(prop(turn_image_forward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_forward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_forward_6: eval(prop(t_test)?concat(prop(turn_image_forward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_forward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_forward_6: eval(prop(t_test)?concat(prop(turn_image_forward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_forward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_forward_6: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_forward_6),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_forward_6));
    turn_image_forward_6: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_6),prop(turn_svg_merge_to_right_forward)):prop(turn_image_forward_6));
    turn_image_forward_6: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_6),prop(turn_svg_merge_to_left_forward)):prop(turn_image_forward_6));
    turn_image_forward_6: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_6),prop(turn_svg_hook_right_forward)):prop(turn_image_forward_6));
    turn_image_forward_6: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_6),prop(turn_svg_hook_left_forward)):prop(turn_image_forward_6));
    turn_image_forward_6: eval((prop(turn_image_forward_6)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_forward_6),"</g></svg>"));

    turn_image_forward_7: ""; t: eval(get(prop(temp_list),6)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_forward_7: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_forward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_forward_7: eval(prop(t_test)?concat(prop(turn_image_forward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_forward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_forward_7: eval(prop(t_test)?concat(prop(turn_image_forward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_forward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_forward_7: eval(prop(t_test)?concat(prop(turn_image_forward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_forward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_forward_7: eval(prop(t_test)?concat(prop(turn_image_forward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_forward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_forward_7: eval(prop(t_test)?concat(prop(turn_image_forward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_forward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_forward_7: eval(prop(t_test)?concat(prop(turn_image_forward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_forward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_forward_7: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_forward_7),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_forward_7));
    turn_image_forward_7: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_7),prop(turn_svg_merge_to_right_forward)):prop(turn_image_forward_7));
    turn_image_forward_7: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_7),prop(turn_svg_merge_to_left_forward)):prop(turn_image_forward_7));
    turn_image_forward_7: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_7),prop(turn_svg_hook_right_forward)):prop(turn_image_forward_7));
    turn_image_forward_7: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_7),prop(turn_svg_hook_left_forward)):prop(turn_image_forward_7));
    turn_image_forward_7: eval((prop(turn_image_forward_7)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_forward_7),"</g></svg>"));

    turn_image_forward_8: ""; t: eval(get(prop(temp_list),7)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_forward_8: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_forward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_forward_8: eval(prop(t_test)?concat(prop(turn_image_forward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_forward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_forward_8: eval(prop(t_test)?concat(prop(turn_image_forward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_forward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_forward_8: eval(prop(t_test)?concat(prop(turn_image_forward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_forward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_forward_8: eval(prop(t_test)?concat(prop(turn_image_forward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_forward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_forward_8: eval(prop(t_test)?concat(prop(turn_image_forward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_forward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_forward_8: eval(prop(t_test)?concat(prop(turn_image_forward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_forward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_forward_8: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_forward_8),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_forward_8));
    turn_image_forward_8: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_8),prop(turn_svg_merge_to_right_forward)):prop(turn_image_forward_8));
    turn_image_forward_8: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_8),prop(turn_svg_merge_to_left_forward)):prop(turn_image_forward_8));
    turn_image_forward_8: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_forward_8),prop(turn_svg_hook_right_forward)):prop(turn_image_forward_8));
    turn_image_forward_8: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_forward_8),prop(turn_svg_hook_left_forward)):prop(turn_image_forward_8));
    turn_image_forward_8: eval((prop(turn_image_forward_8)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_forward_8),"</g></svg>"));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("turn:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("turn:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("turn:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("turn:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}


/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Backward lanes (SVG)                                                                                                                            */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn:lanes:backward"],
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn:backward"],
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("turn:lanes"),tag("turn:lanes"),
                                cond(has_tag_key("turn"),tag("turn"),
                                cond(has_tag_key("turn:lanes:backward"),tag("turn:lanes:backward"),
                                     tag("turn:backward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    turn_image_backward_1: ""; t: eval(get(prop(temp_list),0)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_backward_1: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_backward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_backward_1: eval(prop(t_test)?concat(prop(turn_image_backward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_backward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_backward_1: eval(prop(t_test)?concat(prop(turn_image_backward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_backward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_backward_1: eval(prop(t_test)?concat(prop(turn_image_backward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_backward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_backward_1: eval(prop(t_test)?concat(prop(turn_image_backward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_backward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_backward_1: eval(prop(t_test)?concat(prop(turn_image_backward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_backward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_backward_1: eval(prop(t_test)?concat(prop(turn_image_backward_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_backward_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_backward_1: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_backward_1),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_backward_1));
    turn_image_backward_1: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_1),prop(turn_svg_merge_to_right_forward)):prop(turn_image_backward_1));
    turn_image_backward_1: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_1),prop(turn_svg_merge_to_left_forward)):prop(turn_image_backward_1));
    turn_image_backward_1: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_1),prop(turn_svg_hook_right_forward)):prop(turn_image_backward_1));
    turn_image_backward_1: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_1),prop(turn_svg_hook_left_forward)):prop(turn_image_backward_1));
    turn_image_backward_1: eval((prop(turn_image_backward_1)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25)'>",prop(turn_image_backward_1),"</g></svg>"));

    turn_image_backward_2: ""; t: eval(get(prop(temp_list),1)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_backward_2: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_backward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_backward_2: eval(prop(t_test)?concat(prop(turn_image_backward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_backward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_backward_2: eval(prop(t_test)?concat(prop(turn_image_backward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_backward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_backward_2: eval(prop(t_test)?concat(prop(turn_image_backward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_backward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_backward_2: eval(prop(t_test)?concat(prop(turn_image_backward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_backward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_backward_2: eval(prop(t_test)?concat(prop(turn_image_backward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_backward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_backward_2: eval(prop(t_test)?concat(prop(turn_image_backward_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_backward_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_backward_2: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_backward_2),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_backward_2));
    turn_image_backward_2: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_2),prop(turn_svg_merge_to_right_forward)):prop(turn_image_backward_2));
    turn_image_backward_2: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_2),prop(turn_svg_merge_to_left_forward)):prop(turn_image_backward_2));
    turn_image_backward_2: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_2),prop(turn_svg_hook_right_forward)):prop(turn_image_backward_2));
    turn_image_backward_2: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_2),prop(turn_svg_hook_left_forward)):prop(turn_image_backward_2));
    turn_image_backward_2: eval((prop(turn_image_backward_2)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25)'>",prop(turn_image_backward_2),"</g></svg>"));

    turn_image_backward_3: ""; t: eval(get(prop(temp_list),2)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_backward_3: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_backward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_backward_3: eval(prop(t_test)?concat(prop(turn_image_backward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_backward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_backward_3: eval(prop(t_test)?concat(prop(turn_image_backward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_backward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_backward_3: eval(prop(t_test)?concat(prop(turn_image_backward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_backward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_backward_3: eval(prop(t_test)?concat(prop(turn_image_backward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_backward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_backward_3: eval(prop(t_test)?concat(prop(turn_image_backward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_backward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_backward_3: eval(prop(t_test)?concat(prop(turn_image_backward_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_backward_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_backward_3: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_backward_3),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_backward_3));
    turn_image_backward_3: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_3),prop(turn_svg_merge_to_right_forward)):prop(turn_image_backward_3));
    turn_image_backward_3: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_3),prop(turn_svg_merge_to_left_forward)):prop(turn_image_backward_3));
    turn_image_backward_3: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_3),prop(turn_svg_hook_right_forward)):prop(turn_image_backward_3));
    turn_image_backward_3: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_3),prop(turn_svg_hook_left_forward)):prop(turn_image_backward_3));
    turn_image_backward_3: eval((prop(turn_image_backward_3)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25)'>",prop(turn_image_backward_3),"</g></svg>"));

    turn_image_backward_4: ""; t: eval(get(prop(temp_list),3)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_backward_4: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_backward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_backward_4: eval(prop(t_test)?concat(prop(turn_image_backward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_backward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_backward_4: eval(prop(t_test)?concat(prop(turn_image_backward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_backward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_backward_4: eval(prop(t_test)?concat(prop(turn_image_backward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_backward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_backward_4: eval(prop(t_test)?concat(prop(turn_image_backward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_backward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_backward_4: eval(prop(t_test)?concat(prop(turn_image_backward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_backward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_backward_4: eval(prop(t_test)?concat(prop(turn_image_backward_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_backward_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_backward_4: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_backward_4),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_backward_4));
    turn_image_backward_4: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_4),prop(turn_svg_merge_to_right_forward)):prop(turn_image_backward_4));
    turn_image_backward_4: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_4),prop(turn_svg_merge_to_left_forward)):prop(turn_image_backward_4));
    turn_image_backward_4: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_4),prop(turn_svg_hook_right_forward)):prop(turn_image_backward_4));
    turn_image_backward_4: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_4),prop(turn_svg_hook_left_forward)):prop(turn_image_backward_4));
    turn_image_backward_4: eval((prop(turn_image_backward_4)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25)'>",prop(turn_image_backward_4),"</g></svg>"));

    turn_image_backward_5: ""; t: eval(get(prop(temp_list),4)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_backward_5: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_backward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_backward_5: eval(prop(t_test)?concat(prop(turn_image_backward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_backward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_backward_5: eval(prop(t_test)?concat(prop(turn_image_backward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_backward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_backward_5: eval(prop(t_test)?concat(prop(turn_image_backward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_backward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_backward_5: eval(prop(t_test)?concat(prop(turn_image_backward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_backward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_backward_5: eval(prop(t_test)?concat(prop(turn_image_backward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_backward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_backward_5: eval(prop(t_test)?concat(prop(turn_image_backward_5),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_backward_5));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_backward_5: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_backward_5),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_backward_5));
    turn_image_backward_5: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_5),prop(turn_svg_merge_to_right_forward)):prop(turn_image_backward_5));
    turn_image_backward_5: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_5),prop(turn_svg_merge_to_left_forward)):prop(turn_image_backward_5));
    turn_image_backward_5: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_5),prop(turn_svg_hook_right_forward)):prop(turn_image_backward_5));
    turn_image_backward_5: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_5),prop(turn_svg_hook_left_forward)):prop(turn_image_backward_5));
    turn_image_backward_5: eval((prop(turn_image_backward_5)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25)'>",prop(turn_image_backward_5),"</g></svg>"));

    turn_image_backward_6: ""; t: eval(get(prop(temp_list),5)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_backward_6: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_backward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_backward_6: eval(prop(t_test)?concat(prop(turn_image_backward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_backward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_backward_6: eval(prop(t_test)?concat(prop(turn_image_backward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_backward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_backward_6: eval(prop(t_test)?concat(prop(turn_image_backward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_backward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_backward_6: eval(prop(t_test)?concat(prop(turn_image_backward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_backward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_backward_6: eval(prop(t_test)?concat(prop(turn_image_backward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_backward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_backward_6: eval(prop(t_test)?concat(prop(turn_image_backward_6),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_backward_6));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_backward_6: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_backward_6),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_backward_6));
    turn_image_backward_6: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_6),prop(turn_svg_merge_to_right_forward)):prop(turn_image_backward_6));
    turn_image_backward_6: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_6),prop(turn_svg_merge_to_left_forward)):prop(turn_image_backward_6));
    turn_image_backward_6: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_6),prop(turn_svg_hook_right_forward)):prop(turn_image_backward_6));
    turn_image_backward_6: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_6),prop(turn_svg_hook_left_forward)):prop(turn_image_backward_6));
    turn_image_backward_6: eval((prop(turn_image_backward_6)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25)'>",prop(turn_image_backward_6),"</g></svg>"));

    turn_image_backward_7: ""; t: eval(get(prop(temp_list),6)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_backward_7: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_backward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_backward_7: eval(prop(t_test)?concat(prop(turn_image_backward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_backward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_backward_7: eval(prop(t_test)?concat(prop(turn_image_backward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_backward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_backward_7: eval(prop(t_test)?concat(prop(turn_image_backward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_backward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_backward_7: eval(prop(t_test)?concat(prop(turn_image_backward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_backward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_backward_7: eval(prop(t_test)?concat(prop(turn_image_backward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_backward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_backward_7: eval(prop(t_test)?concat(prop(turn_image_backward_7),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_backward_7));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_backward_7: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_backward_7),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_backward_7));
    turn_image_backward_7: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_7),prop(turn_svg_merge_to_right_forward)):prop(turn_image_backward_7));
    turn_image_backward_7: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_7),prop(turn_svg_merge_to_left_forward)):prop(turn_image_backward_7));
    turn_image_backward_7: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_7),prop(turn_svg_hook_right_forward)):prop(turn_image_backward_7));
    turn_image_backward_7: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_7),prop(turn_svg_hook_left_forward)):prop(turn_image_backward_7));
    turn_image_backward_7: eval((prop(turn_image_backward_7)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25)'>",prop(turn_image_backward_7),"</g></svg>"));

    turn_image_backward_8: ""; t: eval(get(prop(temp_list),7)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_backward_8: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_backward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_backward_8: eval(prop(t_test)?concat(prop(turn_image_backward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_backward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_backward_8: eval(prop(t_test)?concat(prop(turn_image_backward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_backward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_backward_8: eval(prop(t_test)?concat(prop(turn_image_backward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_backward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_backward_8: eval(prop(t_test)?concat(prop(turn_image_backward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_backward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_backward_8: eval(prop(t_test)?concat(prop(turn_image_backward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_backward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_backward_8: eval(prop(t_test)?concat(prop(turn_image_backward_8),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_backward_8));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_backward_8: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_backward_8),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_backward_8));
    turn_image_backward_8: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_8),prop(turn_svg_merge_to_right_forward)):prop(turn_image_backward_8));
    turn_image_backward_8: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_8),prop(turn_svg_merge_to_left_forward)):prop(turn_image_backward_8));
    turn_image_backward_8: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_backward_8),prop(turn_svg_hook_right_forward)):prop(turn_image_backward_8));
    turn_image_backward_8: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_backward_8),prop(turn_svg_hook_left_forward)):prop(turn_image_backward_8));
    turn_image_backward_8: eval((prop(turn_image_backward_8)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='100px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25)'>",prop(turn_image_backward_8),"</g></svg>"));

    /* Lane count based on :lanes values */
    tag_lanes_bwd_min: eval(has_tag_key("turn:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("turn:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Both-way lanes (SVG)                                                                                                                            */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn:lanes:both_ways"],
way|z17-[is_prop_set(ok)][prop(style_use_svg_turn)]["turn:both_ways"]
{
    temp: eval(cond(has_tag_key("turn:lanes:both_ways"),tag("turn:lanes:both_ways"),tag("turn:both_ways")));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    turn_image_bothways_1: ""; t: eval(get(prop(temp_list),0)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_bothways_1: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_bothways_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_bothways_1: eval(prop(t_test)?concat(prop(turn_image_bothways_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_bothways_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_bothways_1: eval(prop(t_test)?concat(prop(turn_image_bothways_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_bothways_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_bothways_1: eval(prop(t_test)?concat(prop(turn_image_bothways_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_bothways_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_bothways_1: eval(prop(t_test)?concat(prop(turn_image_bothways_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_bothways_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_bothways_1: eval(prop(t_test)?concat(prop(turn_image_bothways_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_bothways_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_bothways_1: eval(prop(t_test)?concat(prop(turn_image_bothways_1),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_bothways_1));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_bothways_1: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_bothways_1),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_bothways_1));
    turn_image_bothways_1: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_bothways_1),prop(turn_svg_merge_to_right_forward)):prop(turn_image_bothways_1));
    turn_image_bothways_1: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_bothways_1),prop(turn_svg_merge_to_left_forward)):prop(turn_image_bothways_1));
    turn_image_bothways_1: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_bothways_1),prop(turn_svg_hook_right_forward)):prop(turn_image_bothways_1));
    turn_image_bothways_1: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_bothways_1),prop(turn_svg_hook_left_forward)):prop(turn_image_bothways_1));
    turn_image_bothways_1: eval((prop(turn_image_bothways_1)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='200px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_bothways_1),"</g><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25) translate(-100 0)'>",prop(turn_image_bothways_1),"</g></svg>"));

    turn_image_bothways_2: ""; t: eval(get(prop(temp_list),1)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_bothways_2: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_bothways_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_bothways_2: eval(prop(t_test)?concat(prop(turn_image_bothways_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_bothways_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_bothways_2: eval(prop(t_test)?concat(prop(turn_image_bothways_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_bothways_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_bothways_2: eval(prop(t_test)?concat(prop(turn_image_bothways_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_bothways_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_bothways_2: eval(prop(t_test)?concat(prop(turn_image_bothways_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_bothways_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_bothways_2: eval(prop(t_test)?concat(prop(turn_image_bothways_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_bothways_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_bothways_2: eval(prop(t_test)?concat(prop(turn_image_bothways_2),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_bothways_2));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_bothways_2: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_bothways_2),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_bothways_2));
    turn_image_bothways_2: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_bothways_2),prop(turn_svg_merge_to_right_forward)):prop(turn_image_bothways_2));
    turn_image_bothways_2: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_bothways_2),prop(turn_svg_merge_to_left_forward)):prop(turn_image_bothways_2));
    turn_image_bothways_2: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_bothways_2),prop(turn_svg_hook_right_forward)):prop(turn_image_bothways_2));
    turn_image_bothways_2: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_bothways_2),prop(turn_svg_hook_left_forward)):prop(turn_image_bothways_2));
    turn_image_bothways_2: eval((prop(turn_image_bothways_2)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='200px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_bothways_2),"</g><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25) translate(-100 0)'>",prop(turn_image_bothways_2),"</g></svg>"));

    turn_image_bothways_3: ""; t: eval(get(prop(temp_list),2)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_bothways_3: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_bothways_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_bothways_3: eval(prop(t_test)?concat(prop(turn_image_bothways_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_bothways_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_bothways_3: eval(prop(t_test)?concat(prop(turn_image_bothways_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_bothways_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_bothways_3: eval(prop(t_test)?concat(prop(turn_image_bothways_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_bothways_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_bothways_3: eval(prop(t_test)?concat(prop(turn_image_bothways_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_bothways_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_bothways_3: eval(prop(t_test)?concat(prop(turn_image_bothways_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_bothways_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_bothways_3: eval(prop(t_test)?concat(prop(turn_image_bothways_3),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_bothways_3));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_bothways_3: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_bothways_3),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_bothways_3));
    turn_image_bothways_3: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_bothways_3),prop(turn_svg_merge_to_right_forward)):prop(turn_image_bothways_3));
    turn_image_bothways_3: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_bothways_3),prop(turn_svg_merge_to_left_forward)):prop(turn_image_bothways_3));
    turn_image_bothways_3: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_bothways_3),prop(turn_svg_hook_right_forward)):prop(turn_image_bothways_3));
    turn_image_bothways_3: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_bothways_3),prop(turn_svg_hook_left_forward)):prop(turn_image_bothways_3));
    turn_image_bothways_3: eval((prop(turn_image_bothways_3)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='200px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_bothways_3),"</g><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25) translate(-100 0)'>",prop(turn_image_bothways_3),"</g></svg>"));

    turn_image_bothways_4: ""; t: eval(get(prop(temp_list),3)); t_scale: 1.0;
    t_test: eval(regexp_test("^(.*;)*through(;.*)*$",prop(t)));         turn_image_bothways_4: eval(prop(t_test)?prop(turn_svg_through_forward):                                                                                              prop(turn_image_bothways_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale_after_through: eval(prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*slight_right(;.*)*$",prop(t)));    turn_image_bothways_4: eval(prop(t_test)?concat(prop(turn_image_bothways_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_right_forward),"</g>"):prop(turn_image_bothways_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*right(;.*)*$",prop(t)));           turn_image_bothways_4: eval(prop(t_test)?concat(prop(turn_image_bothways_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_right_forward),"</g>"):       prop(turn_image_bothways_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_right(;.*)*$",prop(t)));     turn_image_bothways_4: eval(prop(t_test)?concat(prop(turn_image_bothways_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_right_forward),"</g>"): prop(turn_image_bothways_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_scale: eval(prop(t_scale_after_through));
    t_test: eval(regexp_test("^(.*;)*slight_left(;.*)*$",prop(t)));     turn_image_bothways_4: eval(prop(t_test)?concat(prop(turn_image_bothways_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_slight_left_forward),"</g>"): prop(turn_image_bothways_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*left(;.*)*$",prop(t)));            turn_image_bothways_4: eval(prop(t_test)?concat(prop(turn_image_bothways_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_left_forward),"</g>"):        prop(turn_image_bothways_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    t_test: eval(regexp_test("^(.*;)*sharp_left(;.*)*$",prop(t)));      turn_image_bothways_4: eval(prop(t_test)?concat(prop(turn_image_bothways_4),"<g transform='scale(",prop(t_scale)," 1.0)'>",prop(turn_svg_sharp_left_forward),"</g>"):  prop(turn_image_bothways_4));    t_scale: eval(prop(t_test)?(prop(t_scale)*0.666):prop(t_scale));
    turn_image_bothways_4: eval(regexp_test("^(.*;)*reverse(;.*)*$",prop(t))?concat(prop(turn_image_bothways_4),(prop(style_right_hand_traffic)?prop(turn_svg_reverse_right_hand_forward):prop(turn_svg_reverse_left_hand_forward))):prop(turn_image_bothways_4));
    turn_image_bothways_4: eval(regexp_test("^(.*;)*merge_to_right(;.*)*$",prop(t))?concat(prop(turn_image_bothways_4),prop(turn_svg_merge_to_right_forward)):prop(turn_image_bothways_4));
    turn_image_bothways_4: eval(regexp_test("^(.*;)*merge_to_left(;.*)*$",prop(t))?concat(prop(turn_image_bothways_4),prop(turn_svg_merge_to_left_forward)):prop(turn_image_bothways_4));
    turn_image_bothways_4: eval(regexp_test("^(.*;)*hook_right(;.*)*$",prop(t))?concat(prop(turn_image_bothways_4),prop(turn_svg_hook_right_forward)):prop(turn_image_bothways_4));
    turn_image_bothways_4: eval(regexp_test("^(.*;)*hook_left(;.*)*$",prop(t))?concat(prop(turn_image_bothways_4),prop(turn_svg_hook_left_forward)):prop(turn_image_bothways_4));
    turn_image_bothways_4: eval((prop(turn_image_bothways_4)="")?prop(unset_property):concat("data:image/svg+xml,<svg width='200px' height='50px'><g fill-opacity='",prop(style_markings_opacity),"'>",prop(turn_image_bothways_4),"</g><g fill-opacity='",prop(style_markings_opacity),"' transform='rotate(180 50 25) translate(-100 0)'>",prop(turn_image_bothways_4),"</g></svg>"));
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Lane access                                                                                                                                     */
/* The property restriction_color_xxx will be overwritten by later rules                                                                           */
/* TODO: both_ways is not implemented                                                                                                              */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Access=no forward lanes                                                                                                                         */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["access:lanes:forward"],
way|z17-[is_prop_set(ok)]["access:forward"],
way|z17-[is_prop_set(ok)]["access:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)]["access"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("access:lanes"),tag("access:lanes"),
                                cond(has_tag_key("access"),tag("access"),
                                cond(has_tag_key("access:lanes:forward"),tag("access:lanes:forward"),
                                     tag("access:forward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    restriction_color_forward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="no") || (get(prop(temp_list),0)="private")))?prop(style_noaccess_color):prop(restriction_color_forward_1));
    restriction_color_forward_2: eval(((prop(temp_length)>0) && ((get(prop(temp_list),1)="no") || (get(prop(temp_list),1)="private")))?prop(style_noaccess_color):prop(restriction_color_forward_2));
    restriction_color_forward_3: eval(((prop(temp_length)>0) && ((get(prop(temp_list),2)="no") || (get(prop(temp_list),2)="private")))?prop(style_noaccess_color):prop(restriction_color_forward_3));
    restriction_color_forward_4: eval(((prop(temp_length)>0) && ((get(prop(temp_list),3)="no") || (get(prop(temp_list),3)="private")))?prop(style_noaccess_color):prop(restriction_color_forward_4));
    restriction_color_forward_5: eval(((prop(temp_length)>0) && ((get(prop(temp_list),4)="no") || (get(prop(temp_list),4)="private")))?prop(style_noaccess_color):prop(restriction_color_forward_5));
    restriction_color_forward_6: eval(((prop(temp_length)>0) && ((get(prop(temp_list),5)="no") || (get(prop(temp_list),5)="private")))?prop(style_noaccess_color):prop(restriction_color_forward_6));
    restriction_color_forward_7: eval(((prop(temp_length)>0) && ((get(prop(temp_list),6)="no") || (get(prop(temp_list),6)="private")))?prop(style_noaccess_color):prop(restriction_color_forward_7));
    restriction_color_forward_8: eval(((prop(temp_length)>0) && ((get(prop(temp_list),7)="no") || (get(prop(temp_list),7)="private")))?prop(style_noaccess_color):prop(restriction_color_forward_8));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("access:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("access:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("access:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("access:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Access=no backward lanes                                                                                                                        */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["access:lanes:backward"],
way|z17-[is_prop_set(ok)]["access:backward"],
way|z17-[is_prop_set(ok)]["access:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)]["access"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("access:lanes"),tag("access:lanes"),
                                cond(has_tag_key("access"),tag("access"),
                                cond(has_tag_key("access:lanes:backward"),tag("access:lanes:backward"),
                                     tag("access:backward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    restriction_color_backward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="no") || (get(prop(temp_list),0)="private")))?prop(style_noaccess_color):prop(restriction_color_backward_1));
    restriction_color_backward_2: eval(((prop(temp_length)>0) && ((get(prop(temp_list),1)="no") || (get(prop(temp_list),1)="private")))?prop(style_noaccess_color):prop(restriction_color_backward_2));
    restriction_color_backward_3: eval(((prop(temp_length)>0) && ((get(prop(temp_list),2)="no") || (get(prop(temp_list),2)="private")))?prop(style_noaccess_color):prop(restriction_color_backward_3));
    restriction_color_backward_4: eval(((prop(temp_length)>0) && ((get(prop(temp_list),3)="no") || (get(prop(temp_list),3)="private")))?prop(style_noaccess_color):prop(restriction_color_backward_4));
    restriction_color_backward_5: eval(((prop(temp_length)>0) && ((get(prop(temp_list),4)="no") || (get(prop(temp_list),4)="private")))?prop(style_noaccess_color):prop(restriction_color_backward_5));
    restriction_color_backward_6: eval(((prop(temp_length)>0) && ((get(prop(temp_list),5)="no") || (get(prop(temp_list),5)="private")))?prop(style_noaccess_color):prop(restriction_color_backward_6));
    restriction_color_backward_7: eval(((prop(temp_length)>0) && ((get(prop(temp_list),6)="no") || (get(prop(temp_list),6)="private")))?prop(style_noaccess_color):prop(restriction_color_backward_7));
    restriction_color_backward_8: eval(((prop(temp_length)>0) && ((get(prop(temp_list),7)="no") || (get(prop(temp_list),7)="private")))?prop(style_noaccess_color):prop(restriction_color_backward_8));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("access:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("access:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_bwd_min: eval(has_tag_key("access:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("access:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Lane designation                                                                                                                                */
/* TODO: both_ways is not implemented                                                                                                              */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Bus forward lanes                                                                                                                               */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["bus:lanes:forward"],
way|z17-[is_prop_set(ok)]["bus:forward"],
way|z17-[is_prop_set(ok)]["bus:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)]["bus"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("bus:lanes"),tag("bus:lanes"),
                                cond(has_tag_key("bus"),tag("bus"),
                                cond(has_tag_key("bus:lanes:forward"),tag("bus:lanes:forward"),
                                     tag("bus:forward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    tempa: eval(cond(has_tag_key("access:lanes"),tag("access:lanes"),
                                cond(has_tag_key("access"),tag("access"),
                                cond(has_tag_key("access:lanes:forward"),tag("access:lanes:forward"),
                                     tag("access:forward")
                                    ))));
    tempa_list: eval(split("|",prop(tempa)));
    tempa_length: eval(length(prop(tempa_list)));

    sign_forward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="designated") || ((get(prop(temp_list),0)="yes") && (get(prop(tempa_list),0)="no"))))?concat(prop(sign_forward_1),";images/bus forward.png"):prop(sign_forward_1));
    sign_forward_2: eval(((prop(temp_length)>1) && ((get(prop(temp_list),1)="designated") || ((get(prop(temp_list),1)="yes") && (get(prop(tempa_list),1)="no"))))?concat(prop(sign_forward_2),";images/bus forward.png"):prop(sign_forward_2));
    sign_forward_3: eval(((prop(temp_length)>2) && ((get(prop(temp_list),2)="designated") || ((get(prop(temp_list),2)="yes") && (get(prop(tempa_list),2)="no"))))?concat(prop(sign_forward_3),";images/bus forward.png"):prop(sign_forward_3));
    sign_forward_4: eval(((prop(temp_length)>3) && ((get(prop(temp_list),3)="designated") || ((get(prop(temp_list),3)="yes") && (get(prop(tempa_list),3)="no"))))?concat(prop(sign_forward_4),";images/bus forward.png"):prop(sign_forward_4));
    sign_forward_5: eval(((prop(temp_length)>4) && ((get(prop(temp_list),4)="designated") || ((get(prop(temp_list),4)="yes") && (get(prop(tempa_list),4)="no"))))?concat(prop(sign_forward_5),";images/bus forward.png"):prop(sign_forward_5));
    sign_forward_6: eval(((prop(temp_length)>5) && ((get(prop(temp_list),5)="designated") || ((get(prop(temp_list),5)="yes") && (get(prop(tempa_list),5)="no"))))?concat(prop(sign_forward_6),";images/bus forward.png"):prop(sign_forward_6));
    sign_forward_7: eval(((prop(temp_length)>6) && ((get(prop(temp_list),6)="designated") || ((get(prop(temp_list),6)="yes") && (get(prop(tempa_list),6)="no"))))?concat(prop(sign_forward_7),";images/bus forward.png"):prop(sign_forward_7));
    sign_forward_8: eval(((prop(temp_length)>7) && ((get(prop(temp_list),7)="designated") || ((get(prop(temp_list),7)="yes") && (get(prop(tempa_list),7)="no"))))?concat(prop(sign_forward_8),";images/bus forward.png"):prop(sign_forward_8));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("bus:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("bus:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("bus:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("bus:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Bus backward lanes                                                                                                                              */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["bus:lanes:backward"],
way|z17-[is_prop_set(ok)]["bus:backward"],
way|z17-[is_prop_set(ok)]["bus:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)]["bus"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("bus:lanes"),tag("bus:lanes"),
                                cond(has_tag_key("bus"),tag("bus"),
                                cond(has_tag_key("bus:lanes:backward"),tag("bus:lanes:backward"),
                                     tag("bus:backward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    /* TODO: oneway=-1*/
    tempa: eval(cond(has_tag_key("access:lanes:backward"),tag("access:lanes:backward"),tag("access:backward")));
    tempa_list: eval(split("|",prop(tempa)));
    tempa_length: eval(length(prop(tempa_list)));

    sign_backward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="designated") || ((get(prop(temp_list),0)="yes") && (get(prop(tempa_list),0)="no"))))?concat(prop(sign_backward_1),";images/bus backward.png"):prop(sign_backward_1));
    sign_backward_2: eval(((prop(temp_length)>1) && ((get(prop(temp_list),1)="designated") || ((get(prop(temp_list),1)="yes") && (get(prop(tempa_list),1)="no"))))?concat(prop(sign_backward_2),";images/bus backward.png"):prop(sign_backward_2));
    sign_backward_3: eval(((prop(temp_length)>2) && ((get(prop(temp_list),2)="designated") || ((get(prop(temp_list),2)="yes") && (get(prop(tempa_list),2)="no"))))?concat(prop(sign_backward_3),";images/bus backward.png"):prop(sign_backward_3));
    sign_backward_4: eval(((prop(temp_length)>3) && ((get(prop(temp_list),3)="designated") || ((get(prop(temp_list),3)="yes") && (get(prop(tempa_list),3)="no"))))?concat(prop(sign_backward_4),";images/bus backward.png"):prop(sign_backward_4));
    sign_backward_5: eval(((prop(temp_length)>4) && ((get(prop(temp_list),4)="designated") || ((get(prop(temp_list),4)="yes") && (get(prop(tempa_list),4)="no"))))?concat(prop(sign_backward_5),";images/bus backward.png"):prop(sign_backward_5));
    sign_backward_6: eval(((prop(temp_length)>5) && ((get(prop(temp_list),5)="designated") || ((get(prop(temp_list),5)="yes") && (get(prop(tempa_list),5)="no"))))?concat(prop(sign_backward_6),";images/bus backward.png"):prop(sign_backward_6));
    sign_backward_7: eval(((prop(temp_length)>6) && ((get(prop(temp_list),6)="designated") || ((get(prop(temp_list),6)="yes") && (get(prop(tempa_list),6)="no"))))?concat(prop(sign_backward_7),";images/bus backward.png"):prop(sign_backward_7));
    sign_backward_8: eval(((prop(temp_length)>7) && ((get(prop(temp_list),7)="designated") || ((get(prop(temp_list),7)="yes") && (get(prop(tempa_list),7)="no"))))?concat(prop(sign_backward_8),";images/bus backward.png"):prop(sign_backward_8));

    /* Lane count based on :lanes values */
    tag_lanes_bwd_min: eval(has_tag_key("bus:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("bus:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Taxi forward lanes                                                                                                                               */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["taxi:lanes:forward"],
way|z17-[is_prop_set(ok)]["taxi:forward"],
way|z17-[is_prop_set(ok)]["taxi:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)]["taxi"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("taxi:lanes"),tag("taxi:lanes"),
                                cond(has_tag_key("taxi"),tag("taxi"),
                                cond(has_tag_key("taxi:lanes:forward"),tag("taxi:lanes:forward"),
                                     tag("taxi:forward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    tempa: eval(cond(has_tag_key("access:lanes"),tag("access:lanes"),
                                cond(has_tag_key("access"),tag("access"),
                                cond(has_tag_key("access:lanes:forward"),tag("access:lanes:forward"),
                                     tag("access:forward")
                                    ))));
    tempa_list: eval(split("|",prop(tempa)));
    tempa_length: eval(length(prop(tempa_list)));

    sign_forward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="designated") || ((get(prop(temp_list),0)="yes") && (get(prop(tempa_list),0)="no"))))?concat(prop(sign_forward_1),";images/taxi forward.png"):prop(sign_forward_1));
    sign_forward_2: eval(((prop(temp_length)>1) && ((get(prop(temp_list),1)="designated") || ((get(prop(temp_list),1)="yes") && (get(prop(tempa_list),1)="no"))))?concat(prop(sign_forward_2),";images/taxi forward.png"):prop(sign_forward_2));
    sign_forward_3: eval(((prop(temp_length)>2) && ((get(prop(temp_list),2)="designated") || ((get(prop(temp_list),2)="yes") && (get(prop(tempa_list),2)="no"))))?concat(prop(sign_forward_3),";images/taxi forward.png"):prop(sign_forward_3));
    sign_forward_4: eval(((prop(temp_length)>3) && ((get(prop(temp_list),3)="designated") || ((get(prop(temp_list),3)="yes") && (get(prop(tempa_list),3)="no"))))?concat(prop(sign_forward_4),";images/taxi forward.png"):prop(sign_forward_4));
    sign_forward_5: eval(((prop(temp_length)>4) && ((get(prop(temp_list),4)="designated") || ((get(prop(temp_list),4)="yes") && (get(prop(tempa_list),4)="no"))))?concat(prop(sign_forward_5),";images/taxi forward.png"):prop(sign_forward_5));
    sign_forward_6: eval(((prop(temp_length)>5) && ((get(prop(temp_list),5)="designated") || ((get(prop(temp_list),5)="yes") && (get(prop(tempa_list),5)="no"))))?concat(prop(sign_forward_6),";images/taxi forward.png"):prop(sign_forward_6));
    sign_forward_7: eval(((prop(temp_length)>6) && ((get(prop(temp_list),6)="designated") || ((get(prop(temp_list),6)="yes") && (get(prop(tempa_list),6)="no"))))?concat(prop(sign_forward_7),";images/taxi forward.png"):prop(sign_forward_7));
    sign_forward_8: eval(((prop(temp_length)>7) && ((get(prop(temp_list),7)="designated") || ((get(prop(temp_list),7)="yes") && (get(prop(tempa_list),7)="no"))))?concat(prop(sign_forward_8),";images/taxi forward.png"):prop(sign_forward_8));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("taxi:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("taxi:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("taxi:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("taxi:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Taxi backward lanes                                                                                                                              */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["taxi:lanes:backward"],
way|z17-[is_prop_set(ok)]["taxi:backward"],
way|z17-[is_prop_set(ok)]["taxi:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)]["taxi"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("taxi:lanes"),tag("taxi:lanes"),
                                cond(has_tag_key("taxi"),tag("taxi"),
                                cond(has_tag_key("taxi:lanes:backward"),tag("taxi:lanes:backward"),
                                     tag("taxi:backward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    /* TODO: oneway=-1*/
    tempa: eval(cond(has_tag_key("access:lanes:backward"),tag("access:lanes:backward"),tag("access:backward")));
    tempa_list: eval(split("|",prop(tempa)));
    tempa_length: eval(length(prop(tempa_list)));

    sign_backward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="designated") || ((get(prop(temp_list),0)="yes") && (get(prop(tempa_list),0)="no"))))?concat(prop(sign_backward_1),";images/taxi backward.png"):prop(sign_backward_1));
    sign_backward_2: eval(((prop(temp_length)>1) && ((get(prop(temp_list),1)="designated") || ((get(prop(temp_list),1)="yes") && (get(prop(tempa_list),1)="no"))))?concat(prop(sign_backward_2),";images/taxi backward.png"):prop(sign_backward_2));
    sign_backward_3: eval(((prop(temp_length)>2) && ((get(prop(temp_list),2)="designated") || ((get(prop(temp_list),2)="yes") && (get(prop(tempa_list),2)="no"))))?concat(prop(sign_backward_3),";images/taxi backward.png"):prop(sign_backward_3));
    sign_backward_4: eval(((prop(temp_length)>3) && ((get(prop(temp_list),3)="designated") || ((get(prop(temp_list),3)="yes") && (get(prop(tempa_list),3)="no"))))?concat(prop(sign_backward_4),";images/taxi backward.png"):prop(sign_backward_4));
    sign_backward_5: eval(((prop(temp_length)>4) && ((get(prop(temp_list),4)="designated") || ((get(prop(temp_list),4)="yes") && (get(prop(tempa_list),4)="no"))))?concat(prop(sign_backward_5),";images/taxi backward.png"):prop(sign_backward_5));
    sign_backward_6: eval(((prop(temp_length)>5) && ((get(prop(temp_list),5)="designated") || ((get(prop(temp_list),5)="yes") && (get(prop(tempa_list),5)="no"))))?concat(prop(sign_backward_6),";images/taxi backward.png"):prop(sign_backward_6));
    sign_backward_7: eval(((prop(temp_length)>6) && ((get(prop(temp_list),6)="designated") || ((get(prop(temp_list),6)="yes") && (get(prop(tempa_list),6)="no"))))?concat(prop(sign_backward_7),";images/taxi backward.png"):prop(sign_backward_7));
    sign_backward_8: eval(((prop(temp_length)>7) && ((get(prop(temp_list),7)="designated") || ((get(prop(temp_list),7)="yes") && (get(prop(tempa_list),7)="no"))))?concat(prop(sign_backward_8),";images/taxi backward.png"):prop(sign_backward_8));

    /* Lane count based on :lanes values */
    tag_lanes_bwd_min: eval(has_tag_key("taxi:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("taxi:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* PSV forward lanes                                                                                                                               */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["psv:lanes:forward"],
way|z17-[is_prop_set(ok)]["psv:forward"],
way|z17-[is_prop_set(ok)]["psv:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)]["psv"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("psv:lanes"),tag("psv:lanes"),
                                cond(has_tag_key("psv"),tag("psv"),
                                cond(has_tag_key("psv:lanes:forward"),tag("psv:lanes:forward"),
                                     tag("psv:forward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    tempa: eval(cond(has_tag_key("access:lanes"),tag("access:lanes"),
                                cond(has_tag_key("access"),tag("access"),
                                cond(has_tag_key("access:lanes:forward"),tag("access:lanes:forward"),
                                     tag("access:forward")
                                    ))));
    tempa_list: eval(split("|",prop(tempa)));
    tempa_length: eval(length(prop(tempa_list)));

    sign_forward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="designated") || ((get(prop(temp_list),0)="yes") && (get(prop(tempa_list),0)="no"))))?concat(prop(sign_forward_1),";images/psv forward.png"):prop(sign_forward_1));
    sign_forward_2: eval(((prop(temp_length)>1) && ((get(prop(temp_list),1)="designated") || ((get(prop(temp_list),1)="yes") && (get(prop(tempa_list),1)="no"))))?concat(prop(sign_forward_2),";images/psv forward.png"):prop(sign_forward_2));
    sign_forward_3: eval(((prop(temp_length)>2) && ((get(prop(temp_list),2)="designated") || ((get(prop(temp_list),2)="yes") && (get(prop(tempa_list),2)="no"))))?concat(prop(sign_forward_3),";images/psv forward.png"):prop(sign_forward_3));
    sign_forward_4: eval(((prop(temp_length)>3) && ((get(prop(temp_list),3)="designated") || ((get(prop(temp_list),3)="yes") && (get(prop(tempa_list),3)="no"))))?concat(prop(sign_forward_4),";images/psv forward.png"):prop(sign_forward_4));
    sign_forward_5: eval(((prop(temp_length)>4) && ((get(prop(temp_list),4)="designated") || ((get(prop(temp_list),4)="yes") && (get(prop(tempa_list),4)="no"))))?concat(prop(sign_forward_5),";images/psv forward.png"):prop(sign_forward_5));
    sign_forward_6: eval(((prop(temp_length)>5) && ((get(prop(temp_list),5)="designated") || ((get(prop(temp_list),5)="yes") && (get(prop(tempa_list),5)="no"))))?concat(prop(sign_forward_6),";images/psv forward.png"):prop(sign_forward_6));
    sign_forward_7: eval(((prop(temp_length)>6) && ((get(prop(temp_list),6)="designated") || ((get(prop(temp_list),6)="yes") && (get(prop(tempa_list),6)="no"))))?concat(prop(sign_forward_7),";images/psv forward.png"):prop(sign_forward_7));
    sign_forward_8: eval(((prop(temp_length)>7) && ((get(prop(temp_list),7)="designated") || ((get(prop(temp_list),7)="yes") && (get(prop(tempa_list),7)="no"))))?concat(prop(sign_forward_8),";images/psv forward.png"):prop(sign_forward_8));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("psv:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("psv:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("psv:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("psv:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* PSV backward lanes                                                                                                                              */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["psv:lanes:backward"],
way|z17-[is_prop_set(ok)]["psv:backward"],
way|z17-[is_prop_set(ok)]["psv:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)]["psv"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("psv:lanes"),tag("psv:lanes"),
                                cond(has_tag_key("psv"),tag("psv"),
                                cond(has_tag_key("psv:lanes:backward"),tag("psv:lanes:backward"),
                                     tag("psv:backward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    /* TODO: oneway=-1*/
    tempa: eval(cond(has_tag_key("access:lanes:backward"),tag("access:lanes:backward"),tag("access:backward")));
    tempa_list: eval(split("|",prop(tempa)));
    tempa_length: eval(length(prop(tempa_list)));

    sign_backward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="designated") || ((get(prop(temp_list),0)="yes") && (get(prop(tempa_list),0)="no"))))?concat(prop(sign_backward_1),";images/psv backward.png"):prop(sign_backward_1));
    sign_backward_2: eval(((prop(temp_length)>1) && ((get(prop(temp_list),1)="designated") || ((get(prop(temp_list),1)="yes") && (get(prop(tempa_list),1)="no"))))?concat(prop(sign_backward_2),";images/psv backward.png"):prop(sign_backward_2));
    sign_backward_3: eval(((prop(temp_length)>2) && ((get(prop(temp_list),2)="designated") || ((get(prop(temp_list),2)="yes") && (get(prop(tempa_list),2)="no"))))?concat(prop(sign_backward_3),";images/psv backward.png"):prop(sign_backward_3));
    sign_backward_4: eval(((prop(temp_length)>3) && ((get(prop(temp_list),3)="designated") || ((get(prop(temp_list),3)="yes") && (get(prop(tempa_list),3)="no"))))?concat(prop(sign_backward_4),";images/psv backward.png"):prop(sign_backward_4));
    sign_backward_5: eval(((prop(temp_length)>4) && ((get(prop(temp_list),4)="designated") || ((get(prop(temp_list),4)="yes") && (get(prop(tempa_list),4)="no"))))?concat(prop(sign_backward_5),";images/psv backward.png"):prop(sign_backward_5));
    sign_backward_6: eval(((prop(temp_length)>5) && ((get(prop(temp_list),5)="designated") || ((get(prop(temp_list),5)="yes") && (get(prop(tempa_list),5)="no"))))?concat(prop(sign_backward_6),";images/psv backward.png"):prop(sign_backward_6));
    sign_backward_7: eval(((prop(temp_length)>6) && ((get(prop(temp_list),6)="designated") || ((get(prop(temp_list),6)="yes") && (get(prop(tempa_list),6)="no"))))?concat(prop(sign_backward_7),";images/psv backward.png"):prop(sign_backward_7));
    sign_backward_8: eval(((prop(temp_length)>7) && ((get(prop(temp_list),7)="designated") || ((get(prop(temp_list),7)="yes") && (get(prop(tempa_list),7)="no"))))?concat(prop(sign_backward_8),";images/psv backward.png"):prop(sign_backward_8));

    /* Lane count based on :lanes values */
    tag_lanes_bwd_min: eval(has_tag_key("psv:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("psv:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Bicycle forward lanes                                                                                                                           */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["bicycle:lanes:forward"],
way|z17-[is_prop_set(ok)]["bicycle:forward"],
way|z17-[is_prop_set(ok)]["bicycle:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)]["bicycle"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("bicycle:lanes"),tag("bicycle:lanes"),
                                cond(has_tag_key("bicycle"),tag("bicycle"),
                                cond(has_tag_key("bicycle:lanes:forward"),tag("bicycle:lanes:forward"),
                                     tag("bicycle:forward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    tempa: eval(cond(has_tag_key("access:lanes"),tag("access:lanes"),
                                cond(has_tag_key("access"),tag("access"),
                                cond(has_tag_key("access:lanes:forward"),tag("access:lanes:forward"),
                                     tag("access:forward")
                                    ))));
    tempa_list: eval(split("|",prop(tempa)));
    tempa_length: eval(length(prop(tempa_list)));

    sign_forward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="designated") || ((get(prop(temp_list),0)="yes") && (get(prop(tempa_list),0)="no"))))?concat(prop(sign_forward_1),";images/bicycle forward.png"):prop(sign_forward_1));
    sign_forward_2: eval(((prop(temp_length)>1) && ((get(prop(temp_list),1)="designated") || ((get(prop(temp_list),1)="yes") && (get(prop(tempa_list),1)="no"))))?concat(prop(sign_forward_2),";images/bicycle forward.png"):prop(sign_forward_2));
    sign_forward_3: eval(((prop(temp_length)>2) && ((get(prop(temp_list),2)="designated") || ((get(prop(temp_list),2)="yes") && (get(prop(tempa_list),2)="no"))))?concat(prop(sign_forward_3),";images/bicycle forward.png"):prop(sign_forward_3));
    sign_forward_4: eval(((prop(temp_length)>3) && ((get(prop(temp_list),3)="designated") || ((get(prop(temp_list),3)="yes") && (get(prop(tempa_list),3)="no"))))?concat(prop(sign_forward_4),";images/bicycle forward.png"):prop(sign_forward_4));
    sign_forward_5: eval(((prop(temp_length)>4) && ((get(prop(temp_list),4)="designated") || ((get(prop(temp_list),4)="yes") && (get(prop(tempa_list),4)="no"))))?concat(prop(sign_forward_5),";images/bicycle forward.png"):prop(sign_forward_5));
    sign_forward_6: eval(((prop(temp_length)>5) && ((get(prop(temp_list),5)="designated") || ((get(prop(temp_list),5)="yes") && (get(prop(tempa_list),5)="no"))))?concat(prop(sign_forward_6),";images/bicycle forward.png"):prop(sign_forward_6));
    sign_forward_7: eval(((prop(temp_length)>6) && ((get(prop(temp_list),6)="designated") || ((get(prop(temp_list),6)="yes") && (get(prop(tempa_list),6)="no"))))?concat(prop(sign_forward_7),";images/bicycle forward.png"):prop(sign_forward_7));
    sign_forward_8: eval(((prop(temp_length)>7) && ((get(prop(temp_list),7)="designated") || ((get(prop(temp_list),7)="yes") && (get(prop(tempa_list),7)="no"))))?concat(prop(sign_forward_8),";images/bicycle forward.png"):prop(sign_forward_8));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("bicycle:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("bicycle:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("bicycle:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("bicycle:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Bicycle backward lanes                                                                                                                          */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["bicycle:lanes:backward"],
way|z17-[is_prop_set(ok)]["bicycle:backward"],
way|z17-[is_prop_set(ok)]["bicycle:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)]["bicycle"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("bicycle:lanes"),tag("bicycle:lanes"),
                                cond(has_tag_key("bicycle"),tag("bicycle"),
                                cond(has_tag_key("bicycle:lanes:backward"),tag("bicycle:lanes:backward"),
                                     tag("bicycle:backward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    /* TODO: oneway=-1*/
    tempa: eval(cond(has_tag_key("access:lanes:backward"),tag("access:lanes:backward"),tag("access:backward")));
    tempa_list: eval(split("|",prop(tempa)));
    tempa_length: eval(length(prop(tempa_list)));

    sign_backward_1: eval(((prop(temp_length)>0) && ((get(prop(temp_list),0)="designated") || ((get(prop(temp_list),0)="yes") && (get(prop(tempa_list),0)="no"))))?concat(prop(sign_backward_1),";images/bicycle backward.png"):prop(sign_backward_1));
    sign_backward_2: eval(((prop(temp_length)>1) && ((get(prop(temp_list),1)="designated") || ((get(prop(temp_list),1)="yes") && (get(prop(tempa_list),1)="no"))))?concat(prop(sign_backward_2),";images/bicycle backward.png"):prop(sign_backward_2));
    sign_backward_3: eval(((prop(temp_length)>2) && ((get(prop(temp_list),2)="designated") || ((get(prop(temp_list),2)="yes") && (get(prop(tempa_list),2)="no"))))?concat(prop(sign_backward_3),";images/bicycle backward.png"):prop(sign_backward_3));
    sign_backward_4: eval(((prop(temp_length)>3) && ((get(prop(temp_list),3)="designated") || ((get(prop(temp_list),3)="yes") && (get(prop(tempa_list),3)="no"))))?concat(prop(sign_backward_4),";images/bicycle backward.png"):prop(sign_backward_4));
    sign_backward_5: eval(((prop(temp_length)>4) && ((get(prop(temp_list),4)="designated") || ((get(prop(temp_list),4)="yes") && (get(prop(tempa_list),4)="no"))))?concat(prop(sign_backward_5),";images/bicycle backward.png"):prop(sign_backward_5));
    sign_backward_6: eval(((prop(temp_length)>5) && ((get(prop(temp_list),5)="designated") || ((get(prop(temp_list),5)="yes") && (get(prop(tempa_list),5)="no"))))?concat(prop(sign_backward_6),";images/bicycle backward.png"):prop(sign_backward_6));
    sign_backward_7: eval(((prop(temp_length)>6) && ((get(prop(temp_list),6)="designated") || ((get(prop(temp_list),6)="yes") && (get(prop(tempa_list),6)="no"))))?concat(prop(sign_backward_7),";images/bicycle backward.png"):prop(sign_backward_7));
    sign_backward_8: eval(((prop(temp_length)>7) && ((get(prop(temp_list),7)="designated") || ((get(prop(temp_list),7)="yes") && (get(prop(tempa_list),7)="no"))))?concat(prop(sign_backward_8),";images/bicycle backward.png"):prop(sign_backward_8));

    /* Lane count based on :lanes values */
    tag_lanes_bwd_min: eval(has_tag_key("bicycle:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("bicycle:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}


/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* HOV forward lanes                                                                                                                               */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["hov:lanes:forward"],
way|z17-[is_prop_set(ok)]["hov:forward"],
way|z17-[is_prop_set(ok)]["hov:lanes"][prop(oneway_type)=1],
way|z17-[is_prop_set(ok)]["hov"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("hov:lanes"),tag("hov:lanes"),
                                cond(has_tag_key("hov:lanes:forward"),tag("hov:lanes:forward"),
                                cond(has_tag_key("hov"),tag("hov"),
                                     tag("hov:forward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    hov_minimum: eval(has_tag_key("hov:minimum:forward")?tag("hov:minimum:forward"):(has_tag_key("hov:minimum")?tag("hov:minimum"):0));
    hov_image: eval((prop(hov_minimum)=2)?";images/hov2 forward.png":((prop(hov_minimum)=3)?";images/hov3 forward.png":";images/hov forward.png"));

    t:              eval(get(prop(temp_list),0));
    sign_forward_1: eval(((prop(temp_length)>0) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_forward_1),prop(hov_image)):prop(sign_forward_1));
    t:              eval(get(prop(temp_list),1));
    sign_forward_2: eval(((prop(temp_length)>1) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_forward_2),prop(hov_image)):prop(sign_forward_2));
    t:              eval(get(prop(temp_list),2));
    sign_forward_3: eval(((prop(temp_length)>2) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_forward_3),prop(hov_image)):prop(sign_forward_3));
    t:              eval(get(prop(temp_list),3));
    sign_forward_4: eval(((prop(temp_length)>3) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_forward_4),prop(hov_image)):prop(sign_forward_4));
    t:              eval(get(prop(temp_list),4));
    sign_forward_5: eval(((prop(temp_length)>4) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_forward_5),prop(hov_image)):prop(sign_forward_5));
    t:              eval(get(prop(temp_list),5));
    sign_forward_6: eval(((prop(temp_length)>5) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_forward_6),prop(hov_image)):prop(sign_forward_6));
    t:              eval(get(prop(temp_list),6));
    sign_forward_7: eval(((prop(temp_length)>6) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_forward_7),prop(hov_image)):prop(sign_forward_7));
    t:              eval(get(prop(temp_list),7));
    sign_forward_8: eval(((prop(temp_length)>7) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_forward_8),prop(hov_image)):prop(sign_forward_8));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("hov:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("hov:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_fwd_min: eval(has_tag_key("hov:lanes:forward")?min(prop(tag_lanes_fwd_min),prop(temp_length)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval(has_tag_key("hov:lanes:forward")?max(prop(tag_lanes_fwd_max),prop(temp_length)):prop(tag_lanes_fwd_max));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* HOV backward lanes                                                                                                                               */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["hov:lanes:backward"],
way|z17-[is_prop_set(ok)]["hov:backward"],
way|z17-[is_prop_set(ok)]["hov:lanes"][prop(oneway_type)=(-1)],
way|z17-[is_prop_set(ok)]["hov"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("hov:lanes"),tag("hov:lanes"),
                                cond(has_tag_key("hov"),tag("hov"),
                                cond(has_tag_key("hov:lanes:backward"),tag("hov:lanes:backward"),
                                     tag("hov:backward")
                                    ))));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));
    hov_minimum: eval(has_tag_key("hov:minimum:backward")?tag("hov:minimum:backward"):(has_tag_key("hov:minimum")?tag("hov:minimum"):0));
    hov_image: eval((prop(hov_minimum)=2)?";images/hov2 backward.png":((prop(hov_minimum)=3)?";images/hov3 backward.png":";images/hov backward.png"));

    t:              eval(get(prop(temp_list),0));
    sign_backward_1: eval(((prop(temp_length)>0) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_backward_1),prop(hov_image)):prop(sign_backward_1));
    t:              eval(get(prop(temp_list),1));
    sign_backward_2: eval(((prop(temp_length)>1) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_backward_2),prop(hov_image)):prop(sign_backward_2));
    t:              eval(get(prop(temp_list),2));
    sign_backward_3: eval(((prop(temp_length)>2) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_backward_3),prop(hov_image)):prop(sign_backward_3));
    t:              eval(get(prop(temp_list),3));
    sign_backward_4: eval(((prop(temp_length)>3) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_backward_4),prop(hov_image)):prop(sign_backward_4));
    t:              eval(get(prop(temp_list),4));
    sign_backward_5: eval(((prop(temp_length)>4) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_backward_5),prop(hov_image)):prop(sign_backward_5));
    t:              eval(get(prop(temp_list),5));
    sign_backward_6: eval(((prop(temp_length)>5) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_backward_6),prop(hov_image)):prop(sign_backward_6));
    t:              eval(get(prop(temp_list),6));
    sign_backward_7: eval(((prop(temp_length)>6) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_backward_7),prop(hov_image)):prop(sign_backward_7));
    t:              eval(get(prop(temp_list),7));
    sign_backward_8: eval(((prop(temp_length)>7) && ((prop(t)="designated") || (prop(t)="lane")))?concat(prop(sign_backward_8),prop(hov_image)):prop(sign_backward_8));

    /* Lane count based on :lanes values */
    tag_lanes_all_min: eval(has_tag_key("hov:lanes")?min(prop(tag_lanes_all_min),prop(temp_length)):prop(tag_lanes_all_min));
    tag_lanes_all_max: eval(has_tag_key("hov:lanes")?max(prop(tag_lanes_all_max),prop(temp_length)):prop(tag_lanes_all_max));
    tag_lanes_bwd_min: eval(has_tag_key("hov:lanes:backward")?min(prop(tag_lanes_bwd_min),prop(temp_length)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval(has_tag_key("hov:lanes:backward")?max(prop(tag_lanes_bwd_max),prop(temp_length)):prop(tag_lanes_bwd_max));
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Check of the number of lane-dependent width                                                                                                     */
/* The calculation itself depends on the lane count and therefore is done AFTER the determination of the lane count                                */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way|z17-["width:lanes:forward"],
way|z17-["width:lanes"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("width:lanes:forward"),tag("width:lanes:forward"),tag("width:lanes")));
    temp_length: eval(length(split("|",prop(temp))));

    /* Lane count based on :lanes values */
    tag_lanes_fwd_min: eval(min(prop(tag_lanes_fwd_min),prop(temp_length)));
    tag_lanes_fwd_max: eval(max(prop(tag_lanes_fwd_max),prop(temp_length)));
}
way|z17-["width:lanes:backward"],
way|z17-["width:lanes"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("width:lanes:backward"),tag("width:lanes:backward"),tag("width:lanes")));
    temp_length: eval(length(split("|",prop(temp))));

    /* Lane count based on :lanes values */
    tag_lanes_bwd_min: eval(min(prop(tag_lanes_bwd_min),prop(temp_length)));
    tag_lanes_bwd_max: eval(max(prop(tag_lanes_bwd_max),prop(temp_length)));
}
way|z17-["width:lanes:both_ways"]
{
    temp: eval(tag("width:lanes:both_ways"));
    temp_length: eval(length(split("|",prop(temp))));

    /* Lane count based on :lanes values */
    tag_lanes_both_min: eval(min(prop(tag_lanes_both_min),prop(temp_length)));
    tag_lanes_both_max: eval(max(prop(tag_lanes_both_max),prop(temp_length)));
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Retrieve the lane count from the lanes key, its subkeys and the :lanes-tags                                                                     */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way[is_prop_set(ok)][lanes]             { lanes_all:  tag(lanes);}
way[is_prop_set(ok)]["lanes:forward"]   { lanes_fwd:  tag("lanes:forward");}
way[is_prop_set(ok)]["lanes:backward"]  { lanes_bwd:  tag("lanes:backward");}
way[is_prop_set(ok)]["lanes:both_ways"] { lanes_both: tag("lanes:both_ways");}

/* Nothing specified */
way[is_prop_set(ok)][prop(oneway_type)=0][!lanes][!"lanes:backward"][!"lanes:both_ways"][!"lanes:forward"]
        { lanes_all: 2; lanes_fwd: 1; lanes_bwd: 1; lanes_both: 0; }
way[is_prop_set(ok)][prop(oneway_type)=1][!lanes][!"lanes:backward"][!"lanes:both_ways"][!"lanes:forward"]
        { lanes_all: 1; lanes_fwd: 1; lanes_bwd: 0; lanes_both: 0; }
way[is_prop_set(ok)][prop(oneway_type)=(-1)][!lanes][!"lanes:backward"][!"lanes:both_ways"][!"lanes:forward"]
        { lanes_all: 1; lanes_fwd: 0; lanes_bwd: 1; lanes_both: 0; }

/* One-ways */
way[is_prop_set(ok)][lanes][!"lanes:forward"][!"lanes:backward"][!"lanes:both_ways"][prop(oneway_type)=1]
        { lanes_fwd: prop(lanes_all); lanes_bwd: 0; lanes_both: 0; }
way[is_prop_set(ok)][lanes][!"lanes:forward"][!"lanes:backward"][!"lanes:both_ways"][prop(oneway_type)=(-1)]
        { lanes_bwd: prop(lanes_all); lanes_fwd: 0; lanes_both: 0; }

way[is_prop_set(ok)][!lanes]["lanes:forward"][!"lanes:backward"][!"lanes:both_ways"][prop(oneway_type)=1]  
        { lanes_all: prop(lanes_fwd); lanes_bwd: 0; lanes_both: 0; }
way[is_prop_set(ok)][!lanes][!"lanes:forward"]["lanes:backward"][!"lanes:both_ways"][prop(oneway_type)=(-1)]
        { lanes_all: prop(lanes_bwd); lanes_fwd: 0; lanes_both: 0; }

/* One count besides both_ways is missing  */
way[is_prop_set(ok)][lanes][!"lanes:forward"]["lanes:backward"][!"lanes:both_ways"]
        { lanes_fwd: eval((prop(lanes_all))-(prop(lanes_bwd))); lanes_both: 0; }
way[is_prop_set(ok)][lanes]["lanes:forward"][!"lanes:backward"][!"lanes:both_ways"]
        { lanes_bwd: eval((prop(lanes_all))-(prop(lanes_fwd))); lanes_both: 0;}
way[is_prop_set(ok)][!lanes]["lanes:forward"]["lanes:backward"][!"lanes:both_ways"]
        { lanes_all: eval((prop(lanes_fwd))+(prop(lanes_bwd))); lanes_both: 0; }

/* One count is missing  */
way[is_prop_set(ok)][lanes]["lanes:forward"]["lanes:backward"][!"lanes:both_ways"]
        { lanes_both: eval((prop(lanes_all))-((prop(lanes_fwd))+(prop(lanes_bwd)))); }
way[is_prop_set(ok)][lanes]["lanes:forward"][!"lanes:backward"]["lanes:both_ways"]
        { lanes_bwd: eval((prop(lanes_all))-((prop(lanes_fwd))+(prop(lanes_both)))); }
way[is_prop_set(ok)][lanes][!"lanes:forward"]["lanes:backward"]["lanes:both_ways"]
        { lanes_fwd: eval((prop(lanes_all))-((prop(lanes_bwd))+(prop(lanes_both)))); }
way[is_prop_set(ok)][!lanes]["lanes:forward"]["lanes:backward"]["lanes:both_ways"]
        { lanes_all: eval((prop(lanes_fwd))+((prop(lanes_bwd))+(prop(lanes_both)))); }

/* Only the lanes tag is set */
way[is_prop_set(ok)][prop(oneway_type)=0][lanes][!"lanes:backward"][!"lanes:both_ways"][!"lanes:forward"]
{

    lanes_fwd:  eval(max(1,floor(tag(lanes)/2)));
    lanes_bwd:  eval(floor(tag(lanes)/2));
    lanes_both: eval((prop(lanes_all))-(prop(lanes_fwd))-(prop(lanes_bwd)));
}

/* Safety check and adding lanes for "non-motorized or non-general traffic" */
way[is_prop_set(ok)]
{
    /* Check for errors */
    data_error: eval(((prop(tag_lanes_all_max)>0) && (prop(tag_lanes_all_min)<prop(tag_lanes_all_max)))?"Inconsistent <tag>:lanes":prop(data_error));
    data_error: eval(((prop(tag_lanes_fwd_max)>0) && (prop(tag_lanes_fwd_min)<prop(tag_lanes_fwd_max)))?"Inconsistent <tag>:lanes:forward":prop(data_error));
    data_error: eval(((prop(tag_lanes_bwd_max)>0) && (prop(tag_lanes_bwd_min)<prop(tag_lanes_bwd_max)))?"Inconsistent <tag>:lanes:backward":prop(data_error));
    data_error: eval(((prop(tag_lanes_both_max)>0) && (prop(tag_lanes_both_min)<prop(tag_lanes_both_max)))?"Inconsistent <tag>:lanes:both_ways":prop(data_error));

    /* Safety check */
    lanes_fwd: eval(cond((prop(lanes_fwd)<0),0,prop(lanes_fwd)));
    lanes_bwd: eval(cond((prop(lanes_bwd)<0),0,prop(lanes_bwd)));
    lanes_both: eval(cond((prop(lanes_both)<0),0,prop(lanes_both)));

    /* In case of one-ways treat the number of all lanes as number of forward/backward lanes */
    tag_lanes_fwd_min: eval((prop(oneway_type)=1)?min(prop(tag_lanes_all_min),prop(tag_lanes_fwd_min)):prop(tag_lanes_fwd_min));
    tag_lanes_fwd_max: eval((prop(oneway_type)=1)?max(prop(tag_lanes_all_max),prop(tag_lanes_fwd_max)):prop(tag_lanes_fwd_max));
    tag_lanes_bwd_min: eval((prop(oneway_type)=(-1))?min(prop(tag_lanes_all_min),prop(tag_lanes_bwd_min)):prop(tag_lanes_bwd_min));
    tag_lanes_bwd_max: eval((prop(oneway_type)=(-1))?max(prop(tag_lanes_all_max),prop(tag_lanes_bwd_max)):prop(tag_lanes_bwd_max));

    /* Difference to the lane count specified by :lanes-tags */
    temp_add_fwd:  eval(max(0,prop(tag_lanes_fwd_max)-prop(lanes_fwd)));
    temp_add_bwd:  eval(max(0,prop(tag_lanes_bwd_max)-prop(lanes_bwd)));
    temp_add_both: eval(max(0,prop(tag_lanes_both_max)-prop(lanes_both)));

    /* Add the difference */
    lanes_fwd: eval(prop(lanes_fwd)+prop(temp_add_fwd));
    lanes_bwd: eval(prop(lanes_bwd)+prop(temp_add_bwd));
    lanes_both: eval(prop(lanes_both)+prop(temp_add_both));

    /* Number of all lanes */
    lanes_all: eval(max(1,((prop(lanes_fwd)+prop(lanes_bwd))+prop(lanes_both))));

    /* Check for some more errors */
    data_error: eval(((prop(tag_lanes_all_max)>0) && (prop(tag_lanes_all_min)<prop(lanes_all)))?"Missing <tag>:lanes values values":prop(data_error));
    data_error: eval(((prop(tag_lanes_fwd_max)>0) && (prop(tag_lanes_fwd_min)<prop(lanes_fwd)))?"Missing <tag>:lanes:forward values":prop(data_error));
    data_error: eval(((prop(tag_lanes_bwd_max)>0) && (prop(tag_lanes_bwd_min)<prop(lanes_bwd)))?"Missing <tag>:lanes:backward values":prop(data_error));
    data_error: eval(((prop(tag_lanes_both_max)>0) && (prop(tag_lanes_both_min)<prop(lanes_both)))?"Missing <tag>:lanes:both_ways values":prop(data_error));
}


/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Determine the width of the lanes, road markings and the inner lane width                                                                        */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17[is_prop_set(ok)]
{
    lane_min_width: 4;
    lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 
    change_allowed: list(6,9);
    road_marking_width: 1;
    road_marking_space: 0;
}

way|z18[is_prop_set(ok)]
{
    lane_min_width: 8;
    lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 
    change_allowed: list(12,18);
    road_marking_width: 2;
    road_marking_space: 1;
}

way|z19[is_prop_set(ok)]
{
    lane_min_width: 8;
    lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 
    change_allowed: list(24,36);
    road_marking_width: 2;
    road_marking_space: 1;
}

way|z20[is_prop_set(ok)]
{
    lane_min_width: 8;
    lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 
    change_allowed: list(48,72);
    road_marking_width: 2;
    road_marking_space: 2;
}

way|z21-[is_prop_set(ok)]
{
    lane_min_width: 12;
    lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 
    change_allowed: list(96,144);
    road_marking_width: 4;
    road_marking_space: 3;
}

way|z22-[is_prop_set(ok)]
{
    lane_min_width: 20;
    lane_default_width: eval(max(prop(lane_min_width),(has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 
    change_allowed: list(192,288);
    road_marking_width: 6;
    road_marking_space: 4;
}

/* Zoom indepedent variables and helpers */
way|z17-[is_prop_set(ok)]
{
    lane_casing:  eval((2*prop(road_marking_width))+prop(road_marking_space));
    change_forbidden: 0;
    change_border: eval((has_tag_key("placement") && (tag("placement")="transition"))?list(1,2):prop(change_forbidden));
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Cleanup of allowed lane changes                                                                                                                 */
/* This must be done AFTER the determination of the lanes count                                                                                    */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way|z17-[is_prop_set(ok)]
{
    change_forward_1_right:  eval(prop(change_forward_1_right)?prop(change_allowed):prop(change_forbidden));
    change_forward_1_left:   eval(prop(change_forward_1_left)?prop(change_allowed):prop(change_forbidden));
    change_forward_2_right:  eval(prop(change_forward_2_right)?prop(change_allowed):prop(change_forbidden));
    change_forward_2_left:   eval(prop(change_forward_2_left)?prop(change_allowed):prop(change_forbidden));
    change_forward_3_right:  eval(prop(change_forward_3_right)?prop(change_allowed):prop(change_forbidden));
    change_forward_3_left:   eval(prop(change_forward_3_left)?prop(change_allowed):prop(change_forbidden));
    change_forward_4_right:  eval(prop(change_forward_4_right)?prop(change_allowed):prop(change_forbidden));
    change_forward_4_left:   eval(prop(change_forward_4_left)?prop(change_allowed):prop(change_forbidden));
    change_forward_5_right:  eval(prop(change_forward_5_right)?prop(change_allowed):prop(change_forbidden));
    change_forward_5_left:   eval(prop(change_forward_5_left)?prop(change_allowed):prop(change_forbidden));
    change_forward_6_right:  eval(prop(change_forward_6_right)?prop(change_allowed):prop(change_forbidden));
    change_forward_6_left:   eval(prop(change_forward_6_left)?prop(change_allowed):prop(change_forbidden));
    change_forward_7_right:  eval(prop(change_forward_7_right)?prop(change_allowed):prop(change_forbidden));
    change_forward_7_left:   eval(prop(change_forward_7_left)?prop(change_allowed):prop(change_forbidden));
    change_forward_8_right:  eval(prop(change_forward_8_right)?prop(change_allowed):prop(change_forbidden));
    change_forward_8_left:   eval(prop(change_forward_8_left)?prop(change_allowed):prop(change_forbidden));

    change_backward_1_right:  eval(prop(change_backward_1_right)?prop(change_allowed):prop(change_forbidden));
    change_backward_1_left:   eval(prop(change_backward_1_left)?prop(change_allowed):prop(change_forbidden));
    change_backward_2_right:  eval(prop(change_backward_2_right)?prop(change_allowed):prop(change_forbidden));
    change_backward_2_left:   eval(prop(change_backward_2_left)?prop(change_allowed):prop(change_forbidden));
    change_backward_3_right:  eval(prop(change_backward_3_right)?prop(change_allowed):prop(change_forbidden));
    change_backward_3_left:   eval(prop(change_backward_3_left)?prop(change_allowed):prop(change_forbidden));
    change_backward_4_right:  eval(prop(change_backward_4_right)?prop(change_allowed):prop(change_forbidden));
    change_backward_4_left:   eval(prop(change_backward_4_left)?prop(change_allowed):prop(change_forbidden));
    change_backward_5_right:  eval(prop(change_backward_5_right)?prop(change_allowed):prop(change_forbidden));
    change_backward_5_left:   eval(prop(change_backward_5_left)?prop(change_allowed):prop(change_forbidden));
    change_backward_6_right:  eval(prop(change_backward_6_right)?prop(change_allowed):prop(change_forbidden));
    change_backward_6_left:   eval(prop(change_backward_6_left)?prop(change_allowed):prop(change_forbidden));
    change_backward_7_right:  eval(prop(change_backward_7_right)?prop(change_allowed):prop(change_forbidden));
    change_backward_7_left:   eval(prop(change_backward_7_left)?prop(change_allowed):prop(change_forbidden));
    change_backward_8_right:  eval(prop(change_backward_8_right)?prop(change_allowed):prop(change_forbidden));
    change_backward_8_left:   eval(prop(change_backward_8_left)?prop(change_allowed):prop(change_forbidden));

    change_bothways_1_right:  eval(prop(change_bothways_1_right)?prop(change_allowed):prop(change_forbidden));
    change_bothways_1_left:   eval(prop(change_bothways_1_left)?prop(change_allowed):prop(change_forbidden));
    change_bothways_2_right:  eval(prop(change_bothways_2_right)?prop(change_allowed):prop(change_forbidden));
    change_bothways_2_left:   eval(prop(change_bothways_2_left)?prop(change_allowed):prop(change_forbidden));
    change_bothways_3_right:  eval(prop(change_bothways_3_right)?prop(change_allowed):prop(change_forbidden));
    change_bothways_3_left:   eval(prop(change_bothways_3_left)?prop(change_allowed):prop(change_forbidden));
    change_bothways_4_right:  eval(prop(change_bothways_4_right)?prop(change_allowed):prop(change_forbidden));
    change_bothways_4_left:   eval(prop(change_bothways_4_left)?prop(change_allowed):prop(change_forbidden));

    /* If two adjacent road markings would look the same, remove one  */
    change_forward_1_right:  eval(cond((prop(lanes_fwd)>1) && (prop(change_forward_2_left)=prop(change_forward_1_right)),list(0.1,999999),prop(change_forward_1_right)));
    change_forward_2_right:  eval(cond((prop(lanes_fwd)>2) && (prop(change_forward_3_left)=prop(change_forward_2_right)),list(0.1,999999),prop(change_forward_2_right)));
    change_forward_3_right:  eval(cond((prop(lanes_fwd)>3) && (prop(change_forward_4_left)=prop(change_forward_3_right)),list(0.1,999999),prop(change_forward_3_right)));
    change_forward_4_right:  eval(cond((prop(lanes_fwd)>4) && (prop(change_forward_5_left)=prop(change_forward_4_right)),list(0.1,999999),prop(change_forward_4_right)));
    change_forward_5_right:  eval(cond((prop(lanes_fwd)>5) && (prop(change_forward_6_left)=prop(change_forward_5_right)),list(0.1,999999),prop(change_forward_5_right)));
    change_forward_6_right:  eval(cond((prop(lanes_fwd)>6) && (prop(change_forward_7_left)=prop(change_forward_6_right)),list(0.1,999999),prop(change_forward_6_right)));
    change_forward_7_right:  eval(cond((prop(lanes_fwd)>7) && (prop(change_forward_8_left)=prop(change_forward_7_right)),list(0.1,999999),prop(change_forward_7_right)));

    change_backward_2_left:  eval(cond((prop(lanes_bwd)>1) && (prop(change_backward_1_right)=prop(change_backward_2_left)),list(0.1,999999),prop(change_backward_2_left)));
    change_backward_3_left:  eval(cond((prop(lanes_bwd)>2) && (prop(change_backward_2_right)=prop(change_backward_3_left)),list(0.1,999999),prop(change_backward_3_left)));
    change_backward_4_left:  eval(cond((prop(lanes_bwd)>3) && (prop(change_backward_3_right)=prop(change_backward_4_left)),list(0.1,999999),prop(change_backward_4_left)));
    change_backward_5_left:  eval(cond((prop(lanes_bwd)>4) && (prop(change_backward_4_right)=prop(change_backward_5_left)),list(0.1,999999),prop(change_backward_5_left)));
    change_backward_6_left:  eval(cond((prop(lanes_bwd)>5) && (prop(change_backward_5_right)=prop(change_backward_6_left)),list(0.1,999999),prop(change_backward_6_left)));
    change_backward_7_left:  eval(cond((prop(lanes_bwd)>6) && (prop(change_backward_6_right)=prop(change_backward_7_left)),list(0.1,999999),prop(change_backward_7_left)));
    change_backward_8_left:  eval(cond((prop(lanes_bwd)>7) && (prop(change_backward_7_right)=prop(change_backward_8_left)),list(0.1,999999),prop(change_backward_8_left)));

    change_bothways_1_right:  eval(cond((prop(lanes_fwd)>1) && (prop(change_bothways_2_left)=prop(change_bothways_1_right)),list(0.1,999999),prop(change_bothways_1_right)));
    change_bothways_2_right:  eval(cond((prop(lanes_fwd)>2) && (prop(change_bothways_3_left)=prop(change_bothways_2_right)),list(0.1,999999),prop(change_bothways_2_right)));
    change_bothways_3_right:  eval(cond((prop(lanes_fwd)>3) && (prop(change_bothways_4_left)=prop(change_bothways_3_right)),list(0.1,999999),prop(change_bothways_3_right)));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Make the borders always solid                                                                                                                   */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)][prop(style_right_hand_traffic)]
{
    change_forward_1_left:  eval(((prop(oneway_type)=1) || (prop(lanes_all)=1))?prop(change_border):prop(change_forward_1_left));
    change_backward_1_left: eval((prop(oneway_type)=(-1))?prop(change_border):prop(change_backward_1_left));
}
way|z17-[is_prop_set(ok)][!prop(style_right_hand_traffic)]
{
    change_forward_1_left:  prop(change_border);
    change_backward_1_left: prop(change_border);
    change_forward_1_right:  eval((prop(lanes_all)=1)?prop(change_border):prop(change_forward_1_right));
}
way|z17-[is_prop_set(ok)][prop(style_right_hand_traffic)],
way|z17-[is_prop_set(ok)][!prop(style_right_hand_traffic)][prop(oneway_type)=1]
{
    change_forward_1_right: eval((prop(lanes_fwd)=1)?prop(change_border):prop(change_forward_1_right));  
    change_forward_2_right: eval((prop(lanes_fwd)=2)?prop(change_border):prop(change_forward_2_right));  
    change_forward_3_right: eval((prop(lanes_fwd)=3)?prop(change_border):prop(change_forward_3_right));  
    change_forward_4_right: eval((prop(lanes_fwd)=4)?prop(change_border):prop(change_forward_4_right));  
    change_forward_5_right: eval((prop(lanes_fwd)=5)?prop(change_border):prop(change_forward_5_right));  
    change_forward_6_right: eval((prop(lanes_fwd)=6)?prop(change_border):prop(change_forward_6_right));  
    change_forward_7_right: eval((prop(lanes_fwd)=7)?prop(change_border):prop(change_forward_7_right));  
    change_forward_8_right: eval((prop(lanes_fwd)=8)?prop(change_border):prop(change_forward_8_right));  
}
way|z17-[is_prop_set(ok)][prop(style_right_hand_traffic)],
way|z17-[is_prop_set(ok)][!prop(style_right_hand_traffic)][prop(oneway_type)=(-1)]
{
    change_backward_1_right: eval((prop(lanes_bwd)=1)?prop(change_border):prop(change_backward_1_right));  
    change_backward_2_right: eval((prop(lanes_bwd)=2)?prop(change_border):prop(change_backward_2_right));  
    change_backward_3_right: eval((prop(lanes_bwd)=3)?prop(change_border):prop(change_backward_3_right));  
    change_backward_4_right: eval((prop(lanes_bwd)=4)?prop(change_border):prop(change_backward_4_right));  
    change_backward_5_right: eval((prop(lanes_bwd)=5)?prop(change_border):prop(change_backward_5_right));  
    change_backward_6_right: eval((prop(lanes_bwd)=6)?prop(change_border):prop(change_backward_6_right));  
    change_backward_7_right: eval((prop(lanes_bwd)=7)?prop(change_border):prop(change_backward_7_right));  
    change_backward_8_right: eval((prop(lanes_bwd)=8)?prop(change_border):prop(change_backward_8_right));  
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Splitting the list of signs into separate properties                                                                                            */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way[!(prop(sign_forward_1)="")] { t: eval(split(";",prop(sign_forward_1))); sign_1_forward_1: eval(get(prop(t),1)); sign_2_forward_1: eval(get(prop(t),2)); sign_3_forward_1: eval(get(prop(t),3)); }
way[!(prop(sign_forward_2)="")] { t: eval(split(";",prop(sign_forward_2))); sign_1_forward_2: eval(get(prop(t),1)); sign_2_forward_2: eval(get(prop(t),2)); sign_3_forward_2: eval(get(prop(t),3)); }
way[!(prop(sign_forward_3)="")] { t: eval(split(";",prop(sign_forward_3))); sign_1_forward_3: eval(get(prop(t),1)); sign_2_forward_3: eval(get(prop(t),2)); sign_3_forward_3: eval(get(prop(t),3)); }
way[!(prop(sign_forward_4)="")] { t: eval(split(";",prop(sign_forward_4))); sign_1_forward_4: eval(get(prop(t),1)); sign_2_forward_4: eval(get(prop(t),2)); sign_3_forward_4: eval(get(prop(t),3)); }
way[!(prop(sign_forward_5)="")] { t: eval(split(";",prop(sign_forward_5))); sign_1_forward_5: eval(get(prop(t),1)); sign_2_forward_5: eval(get(prop(t),2)); sign_3_forward_5: eval(get(prop(t),3)); }
way[!(prop(sign_forward_6)="")] { t: eval(split(";",prop(sign_forward_6))); sign_1_forward_6: eval(get(prop(t),1)); sign_2_forward_6: eval(get(prop(t),2)); sign_3_forward_6: eval(get(prop(t),3)); }
way[!(prop(sign_forward_7)="")] { t: eval(split(";",prop(sign_forward_7))); sign_1_forward_7: eval(get(prop(t),1)); sign_2_forward_7: eval(get(prop(t),2)); sign_3_forward_7: eval(get(prop(t),3)); }
way[!(prop(sign_forward_7)="")] { t: eval(split(";",prop(sign_forward_8))); sign_1_forward_8: eval(get(prop(t),1)); sign_2_forward_8: eval(get(prop(t),2)); sign_3_forward_8: eval(get(prop(t),3)); }

way[!(prop(sign_backward_1)="")] { t: eval(split(";",prop(sign_backward_1))); sign_1_backward_1: eval(get(prop(t),1)); sign_2_backward_1: eval(get(prop(t),2)); sign_3_backward_1: eval(get(prop(t),3)); }
way[!(prop(sign_backward_2)="")] { t: eval(split(";",prop(sign_backward_2))); sign_1_backward_2: eval(get(prop(t),1)); sign_2_backward_2: eval(get(prop(t),2)); sign_3_backward_2: eval(get(prop(t),3)); }
way[!(prop(sign_backward_3)="")] { t: eval(split(";",prop(sign_backward_3))); sign_1_backward_3: eval(get(prop(t),1)); sign_2_backward_3: eval(get(prop(t),2)); sign_3_backward_3: eval(get(prop(t),3)); }
way[!(prop(sign_backward_4)="")] { t: eval(split(";",prop(sign_backward_4))); sign_1_backward_4: eval(get(prop(t),1)); sign_2_backward_4: eval(get(prop(t),2)); sign_3_backward_4: eval(get(prop(t),3)); }
way[!(prop(sign_backward_5)="")] { t: eval(split(";",prop(sign_backward_5))); sign_1_backward_5: eval(get(prop(t),1)); sign_2_backward_5: eval(get(prop(t),2)); sign_3_backward_5: eval(get(prop(t),3)); }
way[!(prop(sign_backward_6)="")] { t: eval(split(";",prop(sign_backward_6))); sign_1_backward_6: eval(get(prop(t),1)); sign_2_backward_6: eval(get(prop(t),2)); sign_3_backward_6: eval(get(prop(t),3)); }
way[!(prop(sign_backward_7)="")] { t: eval(split(";",prop(sign_backward_7))); sign_1_backward_7: eval(get(prop(t),1)); sign_2_backward_7: eval(get(prop(t),2)); sign_3_backward_7: eval(get(prop(t),3)); }
way[!(prop(sign_backward_7)="")] { t: eval(split(";",prop(sign_backward_8))); sign_1_backward_8: eval(get(prop(t),1)); sign_2_backward_8: eval(get(prop(t),2)); sign_3_backward_8: eval(get(prop(t),3)); }


/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Lane-dependent width                                                                                                                            */
/* This must be done AFTER the determination of the lanes count                                                                                    */
/* Note: the number of values is calcuated BEFORE the determination of the lanes count                                                             */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way|z17-[is_prop_set(ok)]
{
    lane_width_forward_1: eval(prop(lane_default_width));    lane_width_forward_2: eval(prop(lane_default_width));
    lane_width_forward_3: eval(prop(lane_default_width));    lane_width_forward_4: eval(prop(lane_default_width));
    lane_width_forward_5: eval(prop(lane_default_width));    lane_width_forward_6: eval(prop(lane_default_width));
    lane_width_forward_7: eval(prop(lane_default_width));    lane_width_forward_8: eval(prop(lane_default_width));

    lane_width_backward_1: eval(prop(lane_default_width));    lane_width_backward_2: eval(prop(lane_default_width));
    lane_width_backward_3: eval(prop(lane_default_width));    lane_width_backward_4: eval(prop(lane_default_width));
    lane_width_backward_5: eval(prop(lane_default_width));    lane_width_backward_6: eval(prop(lane_default_width));
    lane_width_backward_7: eval(prop(lane_default_width));    lane_width_backward_8: eval(prop(lane_default_width));

    lane_width_bothways_1: eval(prop(lane_default_width));    lane_width_bothways_2: eval(prop(lane_default_width));
    lane_width_bothways_3: eval(prop(lane_default_width));    lane_width_bothways_4: eval(prop(lane_default_width));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Forward lanes                                                                                                                                   */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["width:lanes:forward"],
way|z17-[is_prop_set(ok)]["width:lanes"][prop(oneway_type)=1]
{
    temp: eval(cond(has_tag_key("width:lanes:forward"),tag("width:lanes:forward"),tag("width:lanes")));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    lane_width_forward_1: eval(((prop(temp_length)>0) && (get(prop(temp_list),0)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),0)))):prop(lane_default_width));
    lane_width_forward_2: eval(((prop(temp_length)>1) && (get(prop(temp_list),1)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),1)))):prop(lane_default_width));
    lane_width_forward_3: eval(((prop(temp_length)>2) && (get(prop(temp_list),2)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),2)))):prop(lane_default_width));
    lane_width_forward_4: eval(((prop(temp_length)>3) && (get(prop(temp_list),3)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),3)))):prop(lane_default_width));
    lane_width_forward_5: eval(((prop(temp_length)>4) && (get(prop(temp_list),4)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),4)))):prop(lane_default_width));
    lane_width_forward_6: eval(((prop(temp_length)>5) && (get(prop(temp_list),5)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),5)))):prop(lane_default_width));
    lane_width_forward_7: eval(((prop(temp_length)>6) && (get(prop(temp_list),6)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),6)))):prop(lane_default_width));
    lane_width_forward_8: eval(((prop(temp_length)>7) && (get(prop(temp_list),7)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),7)))):prop(lane_default_width));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Backward lanes                                                                                                                                  */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["width:lanes:backward"],
way|z17-[is_prop_set(ok)]["width:lanes"][prop(oneway_type)=(-1)]
{
    temp: eval(cond(has_tag_key("width:lanes:backward"),tag("width:lanes:backward"),tag("width:lanes")));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    lane_width_backward_1: eval(((prop(temp_length)>0) && (get(prop(temp_list),0)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),0)))):prop(lane_default_width));
    lane_width_backward_2: eval(((prop(temp_length)>1) && (get(prop(temp_list),1)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),1)))):prop(lane_default_width));
    lane_width_backward_3: eval(((prop(temp_length)>2) && (get(prop(temp_list),2)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),2)))):prop(lane_default_width));
    lane_width_backward_4: eval(((prop(temp_length)>3) && (get(prop(temp_list),3)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),3)))):prop(lane_default_width));
    lane_width_backward_5: eval(((prop(temp_length)>4) && (get(prop(temp_list),4)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),4)))):prop(lane_default_width));
    lane_width_backward_6: eval(((prop(temp_length)>5) && (get(prop(temp_list),5)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),5)))):prop(lane_default_width));
    lane_width_backward_7: eval(((prop(temp_length)>6) && (get(prop(temp_list),6)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),6)))):prop(lane_default_width));
    lane_width_backward_8: eval(((prop(temp_length)>7) && (get(prop(temp_list),7)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),7)))):prop(lane_default_width));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Bothways lanes                                                                                                                                  */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]["width:lanes:both_ways"]
{
    temp: eval(tag("width:lanes:both_ways"));
    temp_list: eval(split("|",prop(temp)));
    temp_length: eval(length(prop(temp_list)));

    lane_width_bothways_1: eval(((prop(temp_length)>0) && (get(prop(temp_list),0)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),0)))):prop(lane_default_width));
    lane_width_bothways_2: eval(((prop(temp_length)>1) && (get(prop(temp_list),1)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),1)))):prop(lane_default_width));
    lane_width_bothways_3: eval(((prop(temp_length)>2) && (get(prop(temp_list),2)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),2)))):prop(lane_default_width));
    lane_width_bothways_4: eval(((prop(temp_length)>3) && (get(prop(temp_list),3)>0))?(max(prop(lane_min_width),(prop(pixel_per_metre)*get(prop(temp_list),3)))):prop(lane_default_width));
}

way|z17-[is_prop_set(ok)]
{
    lane_width_all_forward: eval(
                                    ((prop(lanes_fwd)>0)?prop(lane_width_forward_1):0)+
                                    ((prop(lanes_fwd)>1)?prop(lane_width_forward_2):0)+
                                    ((prop(lanes_fwd)>2)?prop(lane_width_forward_3):0)+
                                    ((prop(lanes_fwd)>3)?prop(lane_width_forward_4):0)+
                                    ((prop(lanes_fwd)>4)?prop(lane_width_forward_5):0)+
                                    ((prop(lanes_fwd)>5)?prop(lane_width_forward_6):0)+
                                    ((prop(lanes_fwd)>6)?prop(lane_width_forward_7):0)+
                                    ((prop(lanes_fwd)>7)?prop(lane_width_forward_8):0)
                                );

    lane_width_all_backward: eval(
                                    ((prop(lanes_bwd)>0)?prop(lane_width_backward_1):0)+
                                    ((prop(lanes_bwd)>1)?prop(lane_width_backward_2):0)+
                                    ((prop(lanes_bwd)>2)?prop(lane_width_backward_3):0)+
                                    ((prop(lanes_bwd)>3)?prop(lane_width_backward_4):0)+
                                    ((prop(lanes_bwd)>4)?prop(lane_width_backward_5):0)+
                                    ((prop(lanes_bwd)>5)?prop(lane_width_backward_6):0)+
                                    ((prop(lanes_bwd)>6)?prop(lane_width_backward_7):0)+
                                    ((prop(lanes_bwd)>7)?prop(lane_width_backward_8):0)
                                );

    lane_width_all_bothways: eval(
                                    ((prop(lanes_both)>0)?prop(lane_width_bothways_1):0)+
                                    ((prop(lanes_both)>1)?prop(lane_width_bothways_2):0)+
                                    ((prop(lanes_both)>2)?prop(lane_width_bothways_3):0)+
                                    ((prop(lanes_both)>3)?prop(lane_width_bothways_4):0)
                                );

    lane_width_all: eval((prop(lane_width_all_forward)+prop(lane_width_all_backward))+prop(lane_width_all_bothways));
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Offset of the road given by the placement tag                                                                                                   */
/* It is assumed that only one of the placement tags is set, otherwise the result will most certainly be incorrect                                 */
/* TODO: placement:both_ways is currently not supported, verify support for left-hand-traffic                                                      */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Error checking                                                                                                                                  */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way["placement"] 
{
    data_error: eval(regexp_test("^(transition|middle_of:[0-9]+|right_of:[0-9]+|left_of:[0-9]+)$",tag("placement"))?prop(data_error):"invalid placement value");
}
way["placement:forward"] 
{
    data_error: eval(regexp_test("^(transition|middle_of:[0-9]+|right_of:[0-9]+|left_of:[0-9]+)$",tag("placement:forward"))?prop(data_error):"invalid placement:forward value");
}
way["placement:backward"] 
{
    data_error: eval(regexp_test("^(transition|middle_of:[0-9]+|right_of:[0-9]+|left_of:[0-9]+)$",tag("placement:backward"))?prop(data_error):"invalid placement:backward value");
}
way["placement"]["placement:forward"], way["placement"]["placement:backward"], way["placement:forward"]["placement:backward"]
{
    data_error: eval("multiple placement tags");
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* 1. Calculate the borders without consideration of placement                                                                                     */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way[is_prop_set(ok)] 
{
    /* Determine the borders of the parts of the carriageway assuming no placement was specified */
    placement_offset: 0; 
    placement_transition: eval(has_tag_key("placement") && (tag("placement")="transition"));
    left_carriageway_border: eval(prop(lane_width_all)/2.0);
    left_forward_border: eval(cond(prop(style_right_hand_traffic),
                                   (prop(left_carriageway_border) - (prop(lane_width_all_backward)+prop(lane_width_all_bothways))),
                                   prop(left_carriageway_border) 
                                  )
                             ); 
    right_backward_border: eval(cond(prop(style_right_hand_traffic),
                                     (prop(left_carriageway_border) - prop(lane_width_all_backward)),
                                     (prop(left_carriageway_border) - prop(lane_width_all))
                                    )
                               ); 
    left_bothways_border: eval(cond(prop(style_right_hand_traffic),
                                    (prop(left_carriageway_border) - prop(lane_width_all_backward)),
                                    (prop(left_carriageway_border) - prop(lane_width_all_forward))
                                   )
                              ); 
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* 2.a. Offset of the forward lanes                                                                                                                */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]
{
    lane_offset_forward_1: eval(prop(left_forward_border)-
                                (prop(lane_width_forward_1)/2));
    lane_offset_forward_2: eval(prop(lane_offset_forward_1)-
                               ((prop(lane_width_forward_1)+
                                 prop(lane_width_forward_2))/2));
    lane_offset_forward_3: eval(prop(lane_offset_forward_2)-
                               ((prop(lane_width_forward_2)+
                                 prop(lane_width_forward_3))/2));
    lane_offset_forward_4: eval(prop(lane_offset_forward_3)-
                               ((prop(lane_width_forward_3)+
                                 prop(lane_width_forward_4))/2));
    lane_offset_forward_5: eval(prop(lane_offset_forward_4)-
                               ((prop(lane_width_forward_4)+
                                 prop(lane_width_forward_5))/2));
    lane_offset_forward_6: eval(prop(lane_offset_forward_5)-
                               ((prop(lane_width_forward_5)+
                                 prop(lane_width_forward_6))/2));
    lane_offset_forward_7: eval(prop(lane_offset_forward_6)-
                               ((prop(lane_width_forward_6)+
                                 prop(lane_width_forward_7))/2));
    lane_offset_forward_8: eval(prop(lane_offset_forward_7)-
                               ((prop(lane_width_forward_7)+
                                 prop(lane_width_forward_8))/2));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* 2.b. Offset of the backward lanes                                                                                                               */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]
{
    lane_offset_backward_1: eval(prop(right_backward_border)+
                                 (prop(lane_width_backward_1)/2));
    lane_offset_backward_2: eval(prop(lane_offset_backward_1)+
                                ((prop(lane_width_backward_1)+
                                  prop(lane_width_backward_2))/2));
    lane_offset_backward_3: eval(prop(lane_offset_backward_2)+
                                ((prop(lane_width_backward_2)+
                                  prop(lane_width_backward_3))/2));
    lane_offset_backward_4: eval(prop(lane_offset_backward_3)+
                                ((prop(lane_width_backward_3)+
                                  prop(lane_width_backward_4))/2));
    lane_offset_backward_5: eval(prop(lane_offset_backward_4)+
                                ((prop(lane_width_backward_4)+
                                  prop(lane_width_backward_5))/2));
    lane_offset_backward_6: eval(prop(lane_offset_backward_5)+
                                ((prop(lane_width_backward_5)+
                                  prop(lane_width_backward_6))/2));
    lane_offset_backward_7: eval(prop(lane_offset_backward_6)+
                                ((prop(lane_width_backward_6)+
                                  prop(lane_width_backward_7))/2));
    lane_offset_backward_8: eval(prop(lane_offset_backward_7)+
                                ((prop(lane_width_backward_7)+
                                  prop(lane_width_backward_8))/2));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* 2.c. Offset of the both_ways lanes                                                                                                                */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok)]
{
    lane_offset_bothways_1: eval(prop(left_bothways_border)-
                                 (prop(lane_width_bothways_1)/2));
    lane_offset_bothways_2: eval(prop(lane_offset_bothways_1)-
                                ((prop(lane_width_bothways_1)+
                                  prop(lane_width_bothways_2))/2));
    lane_offset_bothways_3: eval(prop(lane_offset_bothways_2)-
                                ((prop(lane_width_bothways_2)+
                                  prop(lane_width_bothways_3))/2));
    lane_offset_bothways_4: eval(prop(lane_offset_bothways_3)-
                                ((prop(lane_width_bothways_3)+
                                  prop(lane_width_bothways_4))/2));
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* 3. Now determine the offset given by the placement tag                                                                                          */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way[is_prop_set(ok)]["placement:forward"]["placement:forward"!=transition],
way[is_prop_set(ok)][prop(oneway_type)=1][placement][placement!=transition]
{
    placement_value: eval(has_tag_key("placement")?tag("placement"):tag("placement:forward"));
    placement_offset: eval(
                cond(prop("placement_value")="right_of:1",eval((prop(lane_width_forward_1)/2)-prop(lane_offset_forward_1)),
                cond(prop("placement_value")="right_of:2",eval((prop(lane_width_forward_2)/2)-prop(lane_offset_forward_2)),
                cond(prop("placement_value")="right_of:3",eval((prop(lane_width_forward_3)/2)-prop(lane_offset_forward_3)),
                cond(prop("placement_value")="right_of:4",eval((prop(lane_width_forward_4)/2)-prop(lane_offset_forward_4)),
                cond(prop("placement_value")="right_of:5",eval((prop(lane_width_forward_5)/2)-prop(lane_offset_forward_5)),
                cond(prop("placement_value")="right_of:6",eval((prop(lane_width_forward_6)/2)-prop(lane_offset_forward_6)),
                cond(prop("placement_value")="right_of:7",eval((prop(lane_width_forward_7)/2)-prop(lane_offset_forward_7)),
                cond(prop("placement_value")="right_of:8",eval((prop(lane_width_forward_8)/2)-prop(lane_offset_forward_8)),
                cond(prop("placement_value")="left_of:1",eval(-(prop(lane_offset_forward_1)+(prop(lane_width_forward_1)/2))),
                cond(prop("placement_value")="left_of:2",eval(-(prop(lane_offset_forward_2)+(prop(lane_width_forward_2)/2))),
                cond(prop("placement_value")="left_of:3",eval(-(prop(lane_offset_forward_3)+(prop(lane_width_forward_3)/2))),
                cond(prop("placement_value")="left_of:4",eval(-(prop(lane_offset_forward_4)+(prop(lane_width_forward_4)/2))),
                cond(prop("placement_value")="left_of:5",eval(-(prop(lane_offset_forward_5)+(prop(lane_width_forward_5)/2))),
                cond(prop("placement_value")="left_of:6",eval(-(prop(lane_offset_forward_6)+(prop(lane_width_forward_6)/2))),
                cond(prop("placement_value")="left_of:7",eval(-(prop(lane_offset_forward_7)+(prop(lane_width_forward_7)/2))),
                cond(prop("placement_value")="left_of:8",eval(-(prop(lane_offset_forward_8)+(prop(lane_width_forward_8)/2))),
                cond(prop("placement_value")="middle_of:1",eval(-prop(lane_offset_forward_1)),
                cond(prop("placement_value")="middle_of:2",eval(-prop(lane_offset_forward_2)),
                cond(prop("placement_value")="middle_of:3",eval(-prop(lane_offset_forward_3)),
                cond(prop("placement_value")="middle_of:4",eval(-prop(lane_offset_forward_4)),
                cond(prop("placement_value")="middle_of:5",eval(-prop(lane_offset_forward_5)),
                cond(prop("placement_value")="middle_of:6",eval(-prop(lane_offset_forward_6)),
                cond(prop("placement_value")="middle_of:7",eval(-prop(lane_offset_forward_7)),
                cond(prop("placement_value")="middle_of:8",eval(-prop(lane_offset_forward_8)),
                0
                ))))))))))))))))))))))))
               );
}
way[is_prop_set(ok)]["placement:backward"]["placement:backward"!=transition],
way[is_prop_set(ok)][prop(oneway_type)=(-1)][placement][placement!=transition]
{
    placement_value: eval(has_tag_key("placement")?tag("placement"):tag("placement:backward"));
    placement_offset: eval(
                cond(prop("placement_value")="right_of:1",eval(-(prop(lane_offset_backward_1)+(prop(lane_width_backward_1)/2))),
                cond(prop("placement_value")="right_of:2",eval(-(prop(lane_offset_backward_2)+(prop(lane_width_backward_2)/2))),
                cond(prop("placement_value")="right_of:3",eval(-(prop(lane_offset_backward_3)+(prop(lane_width_backward_3)/2))),
                cond(prop("placement_value")="right_of:4",eval(-(prop(lane_offset_backward_4)+(prop(lane_width_backward_4)/2))),
                cond(prop("placement_value")="right_of:5",eval(-(prop(lane_offset_backward_5)+(prop(lane_width_backward_5)/2))),
                cond(prop("placement_value")="right_of:6",eval(-(prop(lane_offset_backward_6)+(prop(lane_width_backward_6)/2))),
                cond(prop("placement_value")="right_of:7",eval(-(prop(lane_offset_backward_7)+(prop(lane_width_backward_7)/2))),
                cond(prop("placement_value")="right_of:8",eval(-(prop(lane_offset_backward_8)+(prop(lane_width_backward_8)/2))),
                cond(prop("placement_value")="left_of:1",eval((prop(lane_width_backward_1)/2)-prop(lane_offset_backward_1)),
                cond(prop("placement_value")="left_of:2",eval((prop(lane_width_backward_2)/2)-prop(lane_offset_backward_2)),
                cond(prop("placement_value")="left_of:3",eval((prop(lane_width_backward_3)/2)-prop(lane_offset_backward_3)),
                cond(prop("placement_value")="left_of:4",eval((prop(lane_width_backward_4)/2)-prop(lane_offset_backward_4)),
                cond(prop("placement_value")="left_of:5",eval((prop(lane_width_backward_5)/2)-prop(lane_offset_backward_5)),
                cond(prop("placement_value")="left_of:6",eval((prop(lane_width_backward_6)/2)-prop(lane_offset_backward_6)),
                cond(prop("placement_value")="left_of:7",eval((prop(lane_width_backward_7)/2)-prop(lane_offset_backward_7)),
                cond(prop("placement_value")="left_of:8",eval((prop(lane_width_backward_8)/2)-prop(lane_offset_backward_8)),
                cond(prop("placement_value")="middle_of:1",eval(-prop(lane_offset_backward_1)),
                cond(prop("placement_value")="middle_of:2",eval(-prop(lane_offset_backward_2)),
                cond(prop("placement_value")="middle_of:3",eval(-prop(lane_offset_backward_3)),
                cond(prop("placement_value")="middle_of:4",eval(-prop(lane_offset_backward_4)),
                cond(prop("placement_value")="middle_of:5",eval(-prop(lane_offset_backward_5)),
                cond(prop("placement_value")="middle_of:6",eval(-prop(lane_offset_backward_6)),
                cond(prop("placement_value")="middle_of:7",eval(-prop(lane_offset_backward_7)),
                cond(prop("placement_value")="middle_of:8",eval(-prop(lane_offset_backward_8)),
                0
                ))))))))))))))))))))))))
               );
}
way[is_prop_set(ok)]["placement:both_ways"]["placement:both_ways"!=transition]
{
    placement_value: eval(tag("placement:both_ways"));
    placement_offset: eval(
                cond(prop("placement_value")="right_of:1",eval((prop(lane_width_bothways_1)/2)-prop(lane_offset_bothways_1)),
                cond(prop("placement_value")="right_of:2",eval((prop(lane_width_bothways_2)/2)-prop(lane_offset_bothways_2)),
                cond(prop("placement_value")="right_of:3",eval((prop(lane_width_bothways_3)/2)-prop(lane_offset_bothways_3)),
                cond(prop("placement_value")="right_of:4",eval((prop(lane_width_bothways_4)/2)-prop(lane_offset_bothways_4)),
                cond(prop("placement_value")="left_of:1",eval(-(prop(lane_offset_bothways_1)+(prop(lane_width_bothways_1)/2))),
                cond(prop("placement_value")="left_of:2",eval(-(prop(lane_offset_bothways_2)+(prop(lane_width_bothways_2)/2))),
                cond(prop("placement_value")="left_of:3",eval(-(prop(lane_offset_bothways_3)+(prop(lane_width_bothways_3)/2))),
                cond(prop("placement_value")="left_of:4",eval(-(prop(lane_offset_bothways_4)+(prop(lane_width_bothways_4)/2))),
                cond(prop("placement_value")="middle_of:1",eval(-prop(lane_offset_bothways_1)),
                cond(prop("placement_value")="middle_of:2",eval(-prop(lane_offset_bothways_2)),
                cond(prop("placement_value")="middle_of:3",eval(-prop(lane_offset_bothways_3)),
                cond(prop("placement_value")="middle_of:4",eval(-prop(lane_offset_bothways_4)),
                0
                ))))))))))))
               );
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* 4. Move the carriageway and the lanes                                                                                                           */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way[is_prop_set(ok)]
{
    /* Move the carriageway borders */
    left_carriageway_border: eval((prop(left_carriageway_border) + prop(placement_offset))); 
    left_forward_border: eval((prop(left_forward_border) + prop(placement_offset))); 
    right_backward_border: eval((prop(right_backward_border) + prop(placement_offset))); 
    left_bothways_border: eval((prop(left_bothways_border) + prop(placement_offset)));  

    /* Move the lanes */
    lane_offset_forward_1: eval((prop(lane_offset_forward_1) + prop(placement_offset))); 
    lane_offset_forward_2: eval((prop(lane_offset_forward_2) + prop(placement_offset))); 
    lane_offset_forward_3: eval((prop(lane_offset_forward_3) + prop(placement_offset))); 
    lane_offset_forward_4: eval((prop(lane_offset_forward_4) + prop(placement_offset))); 
    lane_offset_forward_5: eval((prop(lane_offset_forward_5) + prop(placement_offset))); 
    lane_offset_forward_6: eval((prop(lane_offset_forward_6) + prop(placement_offset))); 
    lane_offset_forward_7: eval((prop(lane_offset_forward_7) + prop(placement_offset))); 
    lane_offset_forward_8: eval((prop(lane_offset_forward_8) + prop(placement_offset))); 
    lane_offset_backward_1: eval((prop(lane_offset_backward_1) + prop(placement_offset))); 
    lane_offset_backward_2: eval((prop(lane_offset_backward_2) + prop(placement_offset))); 
    lane_offset_backward_3: eval((prop(lane_offset_backward_3) + prop(placement_offset))); 
    lane_offset_backward_4: eval((prop(lane_offset_backward_4) + prop(placement_offset))); 
    lane_offset_backward_5: eval((prop(lane_offset_backward_5) + prop(placement_offset))); 
    lane_offset_backward_6: eval((prop(lane_offset_backward_6) + prop(placement_offset))); 
    lane_offset_backward_7: eval((prop(lane_offset_backward_7) + prop(placement_offset))); 
    lane_offset_backward_8: eval((prop(lane_offset_backward_8) + prop(placement_offset))); 
    lane_offset_bothways_1: eval((prop(lane_offset_bothways_1) + prop(placement_offset))); 
    lane_offset_bothways_2: eval((prop(lane_offset_bothways_2) + prop(placement_offset))); 
    lane_offset_bothways_3: eval((prop(lane_offset_bothways_3) + prop(placement_offset))); 
    lane_offset_bothways_4: eval((prop(lane_offset_bothways_4) + prop(placement_offset))); 
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Render the carriageway                                                                                                                          */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
way[is_prop_set(ok, "default")][is_prop_set(lanes_all, "default")]::Ground
{
    linecap: none;
    /* The "ground" will be drawn by each lane, so that we can use different colors per lane */
    opacity: 0.0;
    width:   eval(prop(lane_width_all,"default"));
    offset:  prop(placement_offset,"default");
    major-z-index: -1.0;
}

/* Sidewalk and cycletrack */
way|z17- {} /* ATTENTION: For whatever reason this is needed, otherwise the following won't be interpreted correctly */
way|z17-[is_prop_set(ok, "default")][is_prop_set(lanes_all, "default")]::Ground
{
    /* Cycletrack in an one-way on the left side? */
    temp_allow_cycleway_left: eval(!(
                                      ((prop(oneway_type,"default")=1) && prop(style_right_hand_traffic,"default")) ||
                                      ((prop(oneway_type,"default")=(-1)) && (!prop(style_right_hand_traffic,"default")))
                                    ));

    temp_allow_cycleway_left: eval(prop(temp_allow_cycleway_left) || (has_tag_key("oneway:bicycle") && (tag("oneway:bicycle")="no")));
    /* Explicitely no cycletrack on the left side? */
    temp_allow_cycleway_left: eval((has_tag_key("cycleway:left") && (tag("cycleway:left")="no"))?false:prop(temp_allow_cycleway_left));
    /* Cycletrack on the left side */
    temp_cycleway_left: eval(((has_tag_key(cycleway) && ((tag(cycleway)="track") && prop(temp_allow_cycleway_left))) ||
                                (has_tag_key("cycleway:left") && (tag("cycleway:left")="track"))) ||
                                (has_tag_key("cycleway:both") && (tag("cycleway:both")="track"))
                            );

    /* Sidewalk on the left side? */
    templ:  eval((has_tag_key(sidewalk) && ((tag(sidewalk)="both") || (tag(sidewalk)="left")))?1:0);

    /* Combine  sidewalk and cycletrack: 0=none; 1=sidewalk; 2=cycletrack; 3=sidewalk and cycletrack */
    templ: eval(prop(templ)+(prop(temp_cycleway_left)?2:0));


    /* Cycletrack in an one-way on the right side? */
    temp_allow_cycleway_right: eval(!(
                                      ((prop(oneway_type,"default")=(-1)) && prop(style_right_hand_traffic,"default")) ||
                                      ((prop(oneway_type,"default")=1) && (!prop(style_right_hand_traffic,"default")))
                                    ));

    temp_allow_cycleway_right: eval(prop(temp_allow_cycleway_right) || (has_tag_key("oneway:bicycle") && (tag("oneway:bicycle")="no")));
    /* Explicitely no cycletrack on the right side? */
    temp_allow_cycleway_right: eval((has_tag_key("cycleway:right") && (tag("cycleway:right")="no"))?false:prop(temp_allow_cycleway_right));
    /* Cycletrack on the right side */
    temp_cycleway_right: eval(((has_tag_key(cycleway) && ((tag(cycleway)="track") && prop(temp_allow_cycleway_right))) ||
                                (has_tag_key("cycleway:right") && (tag("cycleway:right")="track"))) ||
                                (has_tag_key("cycleway:both") && (tag("cycleway:both")="track"))
                            );

    /* Sidewalk on the right side? */
    tempr:  eval((has_tag_key(sidewalk) && ((tag(sidewalk)="both") || (tag(sidewalk)="right")))?1:0);

    /* Combine  sidewalk and cycletrack: 0=none; 1=sidewalk; 2=cycletrack; 3=sidewalk and cycletrack */
    tempr: eval(prop(tempr)+(prop(temp_cycleway_right)?2:0));


    left-casing-linecap: none;
    left-casing-width: eval((prop(templ)>0)?(prop(lane_default_width,"default")/2):0);
    left-casing-color:  eval(get(prop(style_sidewalk_color,"default"),prop(templ)));
    left-casing-opacity: prop(style_sidewalk_opacity,"default");

    right-casing-linecap: none;
    right-casing-width: eval((prop(tempr)>0)?(prop(lane_default_width,"default")/2):0);
    right-casing-color:  eval(get(prop(style_sidewalk_color,"default"),prop(tempr)));
    right-casing-opacity: prop(style_sidewalk_opacity,"default");
}

/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Render the lanes                                                                                                                                */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/***************************************************************************************************************************************************/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Forward lanes                                                                                                                                   */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 0]::Lane_Forward_1
{
    offset:                                          eval(prop(lane_offset_forward_1,"default"));
    width:                                           eval((prop(lane_width_forward_1,"default")-prop(lane_casing,"default")));
    right-casing-dashes:                                  eval(prop(change_forward_1_right,"default"));
    left-casing-dashes:                                   eval(prop(change_forward_1_left,"default"));
    repeat-image:                                     eval(prop(turn_image_forward_1,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 0]::Lane_Forward_1_Color
{
    offset:                                          eval(prop(lane_offset_forward_1,"default"));
    width:                                            eval(prop(lane_width_forward_1,"default"));
    color:                                                      prop(color_forward_1,"default");
    dashes:                              eval(is_prop_set(restriction_color_forward_1,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_forward_1,"default")?
                                                     prop(restriction_color_forward_1,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_forward_1,     "default")]::Lane_Forward_1_Sign_1
{
    repeat-image:                           eval(prop(sign_1_forward_1,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_1,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_1"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_forward_1,     "default")]::Lane_Forward_1_Sign_2
{
    repeat-image:                           eval(prop(sign_2_forward_1,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_1,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_1"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_forward_1,     "default")]::Lane_Forward_1_Sign_3
{
    repeat-image:                           eval(prop(sign_3_forward_1,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_1,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_1"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 1]::Lane_Forward_2
{
    offset:                                          eval(prop(lane_offset_forward_2,"default"));
    width:                                           eval((prop(lane_width_forward_2,"default")-prop(lane_casing,"default")));
    right-casing-dashes:                                  eval(prop(change_forward_2_right,"default"));
    left-casing-dashes:                                   eval(prop(change_forward_2_left,"default"));
    repeat-image:                                     eval(prop(turn_image_forward_2,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 1]::Lane_Forward_2_Color
{
    offset:                                          eval(prop(lane_offset_forward_2,"default"));
    width:                                            eval(prop(lane_width_forward_2,"default"));
    color:                                                      prop(color_forward_2,"default");
    dashes:                              eval(is_prop_set(restriction_color_forward_2,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_forward_2,"default")?
                                                     prop(restriction_color_forward_2,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_forward_2,     "default")]::Lane_Forward_2_Sign_1
{
    repeat-image:                           eval(prop(sign_1_forward_2,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_2,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_2"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_forward_2,     "default")]::Lane_Forward_2_Sign_2
{
    repeat-image:                           eval(prop(sign_2_forward_2,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_2,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_2"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_forward_2,     "default")]::Lane_Forward_2_Sign_3
{
    repeat-image:                           eval(prop(sign_3_forward_2,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_2,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_2"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 2]::Lane_Forward_3
{
    offset:                                          eval(prop(lane_offset_forward_3,"default"));
    width:                                           eval((prop(lane_width_forward_3,"default")-prop(lane_casing,"default")));
    right-casing-dashes:                                  eval(prop(change_forward_3_right,"default"));
    left-casing-dashes:                                   eval(prop(change_forward_3_left,"default"));
    repeat-image:                                     eval(prop(turn_image_forward_3,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 2]::Lane_Forward_3_Color
{
    offset:                                          eval(prop(lane_offset_forward_3,"default"));
    width:                                            eval(prop(lane_width_forward_3,"default"));
    color:                                                      prop(color_forward_3,"default");
    dashes:                              eval(is_prop_set(restriction_color_forward_3,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_forward_3,"default")?
                                                     prop(restriction_color_forward_3,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_forward_3,     "default")]::Lane_Forward_3_Sign_1
{
    repeat-image:                           eval(prop(sign_1_forward_3,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_3,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_3"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_forward_3,     "default")]::Lane_Forward_3_Sign_2
{
    repeat-image:                           eval(prop(sign_2_forward_3,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_3,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_3"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_forward_3,     "default")]::Lane_Forward_3_Sign_3
{
    repeat-image:                           eval(prop(sign_3_forward_3,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_3,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_3"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 3]::Lane_Forward_4
{
    offset:                                          eval(prop(lane_offset_forward_4,"default"));
    width:                                           eval((prop(lane_width_forward_4,"default")-prop(lane_casing,"default")));
    right-casing-dashes:                                  eval(prop(change_forward_4_right,"default"));
    left-casing-dashes:                                   eval(prop(change_forward_4_left,"default"));
    repeat-image:                                     eval(prop(turn_image_forward_4,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 3]::Lane_Forward_4_Color
{
    offset:                                          eval(prop(lane_offset_forward_4,"default"));
    width:                                            eval(prop(lane_width_forward_4,"default"));
    color:                                                      prop(color_forward_4,"default");
    dashes:                              eval(is_prop_set(restriction_color_forward_4,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_forward_4,"default")?
                                                     prop(restriction_color_forward_4,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_forward_4,     "default")]::Lane_Forward_4_Sign_1
{
    repeat-image:                           eval(prop(sign_1_forward_4,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_4,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_4"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_forward_4,     "default")]::Lane_Forward_4_Sign_2
{
    repeat-image:                           eval(prop(sign_2_forward_4,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_4,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_4"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_forward_4,     "default")]::Lane_Forward_4_Sign_3
{
    repeat-image:                           eval(prop(sign_3_forward_4,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_4,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_4"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 4]::Lane_Forward_5
{
    offset:                                          eval(prop(lane_offset_forward_5,"default"));
    width:                                           eval((prop(lane_width_forward_5,"default")-prop(lane_casing,"default")));
    right-casing-dashes:                                  eval(prop(change_forward_5_right,"default"));
    left-casing-dashes:                                   eval(prop(change_forward_5_left,"default"));
    repeat-image:                                     eval(prop(turn_image_forward_5,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 4]::Lane_Forward_5_Color
{
    offset:                                          eval(prop(lane_offset_forward_5,"default"));
    width:                                            eval(prop(lane_width_forward_5,"default"));
    color:                                                      prop(color_forward_5,"default");
    dashes:                              eval(is_prop_set(restriction_color_forward_5,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_forward_5,"default")?
                                                     prop(restriction_color_forward_5,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_forward_5,     "default")]::Lane_Forward_5_Sign_1
{
    repeat-image:                           eval(prop(sign_1_forward_5,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_5,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_5"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_forward_5,     "default")]::Lane_Forward_5_Sign_2
{
    repeat-image:                           eval(prop(sign_2_forward_5,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_5,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_5"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_forward_5,     "default")]::Lane_Forward_5_Sign_3
{
    repeat-image:                           eval(prop(sign_3_forward_5,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_5,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_5"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 5]::Lane_Forward_6
{
    offset:                                          eval(prop(lane_offset_forward_6,"default"));
    width:                                           eval((prop(lane_width_forward_6,"default")-prop(lane_casing,"default")));
    right-casing-dashes:                                  eval(prop(change_forward_6_right,"default"));
    left-casing-dashes:                                   eval(prop(change_forward_6_left,"default"));
    repeat-image:                                     eval(prop(turn_image_forward_6,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 5]::Lane_Forward_6_Color
{
    offset:                                          eval(prop(lane_offset_forward_6,"default"));
    width:                                            eval(prop(lane_width_forward_6,"default"));
    color:                                                      prop(color_forward_6,"default");
    dashes:                              eval(is_prop_set(restriction_color_forward_6,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_forward_6,"default")?
                                                     prop(restriction_color_forward_6,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_forward_6,     "default")]::Lane_Forward_6_Sign_1
{
    repeat-image:                           eval(prop(sign_1_forward_6,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_6,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_6"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_forward_6,     "default")]::Lane_Forward_6_Sign_2
{
    repeat-image:                           eval(prop(sign_2_forward_6,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_6,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_6"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_forward_6,     "default")]::Lane_Forward_6_Sign_3
{
    repeat-image:                           eval(prop(sign_3_forward_6,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_6,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_6"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 6]::Lane_Forward_7
{
    offset:                                          eval(prop(lane_offset_forward_7,"default"));
    width:                                           eval((prop(lane_width_forward_7,"default")-prop(lane_casing,"default")));
    right-casing-dashes:                                  eval(prop(change_forward_7_right,"default"));
    left-casing-dashes:                                   eval(prop(change_forward_7_left,"default"));
    repeat-image:                                     eval(prop(turn_image_forward_7,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 6]::Lane_Forward_7_Color
{
    offset:                                          eval(prop(lane_offset_forward_7,"default"));
    width:                                            eval(prop(lane_width_forward_7,"default"));
    color:                                                      prop(color_forward_7,"default");
    dashes:                              eval(is_prop_set(restriction_color_forward_7,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_forward_7,"default")?
                                                     prop(restriction_color_forward_7,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_forward_7,     "default")]::Lane_Forward_7_Sign_1
{
    repeat-image:                           eval(prop(sign_1_forward_7,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_7,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_7"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_forward_7,     "default")]::Lane_Forward_7_Sign_2
{
    repeat-image:                           eval(prop(sign_2_forward_7,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_7,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_7"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_forward_7,     "default")]::Lane_Forward_7_Sign_3
{
    repeat-image:                           eval(prop(sign_3_forward_7,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_7,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_7"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 7]::Lane_Forward_8
{
    offset:                                          eval(prop(lane_offset_forward_8,"default"));
    width:                                           eval((prop(lane_width_forward_8,"default")-prop(lane_casing,"default")));
    right-casing-dashes:                                  eval(prop(change_forward_8_right,"default"));
    left-casing-dashes:                                   eval(prop(change_forward_8_left,"default"));
    repeat-image:                                     eval(prop(turn_image_forward_8,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_fwd, "default") > 7]::Lane_Forward_8_Color
{
    offset:                                          eval(prop(lane_offset_forward_8,"default"));
    width:                                            eval(prop(lane_width_forward_8,"default"));
    color:                                                      prop(color_forward_8,"default");
    dashes:                              eval(is_prop_set(restriction_color_forward_8,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_forward_8,"default")?
                                                     prop(restriction_color_forward_8,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_forward_8,     "default")]::Lane_Forward_8_Sign_1
{
    repeat-image:                           eval(prop(sign_1_forward_8,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_8,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_8"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_forward_8,     "default")]::Lane_Forward_8_Sign_2
{
    repeat-image:                           eval(prop(sign_2_forward_8,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_8,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_8"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_forward_8,     "default")]::Lane_Forward_8_Sign_3
{
    repeat-image:                           eval(prop(sign_3_forward_8,"default"));
    repeat-image-offset:               eval(prop(lane_offset_forward_8,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Forward_8"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Backward lanes                                                                                                                                  */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 0]::Lane_Backward_1
{
    offset:                                          eval(prop(lane_offset_backward_1,"default"));
    width:                                           eval((prop(lane_width_backward_1,"default")-prop(lane_casing,"default")));
    left-casing-dashes:                                   eval(prop(change_backward_1_right,"default"));
    right-casing-dashes:                                  eval(prop(change_backward_1_left,"default"));
    repeat-image:                                     eval(prop(turn_image_backward_1,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 0]::Lane_Backward_1_Color
{
    offset:                                          eval(prop(lane_offset_backward_1,"default"));
    width:                                            eval(prop(lane_width_backward_1,"default"));
    color:                                                      prop(color_backward_1,"default");
    dashes:                              eval(is_prop_set(restriction_color_backward_1,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_backward_1,"default")?
                                                     prop(restriction_color_backward_1,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_backward_1,     "default")]::Lane_Backward_1_Sign_1
{
    repeat-image:                           eval(prop(sign_1_backward_1,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_1,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_1"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_backward_1,     "default")]::Lane_Backward_1_Sign_2
{
    repeat-image:                           eval(prop(sign_2_backward_1,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_1,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_1"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_backward_1,     "default")]::Lane_Backward_1_Sign_3
{
    repeat-image:                           eval(prop(sign_3_backward_1,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_1,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_1"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 1]::Lane_Backward_2
{
    offset:                                          eval(prop(lane_offset_backward_2,"default"));
    width:                                           eval((prop(lane_width_backward_2,"default")-prop(lane_casing,"default")));
    left-casing-dashes:                                   eval(prop(change_backward_2_right,"default"));
    right-casing-dashes:                                  eval(prop(change_backward_2_left,"default"));
    repeat-image:                                     eval(prop(turn_image_backward_2,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 1]::Lane_Backward_2_Color
{
    offset:                                          eval(prop(lane_offset_backward_2,"default"));
    width:                                            eval(prop(lane_width_backward_2,"default"));
    color:                                                      prop(color_backward_2,"default");
    dashes:                              eval(is_prop_set(restriction_color_backward_2,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_backward_2,"default")?
                                                     prop(restriction_color_backward_2,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_backward_2,     "default")]::Lane_Backward_2_Sign_1
{
    repeat-image:                           eval(prop(sign_1_backward_2,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_2,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_2"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_backward_2,     "default")]::Lane_Backward_2_Sign_2
{
    repeat-image:                           eval(prop(sign_2_backward_2,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_2,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_2"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_backward_2,     "default")]::Lane_Backward_2_Sign_3
{
    repeat-image:                           eval(prop(sign_3_backward_2,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_2,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_2"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 2]::Lane_Backward_3
{
    offset:                                          eval(prop(lane_offset_backward_3,"default"));
    width:                                           eval((prop(lane_width_backward_3,"default")-prop(lane_casing,"default")));
    left-casing-dashes:                                   eval(prop(change_backward_3_right,"default"));
    right-casing-dashes:                                  eval(prop(change_backward_3_left,"default"));
    repeat-image:                                     eval(prop(turn_image_backward_3,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 2]::Lane_Backward_3_Color
{
    offset:                                          eval(prop(lane_offset_backward_3,"default"));
    width:                                            eval(prop(lane_width_backward_3,"default"));
    color:                                                      prop(color_backward_3,"default");
    dashes:                              eval(is_prop_set(restriction_color_backward_3,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_backward_3,"default")?
                                                     prop(restriction_color_backward_3,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_backward_3,     "default")]::Lane_Backward_3_Sign_1
{
    repeat-image:                           eval(prop(sign_1_backward_3,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_3,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_3"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_backward_3,     "default")]::Lane_Backward_3_Sign_2
{
    repeat-image:                           eval(prop(sign_2_backward_3,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_3,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_3"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_backward_3,     "default")]::Lane_Backward_3_Sign_3
{
    repeat-image:                           eval(prop(sign_3_backward_3,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_3,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_3"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 3]::Lane_Backward_4
{
    offset:                                          eval(prop(lane_offset_backward_4,"default"));
    width:                                           eval((prop(lane_width_backward_4,"default")-prop(lane_casing,"default")));
    left-casing-dashes:                                   eval(prop(change_backward_4_right,"default"));
    right-casing-dashes:                                  eval(prop(change_backward_4_left,"default"));
    repeat-image:                                     eval(prop(turn_image_backward_4,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"); right-casing-color: white; right-casing-opacity: eval(prop(style_markings_opacity,"default"));
    left-casing-width: prop(road_marking_width,"default"); left-casing-color: white; left-casing-opacity: eval(prop(style_markings_opacity,"default"));
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0));
}
way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 3]::Lane_Backward_4_Color
{
    offset:                                          eval(prop(lane_offset_backward_4,"default"));
    width:                                            eval(prop(lane_width_backward_4,"default"));
    color:                                                      prop(color_backward_4,"default");
    dashes:                              eval(is_prop_set(restriction_color_backward_4,"default")?list(20,20):prop(unset_property));
    dashes-background-color:             eval(is_prop_set(restriction_color_backward_4,"default")?
                                                     prop(restriction_color_backward_4,"default"):prop(unset_property));
    opacity: prop(style_lane_opacity,"default"); linecap: none;
    major-z-index: eval(cond(prop(placement_transition,"default"),-0.1,0.0)); object-z-index: -0.1;
}
way|z17-[is_prop_set(sign_1_backward_4,     "default")]::Lane_Backward_4_Sign_1
{
    repeat-image:                           eval(prop(sign_1_backward_4,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_4,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_4"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 3);
}
way|z17-[is_prop_set(sign_2_backward_4,     "default")]::Lane_Backward_4_Sign_2
{
    repeat-image:                           eval(prop(sign_2_backward_4,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_4,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_4"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 2);
}
way|z17-[is_prop_set(sign_3_backward_4,     "default")]::Lane_Backward_4_Sign_3
{
    repeat-image:                           eval(prop(sign_3_backward_4,"default"));
    repeat-image-offset:               eval(prop(lane_offset_backward_4,"default"));
    repeat-image-height: eval(prop(repeat-image-height,"Lane_Backward_4"));
    repeat-image-spacing: eval(prop(repeat-image-height) * 4);    repeat-image-phase: eval(prop(repeat-image-height) * 4);
}

way|z17-[is_prop_set(ok, "default")][prop(lanes_bwd, "default") > 4]::Lane_Backward_5
{
    offset:                                          eval(prop(lane_offset_backward_5,"default"));
    width:                                           eval((prop(lane_width_backward_5,"default")-prop(lane_casing,"default")));
    left-casing-dashes:                                   eval(prop(change_backward_5_right,"default"));
    right-casing-dashes:                                  eval(prop(change_backward_5_left,"default"));
    repeat-image:                                     eval(prop(turn_image_backward_5,"default"));

    opacity: 0.0; linecap: none;
    repeat-image-offset: eval(prop(offset));
    repeat-image-height: eval(min(prop(lane_default_width,"default"),prop(width)));
    repeat-image-spacing: eval(prop(repeat-image-height) * 3);
    right-casing-width: prop(road_marking_width,"default"