wiki:Styles/ParkingLanes

Version 13 (modified by JeroenHoek, 10 days ago) (diff)

Update for parking:lane type separate, add settings for warnings and condition highlighting.

Parking lanes

Example:

StyleParkingLanes.png (NOZIP)

(data used for image ©OpenStreetMap contributors ODbL)

Code:

meta {
    title: "Parking lanes";
    description: "Parking lanes along roads and parking/stopping restrictions.";
    link: "https://wiki.openstreetmap.org/wiki/Key:parking:lane";
    author: "Sebastian Klemm, Kay Drangmeister, Jeroen Hoek";
    version: "0.14_2021-01-10";
    min-josm-version: "4399";
}

meta[lang=de]
{
    title: "Parkstreifen";
    description: "Parkstreifen/Parkplätze entlang von Straßen und Park-/Halteverbote.";
}

meta[lang=ru]
{
    title: "Парковка вдоль дороги";
    description: "Парковка вдоль дорог/ограничения и запреты у такой парковки";
    link: "https://wiki.openstreetmap.org/wiki/RU:Key:parking:lane";
}

/* Settings. */

setting::show_warnings {
  type: boolean;
  label: tr("Show warning symbols for incompatible tag values");
  default: true;
}

setting::highlight_conditions {
  type: boolean;
  label: tr("Use different colours to highlight values of parking:condition:*");
  default: true;
}

/* Mark the parking:lane types that can have parking:conditional tags. */
way[highway][parking:lane:right=~/^(parallel|perpendicular|diagonal|marked)$/]::parking_lanes_right,
way[highway][parking:lane:both=~/^(parallel|perpendicular|diagonal|marked)$/]::parking_lanes_right
{
    set conditional_type;
}

way[highway][parking:lane:left=~/^(parallel|perpendicular|diagonal|marked)$/]::parking_lanes_left,
way[highway][parking:lane:both=~/^(parallel|perpendicular|diagonal|marked)$/]::parking_lanes_left
{
    set conditional_type;
}

way[highway][parking:lane:right]::parking_lanes_right,
way[highway][parking:lane:both]::parking_lanes_right
{
    z-index: -3;
    linecap: none;
}
way[highway][parking:lane:left]::parking_lanes_left,
way[highway][parking:lane:both]::parking_lanes_left
{
    z-index: -3;
    linecap: none;
}

way[highway][parking:lane:right=parallel]::parking_lanes_right,
way[highway][parking:lane:both=parallel]::parking_lanes_right
{
    width: 3;
    dashes: 10, 2;
}
way[highway][parking:lane:left=parallel]::parking_lanes_left,
way[highway][parking:lane:both=parallel]::parking_lanes_left
{
    width: 3;
    dashes: 10, 2;
}

way[highway][parking:lane:right=perpendicular]::parking_lanes_right,
way[highway][parking:lane:both=perpendicular]::parking_lanes_right
{
    width: 10;
    dashes: 3, 4;
}
way[highway][parking:lane:left=perpendicular]::parking_lanes_left,
way[highway][parking:lane:both=perpendicular]::parking_lanes_left
{
    width: 10;
    dashes: 3, 4;
}

way[highway][parking:lane:right=diagonal]::parking_lanes_right,
way[highway][parking:lane:both=diagonal]::parking_lanes_right
{
    width: 7;
    dashes: 4, 6;
}
way[highway][parking:lane:left=diagonal]::parking_lanes_left,
way[highway][parking:lane:both=diagonal]::parking_lanes_left
{
    width: 7;
    dashes: 4, 6;
}

way[highway][parking:lane:right=marked]::parking_lanes_right,
way[highway][parking:lane:both=marked]::parking_lanes_right
{
    width: 3;
    dashes: 10, 12;
}
way[highway][parking:lane:left=marked]::parking_lanes_left,
way[highway][parking:lane:both=marked]::parking_lanes_left
{
    width: 3;
    dashes: 10, 12;
}

way[highway][parking:lane:right=no_parking]::parking_lanes_right,
way[highway][parking:lane:both=no_parking]::parking_lanes_right
{
    color: orange;
    width: 6;
    dashes: 6, 12;
}
way[highway][parking:lane:left=no_parking]::parking_lanes_left,
way[highway][parking:lane:both=no_parking]::parking_lanes_left
{
    color: orange;
    width: 6;
    dashes: 6, 12;
}

way[highway][parking:lane:right=no_stopping]::parking_lanes_right,
way[highway][parking:lane:both=no_stopping]::parking_lanes_right
{
    color: red;
    width: 6;
    dashes: 6, 12;
}
way[highway][parking:lane:left=no_stopping]::parking_lanes_left,
way[highway][parking:lane:both=no_stopping]::parking_lanes_left
{
    color: red;
    width: 6;
    dashes: 6, 12;
}

way[highway][parking:lane:right=fire_lane]::parking_lanes_right,
way[highway][parking:lane:both=fire_lane]::parking_lanes_right
{
    color: red;
    width: 9;
    dashes: 9, 13;
}
way[highway][parking:lane:left=fire_lane]::parking_lanes_left,
way[highway][parking:lane:both=fire_lane]::parking_lanes_left
{
    color: red;
    width: 9;
    dashes: 9, 13;
}

way[highway][parking:lane:right=separate]::parking_lanes_right,
way[highway][parking:lane:both=separate]::parking_lanes_right
{
    repeat-image: images/separate-flipped.svg;
}
way[highway][parking:lane:left=separate]::parking_lanes_left,
way[highway][parking:lane:both=separate]::parking_lanes_left
{
    repeat-image: images/separate.svg;
}

way[highway][parking:lane:right]::parking_lanes_right,
way[highway][parking:lane:both]::parking_lanes_right
{
    offset: eval(0 - 4 - (prop("width") * 0.5) - (prop("width", "default") * 0.5));
    repeat-image-offset: -8;
    repeat-image-width: 8;
    repeat-image-height: 8;
    repeat-image-spacing: 16;
}

way[highway][parking:lane:left]::parking_lanes_left,
way[highway][parking:lane:both]::parking_lanes_left
{
    offset: eval(4 + (prop("width") * 0.5) + (prop("width", "default") * 0.5));
    repeat-image-width: 8;
    repeat-image-height: 8;
    repeat-image-offset: 8;
    repeat-image-spacing: 16;
}

/* Parking conditions tagged on the way itself only make sense for certain parking:lane types. */
way[highway][parking:condition:right]!.conditional_type::parking_lanes_right,
way[highway][parking:condition:both]!.conditional_type::parking_lanes_right
{
    set warning;
}

way[highway][parking:condition:left]!.conditional_type::parking_lanes_left,
way[highway][parking:condition:both]!.conditional_type::parking_lanes_left
{
    set warning;
}

/* Tags should either document 'both' sides or 'left' and 'right' separately. */
way[highway][parking:condition:both][parking:condition:right]::parking_lanes_right,
way[highway][parking:lane:both][parking:lane:right]::parking_lanes_right
{
    set warning;
}

way[highway][parking:condition:both][parking:condition:left]::parking_lanes_left,
way[highway][parking:lane:both][parking:lane:left]::parking_lanes_left
{
    set warning;
}

way[highway][parking:condition:right=free][setting("highlight_conditions")].conditional_type::parking_lanes_right,
way[highway][parking:condition:both=free][setting("highlight_conditions")].conditional_type::parking_lanes_right
{
    color: #7fff00;
}

way[highway][parking:condition:left=free][setting("highlight_conditions")].conditional_type::parking_lanes_left,
way[highway][parking:condition:both=free][setting("highlight_conditions")].conditional_type::parking_lanes_left
{
    color: #7fff00;
}

way[highway][parking:condition:right=disc][setting("highlight_conditions")].conditional_type::parking_lanes_right,
way[highway][parking:condition:both=disc][setting("highlight_conditions")].conditional_type::parking_lanes_right
{
    color: #1c86ee;
}
way[highway][parking:condition:left=disc][setting("highlight_conditions")].conditional_type::parking_lanes_left,
way[highway][parking:condition:both=disc][setting("highlight_conditions")].conditional_type::parking_lanes_left
{
    color: #1c86ee;
}

way[highway][parking:condition:right=ticket][setting("highlight_conditions")].conditional_type::parking_lanes_right,
way[highway][parking:condition:both=ticket][setting("highlight_conditions")].conditional_type::parking_lanes_right
{
    color: #009999;
}
way[highway][parking:condition:left=ticket][setting("highlight_conditions")].conditional_type::parking_lanes_left,
way[highway][parking:condition:both=ticket][setting("highlight_conditions")].conditional_type::parking_lanes_left
{
    color: #009999;
}

way[highway][parking:condition:right=residents][setting("highlight_conditions")].conditional_type::parking_lanes_right,
way[highway][parking:condition:both=residents][setting("highlight_conditions")].conditional_type::parking_lanes_right
{
    color: #a33600;
}
way[highway][parking:condition:left=residents][setting("highlight_conditions")].conditional_type::parking_lanes_left,
way[highway][parking:condition:both=residents][setting("highlight_conditions")].conditional_type::parking_lanes_left
{
    color: #a33600;
}

way[highway][parking:condition:right=customers][setting("highlight_conditions")].conditional_type::parking_lanes_right,
way[highway][parking:condition:both=customers][setting("highlight_conditions")].conditional_type::parking_lanes_right
{
    color: #ff3399;
}
way[highway][parking:condition:left=customers][setting("highlight_conditions")].conditional_type::parking_lanes_left,
way[highway][parking:condition:both=customers][setting("highlight_conditions")].conditional_type::parking_lanes_left
{
    color: #ff3399;
}

way[highway][parking:condition:right=private][setting("highlight_conditions")].conditional_type::parking_lanes_right,
way[highway][parking:condition:both=private][setting("highlight_conditions")].conditional_type::parking_lanes_right
{
    color: #ff0000;
}
way[highway][parking:condition:left=private][setting("highlight_conditions")].conditional_type::parking_lanes_left,
way[highway][parking:condition:both=private][setting("highlight_conditions")].conditional_type::parking_lanes_left
{
    color: #ff0000;
}

way[highway][parking:condition:right=disabled][setting("highlight_conditions")].conditional_type::parking_lanes_right,
way[highway][parking:condition:both=disabled][setting("highlight_conditions")].conditional_type::parking_lanes_right
{
    color: #ffd800;
}
way[highway][parking:condition:left=disabled][setting("highlight_conditions")].conditional_type::parking_lanes_left,
way[highway][parking:condition:both=disabled][setting("highlight_conditions")].conditional_type::parking_lanes_left
{
    color: #ffd800;
}

way.warning[setting("show_warnings")]::parking_lanes_right
{
    width: 0;
    repeat-image: images/warning-flipped.svg;
    repeat-image-offset: -12;
    repeat-image-width: 16;
    repeat-image-height: 16;
    repeat-image-spacing: 12;
}

way.warning[setting("show_warnings")]::parking_lanes_left
{
    width: 0;
    repeat-image: images/warning.svg;
    repeat-image-offset: 12;
    repeat-image-width: 16;
    repeat-image-height: 16;
    repeat-image-spacing: 12;
}

Styles_ParkingLanes-style.mapcss, Styles_ParkingLanes.zip

Attachments (3)

Download all attachments as: .zip