| | 3225 | /* Railway rendering */ |
| | 3226 | /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ |
| | 3227 | /***************************************************************************************************************************************************/ |
| | 3228 | way|z18-[railway=rail]::Railway_Way, |
| | 3229 | way|z18-[railway=light_rail]::Railway_Way, |
| | 3230 | way|z18-[railway=subway]::Railway_Way, |
| | 3231 | way|z18-[railway=miniature]::Railway_Way, |
| | 3232 | way|z18-[railway=tram]::Railway_Way |
| | 3233 | { |
| | 3234 | |
| | 3235 | rail_gauge_list: eval(has_tag_key("gauge")?split(";",tag("gauge")):list(1435)); |
| | 3236 | 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))); |
| | 3238 | |
| | 3239 | /* 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)); |
| | 3247 | rail_electrified_rail: eval(cond(has_tag_key("electrified"),cond(tag("electrified")="rail",yes,no),no)); |
| | 3248 | |
| | 3249 | /* Make rails transparent within tunnels */ |
| | 3250 | rail_image_opacity: eval(cond(((has_tag_key("tunnel")) && (tag("tunnel")=="yes")),0.2,0.8)); |
| | 3251 | |
| | 3252 | /* Create image */ |
| | 3253 | 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))); |
| | 3265 | } |
| | 3266 | |
| | 3267 | /***************************************************************************************************************************************************/ |
| | 3268 | /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ |