wiki:Styles/DiscGolfCourse

Disc Golf Course

Description

I made this style to simplify tagging of disc golf courses in JOSM. With this style, mapping tees, baskets, holes, and other elements of a disc golf course become more intuitive and efficient. The clear visual representation and use of symbols and colors hopefully makes mapping easier.

The style tries to catch common mapping pitfalls as found on https://wiki.openstreetmap.org/wiki/Tag:leisure%3Ddisc_golf_course

  • Using disc_golf=pin instead of disc_golf=basket.
  • Using golf=* anywhere on a disc golf course
  • Using ref=* somewhere else than on hole.
  • Using name=* on every hole instead or additionally to ref=* to force a rendering. (https://wiki.openstreetmap.org/wiki/Tagging_for_the_renderer)
  • Using landuse=* or natural=* to indicate its surface. Use surface=* instead.

User Settings

The check if golf=* is used anywhere can be deactivated through the mappaint settings (ALT-SHIFT-M and in the sidebar right-click on the style)

Suggestions possible at

Code

meta {
    title: "Disc Golf Course Testing";
    version: "0.8_2024-03-21";
    description: "Colouring and icons for a Disc Golf Course to make mapping it easier.";
    icon:"DiscGolfCourse.svg";
    author: "Negreheb";
    link: "https://josm.openstreetmap.de/wiki/Styles/DiscGolfCourse";
}

meta[lang=de] {
    title: "Disc Golf Course";
    description: "Einfärbungen und Symbole für einen Disc-Golf-Kurs, um das Mappen zu erleichtern.";
    link: "https://josm.openstreetmap.de/wiki/De:Styles/DiscGolfCourse";
}

/* ------------------------------------------------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------------------------------------------------ */

/**********************************************/
/*              Create mappaint user settings */
/**********************************************/

setting::using_golf {
    type: boolean;
    label: tr("Check if golf=* is used at all");
    default: true;
}

/**********************************************/
/*                            General setting */
/**********************************************/

node[disc_golf=tee]{
    icon-image: "tee.svg";
    icon-width: 75;
    icon-offset-x: 10;
    symbol-stroke-color: #FFC800;
    text: auto;
}

node[disc_golf=basket]{
    icon-image: "basket2.svg";
    icon-width: 50;
    icon-offset-y: -28;
    icon-offset-x: 1;
    text: auto;
}

way[disc_golf=hole]{
    text: "ref";
    font-size: 20;
    width: 25;
    opacity: 0.2;
    left-casing-color: black;
    left-casing-width: 2;
    left-casing-dashes: 0;
    left-casing-opacity: 0.7;
    right-casing-color: black;
    right-casing-width: 2;
    right-casing-opacity: 0.7;
    right-casing-dashes: 0;
}

node[disc_golf=drop_zone]{
    text: eval("DZ");
    text-color: orange;
    font-size: 10;
    casing-width: 10;
    symbol-size: 20;
    symbol-shape: circle;
    symbol-fill-color: orange;
    symbol-fill-opacity: 0.5;
}

/* If mando is tagged to an existing node like natural=tree, it will not get rendered */
/* But the text will appear next to it */
*[disc_golf=mando]{
    color: red;
        width: 5;
        opacity: 0.8;
        text: eval("Mando");
    text-color: red;
    font-weight: bold;
    font-size: 15;
    symbol-size: 20;
    symbol-shape: triangle;
    symbol-fill-color: red;
    symbol-fill-opacity: 0.5;
}

/* If mando is a way, offset the text */
way[disc_golf=mando]{
        text-offset-y: 10;
}

area[disc_golf=out_of_bounds]{
    fill-color: red;
    text: eval("OB");
    text-color: red;
    font-weight: bold;
    font-size: 15;
}

/**********************************************/
/*                            Common pitfalls */
/**********************************************/

/* ************** disc_golf=pin instead of basket */
node[disc_golf=pin]{
    text: eval("Use basket");
    text-color: purple;
    font-size: 20;
    font-weight: bold;
    color: purple;
    width: 30;
    opacity: 1;
    dashes: 0;
    symbol-size: 40;
    symbol-shape: circle;
    symbol-fill-color: purple;
}

/* ************** Catch a name on an hole */
way[disc_golf=hole][name]{
    text: eval("NO NAME ON HOLE");
    text-color: purple;
    font-size: 20;
    font-weight: bold;
    text-offset-y: 30;
}

/* ************** Catch everything tagged with golf=* */
*[golf][setting("using_golf")]{
    color: purple;
    width: 30;
    opacity: 1;
    dashes: 0;
    symbol-size: 40;
    symbol-shape: circle;
    symbol-fill-color: purple;
}

Styles_DiscGolfCourse-style.mapcss, Styles_DiscGolfCourse.zip

Last modified 7 weeks ago Last modified on 2024-03-21T11:28:50+01:00

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.