Changes between Version 56 and Version 57 of Styles/Lane_and_Road_Attributes


Ignore:
Timestamp:
2015-02-10T11:24:54+01:00 (11 years ago)
Author:
imagic
Comment:

Safety check for gauge added

Legend:

Unmodified
Added
Removed
Modified
  • Styles/Lane_and_Road_Attributes

    v56 v57  
    32323232way|z18-[railway=tram]::Railway_Way
    32333233{
    3234        
     3234    /* Determine gauge (safety limits: 1 - 10000 mm) */
    32353235    rail_gauge_list: eval(has_tag_key("gauge")?split(";",tag("gauge")):list(1435));
    32363236    rail_gauge: eval(get(prop(rail_gauge_list),length(prop(rail_gauge_list))-1));
    3237     rail_gauge: eval(cond(prop(rail_gauge)<1,1435,prop(rail_gauge)));
     3237    rail_gauge: eval(min(10000,cond(prop(rail_gauge)<1,1435,prop(rail_gauge))));
    32383238 
    32393239    /* Ties should be rendered in case standard and miniature railways; this might be override by the key embedded */
    3240         rail_show_ties: eval(cond(((tag("railway")=="rail") || (tag("railway")=="miniature")),yes,no));
    3241         rail_show_ties: eval(cond(has_tag_key("embedded"),cond(tag("embedded")=="no",yes,no),prop(rail_show_ties)));
    3242 
    3243         /* Type of electrification:  */
    3244         /*    * rail -> show a yellow border on one rail */
    3245         /*    * contact_line -> show a contact line near the middle of the track */
    3246         rail_show_contact_line: eval(cond(has_tag_key("electrified"),cond(tag("electrified")="contact_line",yes,no),no));
     3240    rail_show_ties: eval(cond(((tag("railway")=="rail") || (tag("railway")=="miniature")),yes,no));
     3241    rail_show_ties: eval(cond(has_tag_key("embedded"),cond(tag("embedded")=="no",yes,no),prop(rail_show_ties)));
     3242
     3243    /* Type of electrification:  */
     3244    /*    * rail -> show a yellow border on one rail */
     3245    /*    * contact_line -> show a contact line near the middle of the track */
     3246    rail_show_contact_line: eval(cond(has_tag_key("electrified"),cond(tag("electrified")="contact_line",yes,no),no));
    32473247    rail_electrified_rail: eval(cond(has_tag_key("electrified"),cond(tag("electrified")="rail",yes,no),no));
    32483248   
     
    32523252    /* Create image */
    32533253    rail_image: eval(concat(
    3254     cond(prop(rail_show_ties),"<rect x='0' y='0' width='8' height='80' style='stroke:#301004; fill:#90300C;'/>",""),
    3255     "<line x1='0' y1= '8' x2='32' y2= '8' style='stroke:",cond(prop(rail_electrified_rail),"#FFFF00","#301004"),";'/>",
    3256     "<line x1='0' y1='10' x2='32' y2='10' style='stroke:#602008;stroke-width:3px'/>",
    3257     "<line x1='0' y1='12' x2='32' y2='12' style='stroke:#301004;'/>",
    3258     "<line x1='0' y1='67' x2='32' y2='67' style='stroke:#301004;'/>",
    3259     "<line x1='0' y1='69' x2='32' y2='69' style='stroke:#602008;stroke-width:3px'/>",
    3260     "<line x1='0' y1='71' x2='32' y2='71' style='stroke:#301004;'/>",
    3261     cond(prop(rail_show_contact_line),"<line x1='0' y1='35' x2='32' y2='35' style='stroke:#060200;'/>","")
    3262     ));   
    3263         repeat-image: concat("data:image/svg+xml,<svg width='32px' height='80px'><g fill-opacity='",prop(rail_image_opacity),"' opacity='",prop(rail_image_opacity),"'>",prop(rail_image),"</g></svg>");
    3264         repeat-image-height: eval(max(2,ceil((prop(rail_gauge)*prop(pixel_per_metre,"default"))*0.0012)));
     3254                cond(prop(rail_show_ties),"<rect x='0' y='0' width='8' height='80' style='stroke:#301004; fill:#90300C;'/>",""),
     3255                "<line x1='0' y1= '8' x2='32' y2= '8' style='stroke:",cond(prop(rail_electrified_rail),"#FFFF00","#301004"),";'/>",
     3256                "<line x1='0' y1='10' x2='32' y2='10' style='stroke:#602008;stroke-width:3px'/>",
     3257                "<line x1='0' y1='12' x2='32' y2='12' style='stroke:#301004;'/>",
     3258                "<line x1='0' y1='67' x2='32' y2='67' style='stroke:#301004;'/>",
     3259                "<line x1='0' y1='69' x2='32' y2='69' style='stroke:#602008;stroke-width:3px'/>",
     3260                "<line x1='0' y1='71' x2='32' y2='71' style='stroke:#301004;'/>",
     3261                cond(prop(rail_show_contact_line),"<line x1='0' y1='35' x2='32' y2='35' style='stroke:#060200;'/>","")
     3262                ));   
     3263    repeat-image: concat("data:image/svg+xml,<svg width='32px' height='80px'><g fill-opacity='",prop(rail_image_opacity),"' opacity='",prop(rail_image_opacity),"'>",prop(rail_image),"</g></svg>");
     3264    repeat-image-height: eval(max(2,ceil((prop(rail_gauge)*prop(pixel_per_metre,"default"))*0.0012)));
    32653265}
    32663266