wiki:Styles/Osmc

Version 3 (modified by *Martin*, 10 years ago) ( diff )

unicersal schema

/*
#!/bin/bash
# bash script to generate the stylesheet

OSMC_CZSK=no

prevLayer=no

echo 'meta {
    title: "OSMC Hiking";
    description: "Highlight marked hiking trails using OSMC tagging schema.";
    version: "0.2.3_2013-11-03";
    author: "Martin Ždila <martin.zdila@freemap.sk>";
}

way::osmc_0 {
        offset: 2;
}
'

index=1

for color in red green blue yellow black brown orange purple white; do
        if test "$OSMC_CZSK" == yes; then
                # make main trails solid
                regexps[0]="^${color}:[^:]*:[^:]+_bar"
                styles[0]="";

                # make all other trails dashed
                regexps[1]="^${color}:[^:]*:[^:]+_(?!bar)"
                styles[1]="     dashes: 8, 4;"
        else
                regexps[0]="^${color}:"
                styles[0]="";
        fi

        for i in $(seq 0 $((${#regexps[*]} - 1))); do
                regexp=${regexps[i]}
                echo "way::osmc_$index {"
                echo "  offset: prop(\"offset\", \"osmc_$((index - 1))\");"
                echo "}"
                echo
                echo "relation[osmc:symbol=~/$regexp/] > way::osmc_$index {"
                if test "$color" == black; then
                        echo "  color: gray;"
                else
                        echo "  color: $color;"
                fi
                echo "  width: 3;"
                echo "  offset: prop(\"offset\") + 4;"
                echo "${styles[i]}"
                echo "}"
                echo

                 ((index++))
        done
done
*/

meta {
    title: "OSMC Hiking";
    description: "Colorize marked hiking trails using OSMC tagging schema.";
    version: "0.2.3_2013-11-03";
    author: "Martin Ždila <martin.zdila@freemap.sk>";
}

way::osmc_0 {
        offset: 2;      
}

way::osmc_1 {
        offset: prop("offset", "osmc_0");
}

relation[osmc:symbol=~/^red:/] > way::osmc_1 {
        color: red;
        width: 3;
        offset: prop("offset") + 4;

}

way::osmc_2 {
        offset: prop("offset", "osmc_1");
}

relation[osmc:symbol=~/^green:/] > way::osmc_2 {
        color: green;
        width: 3;
        offset: prop("offset") + 4;

}

way::osmc_3 {
        offset: prop("offset", "osmc_2");
}

relation[osmc:symbol=~/^blue:/] > way::osmc_3 {
        color: blue;
        width: 3;
        offset: prop("offset") + 4;

}

way::osmc_4 {
        offset: prop("offset", "osmc_3");
}

relation[osmc:symbol=~/^yellow:/] > way::osmc_4 {
        color: yellow;
        width: 3;
        offset: prop("offset") + 4;

}

way::osmc_5 {
        offset: prop("offset", "osmc_4");
}

relation[osmc:symbol=~/^black:/] > way::osmc_5 {
        color: gray;
        width: 3;
        offset: prop("offset") + 4;

}

way::osmc_6 {
        offset: prop("offset", "osmc_5");
}

relation[osmc:symbol=~/^brown:/] > way::osmc_6 {
        color: brown;
        width: 3;
        offset: prop("offset") + 4;

}

way::osmc_7 {
        offset: prop("offset", "osmc_6");
}

relation[osmc:symbol=~/^orange:/] > way::osmc_7 {
        color: orange;
        width: 3;
        offset: prop("offset") + 4;

}

way::osmc_8 {
        offset: prop("offset", "osmc_7");
}

relation[osmc:symbol=~/^purple:/] > way::osmc_8 {
        color: purple;
        width: 3;
        offset: prop("offset") + 4;

}

way::osmc_9 {
        offset: prop("offset", "osmc_8");
}

relation[osmc:symbol=~/^white:/] > way::osmc_9 {
        color: white;
        width: 3;
        offset: prop("offset") + 4;

}

Styles_Osmc-style.mapcss, Styles_Osmc.zip

Note: See TracWiki for help on using the wiki.