Changes between Version 55 and Version 56 of Styles/Lane_and_Road_Attributes


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

Added simple support for railway=rail/light_rail/subway/miniature/tram

Legend:

Unmodified
Added
Removed
Modified
  • Styles/Lane_and_Road_Attributes

    v55 v56  
    2323* [[osmwiki:Relation:destination_sign|Relation destination_sign]]: Experimental and very limited support!
    2424* [[osmwiki:Key:driving_side|driving_side]]: Used to specify the driving side of the traffic. This is only supported on ways.
     25* [[osmwiki:Key:railway|railway]]: Tracks of railways are rendered with limited support for gauge, embedded and electrified.
    2526
    2627Furthermore:
     
    7071    link: "http://josm.openstreetmap.de/wiki/Styles/Lane_and_Road_Attributes";
    7172    author: "Martin Vonwald";
    72     version: "2.9-[[revision]]_[[date]]";
     73    version: "2.10-[[revision]]_[[date]]";
    7374    license: "CC-BY-SA";
    7475    icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNyAxOCI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM4NSAtNTI0LjM2KSI+PHBhdGggZmlsbD0iIzIwMmQyMCIgZD0ibSAzODUgNTI0LjM2IGggMTcgdiAxOCBoIC0xNyB6Ii8+PGcgZmlsbD0ibm9uZSI+PGcgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgc3Ryb2tlLXdpZHRoPSIxLjgiPjxwYXRoIGQ9Im0gMzg3LjUgNTI1LjI2IHYgMTYuMiIgc3Ryb2tlPSIjZTRlN2U0Ii8+PHBhdGggZD0ibSAzOTkuNSA1MjUuMjYgdiAxNi4yIiBzdHJva2U9IiNlNWU3ZTUiLz48L2c+PHBhdGggZD0ibSAzOTMuNSA1MjYuMzYgdiA0IiBzdHJva2U9IiNlNWU3ZTUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxLjciLz48L2c+PHBhdGggZD0ibSAzOTMuNSA1MzUuMzYgdiA0IiBmaWxsPSIjZTRlN2U0IiBzdHJva2U9IiNlNWU3ZTUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxLjciLz48L2c+PC9zdmc+";
     
    32223223/***************************************************************************************************************************************************/
    32233224/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
     3225/* Railway rendering                                                                                                                               */
     3226/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
     3227/***************************************************************************************************************************************************/
     3228way|z18-[railway=rail]::Railway_Way,
     3229way|z18-[railway=light_rail]::Railway_Way,
     3230way|z18-[railway=subway]::Railway_Way,
     3231way|z18-[railway=miniature]::Railway_Way,
     3232way|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/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
    32243269/* Extra rendering for footways/cycleways if not already rendered                                                                                  */
    32253270/*-------------------------------------------------------------------------------------------------------------------------------------------------*/