| Version 3 (modified by , 8 years ago) ( diff ) |
|---|
Description
This style is aimed to users who want to tag public transport routes and stops according to the public transport v2 scheme in JOSM.
It has several features:
- grouping members of one
public_transport=stop_areaby same color - showing differences in names of stop area members (namely
public_transport=stop_positionandpublic_transport=platform) and their respectivepublic_transport=stop_area - highlighting public transport route relations
- mark
public_transport=stop_positionorpublic_transport=platformwithoutpublic_transport=stop_areawith a little warning icon
Code
meta { title: "Public Transport v2"; description: "Highlight important information regarding public transport according to public transport version 2."; version: "1.9_2023-12-28"; author: "Ialokim"; link: "https://josm.openstreetmap.de/wiki/Styles/PublicTransportV2"; watch-modified: true; } meta[lang=de] { title: "Öffentlicher Verkehr v2"; description: "Hebt wichtige Informationen des öffentlichen Verkehrs nach Public Transport Version 2 hervor."; } meta[lang=es] { title: "Transporte Público v2"; description: "Resalta informaciones importantes del transporte público acorde a Public Tranport Version 2."; } /*** Initial text properties ***/ way|z16-[public_transport=platform], node|z16-[public_transport=platform], node|z16-[public_transport=stop_position] { text-color: white; text-opacity: 1.0; font-size: 12; text-halo-radius: 3; text-halo-color: #000000; text-halo-opacity: 0.8; font-weight: bold; } /*** public_transport=platform ***/ /* unclosed way design > tagging error! */ way|z16-[public_transport=platform]!:closed{ width: 10; dashes: none; color: #ffffff; opacity: 1.0; text-position: line } /* area design */ area|z16-[public_transport=platform]{ width: 3; color: #ffffff; fill-color: #ffffff; fill-opacity: 0.3; text-position: center; font-weight: bold; } /* node design */ node|z16-[public_transport=platform] { icon-image: "warning-small.png"; text-anchor-horizontal: right; text-anchor-vertical: center; text-offset-x: 5; text: ""; object-z-index: 1.0; } /* node halo design */ node|z16-[public_transport=platform]::halo { icon-image: none; symbol-shape: square; symbol-fill-color: white; symbol-size: 18; } node|z19-[public_transport=platform]::halo { object-z-index:-1.0; } /*** public_transport=stop_position ***/ /* node design */ node|z16-[public_transport=stop_position] { icon-image: none; text-anchor-horizontal: center; text-anchor-vertical: center; text: ""; object-z-index: 1.0; } node|z19-[public_transport=stop_position] { icon-image: "warning-small.png"; text-anchor-horizontal: right; text-offset-x: 5; } /* node halo design */ node|z16-[public_transport=stop_position]::halo { icon-image: none; symbol-shape: square; symbol-fill-color: white; symbol-size: 18; } node|z19-[public_transport=stop_position]::halo { object-z-index:-1.0; } /*** public_transport=stop_area ***/ /* unclosed way design > tagging error! */ relation|z16-[public_transport=stop_area] > way!:closed { dashes: 10,10; dashes-background-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); } relation|z16-[public_transport=stop_area] > way!:closed:selected { dashes-background-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); } /* area design */ relation|z16-[public_transport=stop_area] > area { color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); } relation|z16-[public_transport=stop_area] > area:selected { color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); } /* node design */ relation[public_transport=stop_area] >[index!=1] node|z16-18 { text: ""; } relation[public_transport=stop_area] >[index=1] node|z16-18 { text: parent_tag(name); } relation[public_transport=stop_area] > node|z19-20[public_transport=stop_position] { text: ""; } relation[public_transport=stop_area] > node|z19-[public_transport=platform], relation[public_transport=stop_area] > node|z21-[public_transport=stop_position], relation[public_transport=stop_area] > area|z16- { text: cond(tag(name)==parent_tag(name),tag(name),concat(tag(name), " | ", parent_tag(name))); } relation[public_transport=stop_area] >[index=1] node|z16-18, relation[public_transport=stop_area] > node|z19-[public_transport=platform], relation[public_transport=stop_area] > node|z21-[public_transport=stop_position], relation[public_transport=stop_area] > area|z16- { text-halo-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); } relation[public_transport=stop_area] >[index=1] node|z16-18, relation[public_transport=stop_area] > node|z19-[public_transport=platform]:selected, relation[public_transport=stop_area] > node|z21-[public_transport=stop_position]:selected, relation[public_transport=stop_area] > area|z16-:selected { text-halo-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); } /* node halo design */ relation[public_transport=stop_area] > node|z16-::halo { symbol-fill-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); } relation[public_transport=stop_area] > node|z16-:selected::halo { symbol-fill-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); } /* node design for transport vehicles (only if has relation) */ relation[public_transport=stop_area] > node|z16-18[public_transport=stop_position], relation[public_transport=stop_area] > node|z16-18[public_transport=platform] { icon-image: none; } relation[public_transport=stop_area] > node|z19-[public_transport=stop_position][bus=yes] { icon-image: "presets/transport/bus.svg"; } relation[public_transport=stop_area] > node|z19-[public_transport=stop_position][tram=yes] { icon-image: "presets/transport/tram.svg"; } relation[public_transport=stop_area] > node|z19-[public_transport=stop_position][light_rail=yes] { icon-image: "presets/transport/railway/light_rail.svg"; } relation[public_transport=stop_area] > node|z19-[public_transport=stop_position][subway=yes] { icon-image: "presets/transport/railway/subway.svg"; } relation[public_transport=stop_area] > node|z19-[public_transport=stop_position][train=yes] { icon-image: "presets/transport/train.svg"; } relation[public_transport=stop_area] > node|z19-[public_transport=platform] { icon-image: "presets/transport/platform.svg"; } /*** Route relations ***/ relation[type=route][route=bus] > way::halo, relation[type=route][route=tram] > way::halo, relation[type=route][route=light_rail] > way::halo, relation[type=route][route=subway] > way::halo, relation[type=route][route=train] > way::halo { object-z-index: -1.0; color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); width: 16; opacity: 0.5; linecap: round; linejoin: round; text-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.7); font-size: 18; text: parent_tag(ref); text-position: line; text-offset-y: 20; } relation[type=route] > way:selected::halo, relation[type=route][route=tram] > way:selected::halo, relation[type=route][route=light_rail] > way:selected::halo, relation[type=route][route=subway] > way:selected::halo, relation[type=route][route=train] > way:selected::halo { color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); text-color: hsb_color(CRC32_checksum(parent_tag("name"))/4294967296.0, 0.9, 0.5); }
Styles_PublicTransportV2-style.mapcss, Styles_PublicTransportV2.zip
Note:
See TracWiki
for help on using the wiki.


