wiki:Styles/SlovakiaBicycleRoutes
/*
#!/bin/bash
# bash script that generates the stylesheet

prevLayer=no

echo 'meta {
    title: "Colorize bicycle routes";
    description: "Colorize bicycle routes tagged with tag colour.";
    version: "0.2.4_2013-11-03";
    author: "Martin Ždila <martin.zdila@freemap.sk>";
}

way::bicycle_0 {
        offset: -2;
}
'

index=1

for color in red green blue yellow black brown orange purple white; do
        echo "way::bicycle_$index {"
        echo "  offset: prop(\"offset\", \"bicycle_$((index - 1))\");"
        echo "}"
        echo
        echo "relation[route=bicycle][colour=$color] > way::bicycle_$index {"
        if test "$color" == black; then
                echo "  color: gray;"
        else
                echo "  color: $color;"
        fi
        echo "  width: 4;"
        echo "  offset: prop(\"offset\") - 4;"
        echo "  dashes: 0, 6;"
        echo "  linecap: round;"
        echo "}"
        echo

         ((index++))
done

*/
meta {
    title: "Colorize bicycle routes";
    description: "Colorize bicycle routes tagged with tag colour.";
    version: "0.2.4_2013-11-03";
    author: "Martin Ždila <martin.zdila@freemap.sk>";
}

way::bicycle_0 {
        offset: -2;
}

way::bicycle_1 {
        offset: prop("offset", "bicycle_0");
}

relation[route=~/bicycle|mtb/][colour=red] > way::bicycle_1 {
        color: red;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

way::bicycle_2 {
        offset: prop("offset", "bicycle_1");
}

relation[route=~/bicycle|mtb/][colour=green] > way::bicycle_2 {
        color: green;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

way::bicycle_3 {
        offset: prop("offset", "bicycle_2");
}

relation[route=~/bicycle|mtb/][colour=blue] > way::bicycle_3 {
        color: blue;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

way::bicycle_4 {
        offset: prop("offset", "bicycle_3");
}

relation[route=~/bicycle|mtb/][colour=yellow] > way::bicycle_4 {
        color: yellow;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

way::bicycle_5 {
        offset: prop("offset", "bicycle_4");
}

relation[route=~/bicycle|mtb/][colour=black] > way::bicycle_5 {
        color: gray;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

way::bicycle_6 {
        offset: prop("offset", "bicycle_5");
}

relation[route=~/bicycle|mtb/][colour=brown] > way::bicycle_6 {
        color: brown;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

way::bicycle_7 {
        offset: prop("offset", "bicycle_6");
}

relation[route=~/bicycle|mtb/][colour=orange] > way::bicycle_7 {
        color: orange;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

way::bicycle_8 {
        offset: prop("offset", "bicycle_7");
}

relation[route=~/bicycle|mtb/][colour=purple] > way::bicycle_8 {
        color: purple;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

way::bicycle_9 {
        offset: prop("offset", "bicycle_8");
}

relation[route=~/bicycle|mtb/][colour=white] > way::bicycle_9 {
        color: white;
        width: 4;
        offset: prop("offset") - 4;
        dashes: 0, 6;
        linecap: round;
}

Styles_SlovakiaBicycleRoutes-style.mapcss, Styles_SlovakiaBicycleRoutes.zip

Last modified 11 years ago Last modified on 2013-11-03T11:47:13+01:00
Note: See TracWiki for help on using the wiki.