meta { title: "ohmygrid-low-density-grid-painting"; description: "A style for fast electrical grid mapping of wide-area transmission networks. Adapted from the 'detailed power grid style' by FLacombe."; author: "Mwiche", "Oh My Grid Initiative"; } /* Settings */ setting::hide_icons { type: boolean; label: tr("Hide icons at low zoom"); default: true; } setting::shrink_nodes { type: boolean; label: tr("Less obtrusive node symbols at low zoom"); default: true; } setting::hide_tagged_waynodes { type: boolean; label: tr("Hide tagged waynodes at low zoom"); default: true; } setting::partial_fill { type: boolean; label: tr("Areas are drawn with fill only around their inner edges"); default: true; } /* Canvas defaults */ canvas { default-points: false; } node { text: auto; } /****************/ /* Node styling */ /****************/ /* Basic power nodes - visible only at z10+ */ node|z10-[power] { set power_node; } node.power_node[power=portal] { icon-image: "presets/power/portal.svg"; } node.power_node[power=tower] { icon-image: "presets/power/tower.svg"; } node.power_node[power=pole] { icon-image: "presets/power/pole.svg"; } node.power_node[power=generator] { icon-image: "presets/power/generator.svg"; } node.power_node[power=heliostat] { icon-image: "presets/power/heliostat.svg"; } node.power_node[power=substation] { icon-image: "presets/power/substation.svg"; } node.power_node[power=transformer] { icon-image: "presets/power/transformer.svg"; } node.power_node[power=terminal] { icon-image: "presets/power/terminal.svg"; } node.power_node[power=switch] { icon-image: "presets/power/switch.svg"; } node.power_node[power=converter] { icon-image: "presets/power/converter.svg"; } node.power_node[power=compensator] { icon-image: "presets/power/compensator.svg"; } node.power_node[power=connection] { icon-image: "presets/power/connection.svg"; } node.power_node[power=insulator] { icon-image: "presets/power/insulator.svg"; } node.power_node { set icon_z17; } /* Specialized power nodes */ node|z10-[power=pole][switch] { icon-image: "presets/power/pole_switch.svg"; } node|z10-[power=pole][transformer=distribution] { icon-image: "presets/power/pole_transformer.svg"; } node|z10-[power=catenary_mast] { icon-image: "presets/power/catenary_mast.svg"; } node|z10-[man_made=street_cabinet][street_cabinet=power] { icon-image: "presets/power/cable_distribution_cabinet.svg"; set icon_z17; } /* Node styling at different zoom levels */ node|z15-[power=portal] { symbol-shape: square; symbol-fill-color: teal; symbol-size: 5; } /* Node styling at different zoom levels */ node|z15-[power=portal] { symbol-shape: square; symbol-fill-color: teal; symbol-size: 5; } node|z-15[power=tower], node|z-15[power=pole] { symbol-shape: square; symbol-size: 3; symbol-fill-opacity: 0; symbol-stroke-opacity: 0; major-z-index: 1.0; } /* Only show unconnected towers at z16+ */ node|z10-30[power=tower]:unconnected { symbol-shape: square; symbol-fill-color: blue; symbol-size: 10; symbol-fill-opacity: 0.7; major-z-index: 1.0; } node|z-16[power=switch] { font-size: 0; symbol-size: 3; } /* Power substation node styling */ node|z18-[power=substation][substation=industrial] { text: "operator"; font-size: 8; symbol-size: 5; color: red; fill-opacity: 0.05; } node|z-18[power=substation][substation=industrial] { text: "operator"; font-size: 0; symbol-size: 3; color: red; fill-opacity: 0.05; } node|z-18[power=substation][substation=minor_distribution] { font-size: 0; symbol-size: 3; color: white; fill-opacity: 0.05; } /* Power generator node styling */ node|z-15[power=generator] { font-size: 0; symbol-shape: square; symbol-fill-color: yellow; symbol-size: 3; symbol-fill-opacity: 0.7; } /* Power transformer node styling */ node|z10-[power=transformer], way|z10-[power=transformer] { icon-size: 8; text: name; text-size: 12; text-position: center; color: cyan; fill-color: cyan; width: 1; } /*****************/ /* Area styling */ /*****************/ /* Dynamic widths for substations */ area|z0-15[power=substation] { width: 10; symbol-size: 3; color: #FFFFFF; fill-opacity: 0.07; } area|z16-19[power=substation] { width: 2; symbol-size: 5; color: #FFFFFF; fill-opacity: 0.1; } area|z20-[power=substation] { width: 4; symbol-size: 6; color: #FFFFFF; fill-opacity: 0.15; } /* Dynamic text sizes for substations */ area|z12-13[power=substation] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 14; font-weight: bold; text-position: center; z-index: 8; } area|z14-16[power=substation] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 16; font-weight: bold; text-position: center; z-index: 8; } area|z17-19[power=substation] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 18; font-weight: bold; text-position: center; z-index: 8; } area|z20-[power=substation] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 20; font-weight: bold; text-position: center; z-index: 8; } /* Dynamic widths for transmission substations */ area|z0-15[power=substation][substation=transmission] { width: 10; color:#DC143C; fill-color:#DC143C; fill-opacity: 0.07; } area|z16-19[power=substation][substation=transmission] { width: 2; color:#DC143C; fill-color:#DC143C; fill-opacity: 0.1; } area|z20-[power=substation][substation=transmission] { width: 4; color:#DC143C; fill-color:#DC143C; fill-opacity: 0.15; } /* Dynamic widths for distribution substations */ area|z0-15[power=substation][substation=distribution] { width: 10; color:#008F11; fill-opacity: 0.07; } area|z16-19[power=substation][substation=distribution] { width: 2; color:#008F11; fill-opacity: 0.1; } area|z20-[power=substation][substation=distribution] { width: 4; color:#008F11; fill-opacity: 0.15; } /* Dynamic widths for industrial areas */ area|z0-15[landuse=industrial] { color: darkorange; width: 1; dashes: 4,4; } area|z16-19[landuse=industrial] { color: darkorange; width: 2; dashes: 4,4; } area|z20-[landuse=industrial] { color: darkorange; width: 3; dashes: 4,4; } /* Dynamic widths for power plants - fixed colors */ way|z0-15[power=plant] { width: 5; color: #33ff00; fill-color: #33ff00; fill-opacity: 0; } area|z0-15[power=plant] { width: 5; color: #33ff00; fill-color: #33ff00; fill-opacity: 0; } way|z16-19[power=plant] { width: 2; color: #33ff00; fill-color: #33ff00; fill-opacity: 0.1; } way|z20-[power=plant] { width: 4; color: #33ff00; fill-color: #33ff00; fill-opacity: 0.15; } /* Dynamic text sizes for power plants */ area|z12-13[power=plant] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 14; font-weight: bold; text-position: center; z-index: 8; } area|z14-16[power=plant] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 16; font-weight: bold; text-position: center; z-index: 8; } area|z17-19[power=plant] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 18; font-weight: bold; text-position: center; z-index: 8; } area|z20-[power=plant] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 20; font-weight: bold; text-position: center; z-index: 8; } /* Power generator area styling */ node|z-13[power=generator] { width: 3; symbol-size: 0; symbol-fill-opacity: 0; } /* Dynamic widths for generators */ way|z0-15[power=generator] { width: 3; color: #FFFF00; fill-color: #FFFF00; symbol-fill-opacity: 0; } way|z16-19[power=generator] { width: 2; color: #FFFF00; fill-color: #FFFF00; fill-opacity: 0.8; } way|z20-[power=generator] { width: 3; color: #FFFF00; fill-color: #FFFF00; fill-opacity: 0.8; } /* Dynamic text sizes for generators */ area|z12-13[power=generator] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 14; font-weight: bold; text-position: center; z-index: 8; } area|z14-16[power=generator] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 16; font-weight: bold; text-position: center; z-index: 8; } area|z17-19[power=generator] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 18; font-weight: bold; text-position: center; z-index: 8; } area|z20-[power=generator] { text: "name"; text-color: black; text-halo-color: white; text-halo-radius: 2; text-halo-opacity: 0.8; font-size: 20; font-weight: bold; text-position: center; z-index: 8; } /* Generator sources area styling */ area|z10-[generator:source=nuclear], area|z10-[generator:source=wind], area|z10-[generator:source=hydro], area|z10-[generator:source=solar], area|z10-[generator:source=coal], area|z10-[generator:source=gas], area|z10-[generator:source=biomass], area|z10-[generator:source=oil] { fill-color: power#eeeeee; } /******************/ /* Line styling */ /******************/ /* Zoom-dependent line widths */ way|z0-15[power=line], way|z0-15[power=minor_line], way|z0-15[power=cable] { width: 4; } way|z16-19[power] { width: 3; } way|z20-[power] { width: 4; } /* Zoom-dependent casing widths */ way|z0-19[power][line=busbar], way|z0-19[power][line=bay] { casing-width: 1; } way|z20-22[power][line=busbar], way|z20-22[power][line=bay] { casing-width: 2; } way|z23-[power][line=busbar], way|z23-[power][line=bay] { casing-width: 3; } /* Multi-circuit line casing width by zoom */ way|z0-19[power=~/line|cable/][cables>3], way|z0-19[power=~/line|cable/][circuits>1], way|z0-19[power=minor_line][cables>3], way|z0-19[power=minor_line][circuits>1] { left-casing-width: 1; z-index: 5; } way|z20-22[power=~/line|cable/][cables>3], way|z20-22[power=~/line|cable/][circuits>1], way|z20-22[power=minor_line][cables>3], way|z20-22[power=minor_line][circuits>1] { left-casing-width: 2; z-index: 5; } way|z23-[power=~/line|cable/][cables>3], way|z23-[power=~/line|cable/][circuits>1], way|z23-[power=minor_line][cables>3], way|z23-[power=minor_line][circuits>1] { left-casing-width: 3; z-index: 5; } /* Basic power lines - visible at all zoom levels */ way[power=portal], way[power=line], way[power=minor_line] { color: power#eeeeee; } way[power=cable] { color: power#eeeeee; dashes: 9,9; } /* Power line text - only at specific zoom levels */ way|z18-[power=line] { text: cables; font-size: 15; text-halo-radius: 2; } /* Power cable styling - basic properties without text */ way[power=cable] { dashes: 2,2; text-halo-radius: 2; } /* Cable text for specific zoom levels only */ way|z18-[power=cable] { text: cables; font-size: 15; text-color: white; text-halo-radius: 2; } way|z18-[power=cable][location=underwater] { text: cables; font-size: 15; text-halo-radius: 2; } /* Power line special types */ way[power=line][line=busbar] { casing-color: #FFD800; } way[power=line][line=bay] { casing-color: lightgray; } /* Missing voltage */ way[power=line][!voltage], way[power=line][voltage=0] { color: white; } /* Voltage-based styling with voltage labels for all lines/cables */ way[power=line][voltage>0][voltage<=132000] { color: #deb887; z-index: 5; } way[power=minor_line][voltage>0][voltage<=132000] { color: #deb887; z-index: 5; } way[power=cable][voltage>0][voltage<=132000] { color: #deb887; z-index: 5; } way|z18-[power=line][voltage>0][voltage<=132000] { text: "voltage"; text-color: black; font-size: 10; font-weight: bold; text-allow-overlap: true; text-opacity: 0.5; text-position: line; } way[power=line][voltage>132001][voltage<=220000] { color: #FF7F50; z-index: 5; } way[power=minor_line][voltage>132001][voltage<=220000] { color: #FF7F50; z-index: 5; } way[power=cable][voltage>132001][voltage<=220000] { color: #FF7F50; z-index: 5; } way|z18-[power=line][voltage>132001][voltage<=220000] { text: "voltage"; text-color: black; font-size: 10; font-weight: bold; text-allow-overlap: true; text-opacity: 0.5; text-position: line; } way[power=line][voltage>220001][voltage<=310000] { color: #cd5c5c; z-index: 5; } way[power=minor_line][voltage>220001][voltage<=310000] { color: #cd5c5c; z-index: 5; } way[power=cable][voltage>220001][voltage<=310000] { color: #cd5c5c; z-index: 5; } way|z18-[power=line][voltage>220001][voltage<=310000] { text: "voltage"; text-color: black; font-size: 10; font-weight: bold; text-allow-overlap: true; text-opacity: 0.5; text-position: line; } way[power=line][voltage>310001][voltage<=550000] { color: #9400D3; z-index: 5; } way[power=minor_line][voltage>310001][voltage<=550000] { color: #9400D3; z-index: 5; } way[power=cable][voltage>310001][voltage<=550000] { color: #9400D3; z-index: 5; } way|z18-[power=line][voltage>310001][voltage<=550000] { text: "voltage"; text-color: black; font-size: 10; font-weight: bold; text-allow-overlap: true; text-opacity: 0.5; text-position: line; } way[power=line][voltage>550001][voltage<=1000000] { color: #00ced1; z-index: 5; } way[power=minor_line][voltage>550001][voltage<=1000000] { color: #00ced1; z-index: 5; } way[power=cable][voltage>550001][voltage<=1000000] { color: #00ced1; z-index: 5; } way|z18-[power=line][voltage>550001][voltage<=1000000] { text: "voltage"; text-color: black; font-size: 10; font-weight: bold; text-allow-overlap: true; text-opacity: 0.5; text-position: line; } /* Circuit voltage coloring */ way[power=line][circuits>1][voltage>0][voltage<=132000] { left-casing-color: #deb887; right-casing-color: #deb887; z-index: 5; } way[power=minor_line][circuits>1][voltage>0][voltage<=132000] { left-casing-color: #deb887; right-casing-color: #deb887; z-index: 5; } way[power=cable][circuits>1][voltage>0][voltage<=132000] { left-casing-color: #deb887; right-casing-color: #deb887; z-index: 5; } way[power=line][circuits>1][voltage>132001][voltage<=220000] { left-casing-color: #FF7F50; right-casing-color: #FF7F50; z-index: 5; } way[power=minor_line][circuits>1][voltage>132001][voltage<=220000] { left-casing-color: #FF7F50; right-casing-color: #FF7F50; z-index: 5; } way[power=cable][circuits>1][voltage>132001][voltage<=220000] { left-casing-color: #FF7F50; right-casing-color: #FF7F50; z-index: 5; } way[power=line][circuits>1][voltage>220001][voltage<=310000] { left-casing-color: #cd5c5c; right-casing-color: #cd5c5c; z-index: 5; } way[power=minor_line][circuits>1][voltage>220001][voltage<=310000] { left-casing-color: #cd5c5c; right-casing-color: #cd5c5c; z-index: 5; } way[power=cable][circuits>1][voltage>220001][voltage<=310000] { left-casing-color: #cd5c5c; right-casing-color: #cd5c5c; z-index: 5; } way[power=line][circuits>1][voltage>310001][voltage<=550000] { left-casing-color: #9400D3; right-casing-color: #9400D3; z-index: 5; } way[power=minor_line][circuits>1][voltage>310001][voltage<=550000] { left-casing-color: #9400D3; right-casing-color: #9400D3; z-index: 5; } way[power=cable][circuits>1][voltage>310001][voltage<=550000] { left-casing-color: #9400D3; right-casing-color: #9400D3; z-index: 5; } way[power=line][circuits>1][voltage>550001][voltage<=1000000] { left-casing-color: #00ced1; right-casing-color: #00ced1; z-index: 5; } way[power=minor_line][circuits>1][voltage>550001][voltage<=1000000] { left-casing-color: #00ced1; right-casing-color: #00ced1; z-index: 5; } way[power=cable][circuits>1][voltage>550001][voltage<=1000000] { left-casing-color: #00ced1; right-casing-color: #00ced1; z-index: 5; } /* Proposed and construction power lines */ way[power=line][proposed=yes], way[power=line][construction=yes] { dashes: 8, 4; opacity: 0.8; } /* Bridge/Tunnel styling for power */ way[power=line][bridge=yes]::bridge_power, way[power=cable][bridge=yes]::bridge_power { major-z-index: 2; object-z-index: -1; width: +4; color: bridge#0000FF; opacity: 0.9; } way[power=line][tunnel=yes]::tunnel_power, way[power=cable][tunnel=yes]::tunnel_power { major-z-index: 2; object-z-index: -1; width: +3; color: tunnel#964B00; opacity: 0.9; } /* Generator sources node styling - visible only at z10+ */ node|z10-[generator:source=nuclear] { icon-image: "presets/power/power_source-nuclear.svg"; set icon_z17; } node|z10-[generator:source=wind] { icon-image: "presets/power/power_source-wind.svg"; set icon_z17; } node|z10-[generator:source=hydro] { icon-image: "presets/power/power_source-water.svg"; set icon_z17; } node|z10-[generator:source=solar] { icon-image: "presets/power/power_source-sun.svg"; set icon_z17; } node|z10-[generator:source=coal] { icon-image: "presets/power/power_source-coal.svg"; set icon_z17; } node|z10-[generator:source=gas] { icon-image: "presets/power/power_source-gas.svg"; set icon_z17; } node|z10-[generator:source=biomass] { icon-image: "presets/power/power_source-biofuel.svg"; set icon_z17; } node|z10-[generator:source=oil] { icon-image: "presets/power/power_source-oil.svg"; set icon_z17; } /* Enhanced visualization for power line attributes */ node|z15-19[power=tower][design] { text: "design"; text-color: black; text-halo-color: white; text-halo-radius: 1; text-offset-y: -15; font-size: 8; } /* Line frequencies only at z11+ */ way|z14-15[power=line][frequency] { text: "frequency"; text-color: white; text-halo-color: black; text-halo-radius: 1; text-offset-y: -8; font-size: 8; } way|z15-[power=line][construction=yes][opening_date] { text: "opening_date"; text-color: black; text-halo-color: white; text-halo-radius: 1; text-offset-y: 8; font-size: 8; } way|z10-[power=line][circuits="2"][voltage~=";"] { text: "voltage"; text-color: yellow; text-halo-color: black; text-halo-radius: 1; text-offset-y: -10; font-size: 9; font-weight: bold; } way|z15-16[power=line][operator] { text: "operator"; text-color: white; text-halo-color: black; text-halo-radius: 1; text-offset-y: 10; font-size: 8; text-position: line; } /* Osmose issue styling */ node[item=7040] { symbol-shape: triangle; symbol-fill-color: brown; symbol-size: 10; symbol-fill-opacity: 1.0; } node[item=7190] { symbol-shape: square; symbol-fill-color: #06470C; symbol-size: 10; symbol-fill-opacity: 1.0; } node[item=8270] { symbol-shape: rectangle; symbol-fill-color: #FF00FF; symbol-size: 10; symbol-fill-opacity: 1.0; } node[item=8280] { symbol-shape: square; symbol-fill-color: #0B6623; symbol-size: 10; symbol-fill-opacity: 1.0; } node[item=8282] { symbol-shape: square; symbol-fill-color: #008F11; symbol-size: 10; symbol-fill-opacity: 1.0; } node[item=9100] { symbol-shape: hexagon; symbol-fill-color: #FFFF00; symbol-size: 10; symbol-fill-opacity: 1.0; } /* GEM Per Country*/ node[Type] { symbol-shape: hexagon; symbol-fill-color:#800080; symbol-size: 12; symbol-fill-opacity: 1.0; } /* WIKIDATA Per Country*/ node[type] { symbol-shape: square; symbol-fill-color:#700070; symbol-size: 12; symbol-fill-opacity: 1.0; } /* Zoom level behaviors for nodes */ node|z-15[setting("hide_icons")].icon_z17!.icon_z0, relation|z-16[type=restriction][setting("hide_icons")] { icon-image: none; } node|z-17[setting("hide_icons")]!.text_z0 { text: none; } way > node|z-15[setting("shrink_nodes")]!:tagged { symbol-shape: none; } node|z-17:tagged { symbol-stroke-color: none; symbol-fill-color: none; text: none; font-size: 0; } /* Area fill settings */ area[setting("partial_fill")] { fill-extent: 15; } area|z-13[setting("partial_fill")] { fill-extent-threshold: 1.0; } area[setting("partial_fill")]:closed2 { fill-extent: 25; fill-extent-threshold: JOSM_pref("draw.area.extent_threshold", 0.5); } relation[boundary=administrative] > way::core_boundary, way[boundary=administrative]::core_boundary { z-index: 2; modifier: false; width: 1; color: boundary#fb0379; dashes: 9,9; } way[boundary=administrative][admin_level=1]::core_boundary, relation[boundary=administrative][admin_level=1] > way::core_boundary, way[boundary=administrative][admin_level=2]::core_boundary, relation[boundary=administrative][admin_level=2] > way::core_boundary { width: 4; }