User:Polderrunner/Maperitive rules/Power rules
Jump to navigation
Jump to search
// // Advanced power rules by polderrunner // Version 2.6 2014.12.29 // // Added: // Sync'ed to tower rules // // poles rendered // bug fix: wrong line rendering for cables=3;6 // 4 circuit traction lines rendered as two parallel traction lines // support for power=portal as small version of design=portal tower. // basic support for 5 and 6 circuit lines (only fixed combinations rendered) // basic support for German triple-voltage combination lines (not accurate, renders only fixed combinations) // plant symbol: thermal (yellow), nuclear (icon), hydro (blue), solar (purple), wind (icon), other or missing (white) // generator symbol: same colours as plant but shown at higher zooms // // Features: // Colour coded lines and cables according to voltage // Render multi-circuit power lines as multiple parallel lines according to cables tag (and underground cables according to circuits tag) // Dual voltage lines rendered according to cables tag taking semicolon separated values into account (e.g. "cables=6;3") // Hvdc (purple) and traction lines (blue/black) rendered distinctly (not voltage dependent) // Towers are rendered at higher zooms, reference numbers displayed at even higher zoom // Size of substation icons depending on voltage tag. Colours: power=substation (green), power=sub_station (light green), power=station (red) // Transformers and other substation components rendered at high zoom levels // Substations and power plants also rendered as areas // Generator (z>11.5) and power plant (8<z<11.5) symbols rendered according to generator/plant:source. // Colours used: thermal (yellow), nuclear (yellow/black), hydro (blue), wind (wind turbine shape), solar (purple), other or missing (white) // // Note: Non-power features are not rendered (use a web map as background) // // Usage: Download all power=* features from Overpass API for desired area, such as a country (don't try the entire world!). // Example URL to download data for the Netherlands: www.overpass-api.de/api/xapi?*[bbox=3.5,50.75,7.25,54][power=*] // Load map data and apply rules. // // Released under the Creative Commons Attribution-ShareAlike 3.0 License (http://creativecommons.org/licenses/by-sa/3.0/) // features points, areas station : power=station transformer : power=transformer points tower : power=tower OR power=portal pole : power=pole substation point : power=substation OR power=sub_station switch : power=switch converter point: power=converter compensator point: power=compensator generator node : power=generator areas switchgear : power=switchgear converter area: power=converter compensator area: power=compensator substation area : power=substation OR power=sub_station generator : power=generator power plant : power=plant lines line traction: power=line AND (frequency=16.7 OR frequency=16.67 OR frequency=25) line hvdc: power=line AND frequency=0 line triple-voltage : power=line AND @isMatch(voltage,"380000;220000;110000") line ac: (power=line OR power=minor_line) AND (NOT (frequency=0 OR frequency=16.7 OR frequency=16.67 OR frequency=25) OR NOT frequency) AND NOT @isMatch(voltage,"380000;220000;110000") cable hvdc: power=cable AND frequency=0 cable ac: power=cable AND (NOT frequency=g0 OR NOT frequency) busbar : line=busbar bay : line=bay properties map-background-color : #ffffff rules target : power plant define fill-color : gray fill-opacity : 0.5 draw : fill define min-zoom : 11 font-weight : bold text : name text-halo-opacity : 0 font-size : 11:10;14:14 text-offset-vertical : -15 draw : text for : @isMatch (plant:source,"nuclear") define min-zoom : 8 max-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:yellow;m:0,-280;a:280,280,0,280;a:280,280,0,-280;z;f:black;m:0,-45;a:45,45,0,45;a:45,45,0,-45;z;m:72,0;l:240,0;238,40,229,80,208,120,192,150,165,180,120,214,34,65,54,49,67,27;z;m:-72,0;l:-240,0;-238,40,-229,80,-208,120,-192,150,-165,180,-120,214,-34,65,-54,49,-67,27;z;m:38,-63;l:124,-210,66,-234,0,-242,-66,-234,-124,-210,-38,-63,-14,-70,14,-70;z shape-size : 8:10;10:24;12:40 draw : shape elsefor : @isMatch (plant:source,"coal|gas|oil|biomass|biogas|waste|geothermal") define min-zoom : 8 max-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:yellow;m:0,100;l:87,50,87,-50,0,-100,-87,-50,-87,50;z shape-size : 8:6;10:12;12:20 draw : shape elsefor : plant:source=hydro define min-zoom : 8 max-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:blue;m:0,100;l:87,50,87,-50,0,-100,-87,-50,-87,50;z shape-size : 8:6;10:12;12:20 draw : shape elsefor : plant:source=solar define min-zoom : 8 max-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:#8833cc;m:0,100;l:87,50,87,-50,0,-100,-87,-50,-87,50;z shape-size : 8:6;10:12;12:20 draw : shape elsefor : plant:source=wind define min-zoom : 8 max-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:white;m:-5,0;l:-3,132,-13,127,-70,117,-70,118,-13,133,-4,135,-3,136,0,137,0,146,21,200,22,200,6,146,3,137,4,134,4,132,13,127,50,83,49,82,8,123,3,129,5,0;z shape-size : 8:16;10:48;12:100 draw : shape else define min-zoom : 8 max-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:white;m:0,100;l:87,50,87,-50,0,-100,-87,-50,-87,50;z shape-size : 8:6;10:12;12:20 draw : shape target : generator* define min-zoom : 10 font-weight : bold text : name text-halo-opacity : 0 text-offset-vertical : 15 for : generator:type=steam_turbine OR generator:type=gas_turbine OR @isMatch (generator:source,"coal|gas|oil|biomass|biogas|waste|geothermal") define min-zoom : 10 shape : custom shape-def : p:black;pw:1;f:yellow;m:0,100;l:87,50,87,-50,0,-100,-87,-50,-87,50;z shape-size : 10:2;13:8;15:22 draw : shape define min-zoom : 13 font-size : 13:8;14:10 draw : text elsefor : generator:source=nuclear define min-zoom : 10 shape : custom shape-def : p:black;pw:1;f:yellow;m:0,-280;a:280,280,0,280;a:280,280,0,-280;z;f:black;m:0,-45;a:45,45,0,45;a:45,45,0,-45;z;m:72,0;l:240,0;238,40,229,80,208,120,192,150,165,180,120,214,34,65,54,49,67,27;z;m:-72,0;l:-240,0;-238,40,-229,80,-208,120,-192,150,-165,180,-120,214,-34,65,-54,49,-67,27;z;m:38,-63;l:124,-210,66,-234,0,-242,-66,-234,-124,-210,-38,-63,-14,-70,14,-70;z shape-size : 10:4;13:15;14:30;18:60 draw : shape define min-zoom : 13 font-size : 13:8;14:10 draw : text elsefor : generator:source=hydro define min-zoom : 10 shape : custom shape-def : p:black;pw:1;f:blue;m:0,100;l:87,50,87,-50,0,-100,-87,-50,-87,50;z shape-size : 10:2;13:8;15:22 draw : shape define min-zoom : 13 font-size : 13:8;14:10 draw : text elsefor : generator:source=solar define min-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:#8833cc;m:-1,-2;l:-1,2,1,2,1,-2;z shape-size : 12:4;16:15;18:60 // suppress roof mounted solar installations if : *node define min-zoom : 14 shape-size : 14:4;18:15 for : building define min-zoom : 14 shape-size : 14:4;18:15 draw : shape define min-zoom : 13 font-size : 13:8;14:10 draw : text elsefor : generator:source=wind define min-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:white;m:-5,0;l:-3,132,-13,127,-70,117,-70,118,-13,133,-4,135,-3,136,0,137,0,146,21,200,22,200,6,146,3,137,4,134,4,132,13,127,50,83,49,82,8,123,3,129,5,0;z shape-size : 12:10;16:100;18:400 draw : shape else define min-zoom : 11.5 shape : custom shape-def : p:black;pw:1;f:white;m:0,100;l:87,50,87,-50,0,-100,-87,-50,-87,50;z shape-size : 10:2;13:6;15:18 draw : shape define min-zoom : 14 font-size : 14:6;16:10 draw : text define min-zoom : 12 fill-color : #aaaa66 fill-opacity : 0.5 draw : fill target : transformer define min-zoom : 16 line-width : 1 shape : custom shape-def : p:black;pw:2;f:none;m:5,-10;a:10,10,5,10;a:10,10,5,-10;m:-5,-10;a:10,10,-5,10;a:10,10,-5,-10; shape-size : 15.5:12;18:30 draw : shape target : compensator point define min-zoom : 16 shape : circle shape-size : 16.5:4;18:8 fill-color : red line-color : black line-width : 1 draw : shape target : converter area define min-zoom : 14 fill-color : violet fill-opacity : 0.5 draw : fill target : compensator area define min-zoom : 14 fill-color : red fill-opacity : 0.5 draw : fill target : station // this is deprecated so use warning colour define min-zoom : 12 fill-color : green fill-opacity : 0.3 draw : fill define min-zoom : 9.0 fill-color : red shape : square fill-opacity : 1 line-color : black line-width : 1 font-weight : bold text-color : #444444 text : name text-halo-width : 0 text-offset-vertical : 15 shape-size : 11:5;13:12 font-size : 11:8;14:10 draw : text draw : shape target : substation* define min-zoom : 12 fill-color : green fill-opacity : 0.3 draw : fill define shape : square fill-color : #66cc66 fill-opacity : 1 line-color : black line-width : 1 font-weight : bold text-color : #444444 text : name text-halo-width : 0 text-offset-vertical : 15 for : power=sub_station define fill-color : #88ff44 for : (NOT substation=transition) AND @isMatch (voltage,"^275000|^300000|^315000|^330000|^345000|^380000|^400000|^420000|^500000|^1150000|^765000|^750000|^735000") // large transmission substation define min-zoom : 7 shape-size : 7:4;10:10;14:16 font-size : 9:10;14:14 draw : text if : *area define max-zoom : 14 draw : shape elsefor : (NOT substation=transition) AND @isMatch (voltage,"^90000|^110000|^115000|^120000|^130000|^132000|^138000|^150000|^154000|^161000|^220000|^225000|^230000|^250000") // smaller transmission substation define min-zoom : 8 shape-size : 9:4;10:6;14:12 font-size : 9:8;14:12 draw : text if : *area define max-zoom : 14 draw : shape elsefor : (NOT substation=transition) AND @isMatch(voltage,"^50000|^60000|^63000|^65000|^66000|^69000|^70000|^77000") // larger distribution substation define min-zoom : 10 shape-size : 11:3;14:8 font-size : 9:8;14:12 draw : text if : *area define max-zoom : 15 draw : shape else // any other substation define min-zoom : 12 shape-size : 13:2;14:6 font-size : 11:6;14:8 draw : text if : *area define max-zoom : 15 draw : shape target : switchgear define min-zoom : 12 fill-color : green fill-opacity : 0.5 draw : fill target : tower* define min-zoom : 12.5 shape : custom shape-def : m:-1,1;l:1,1,1,-1,-1,-1,-1,1,1,-1;m:-1,-1;l:1,1 shape-size : 13:2;16:6;18:10 line-width : 1 fill-color : white draw : shape define min-zoom : 13.5 text : ref text-offset-horizontal : 0 text-offset-vertical : 15 font-size : 10 font-weight : bold text-halo-opacity : 0 draw : text target : switch define min-zoom : 16 line-width : 2 shape : diamond shape-size : 16.0:3;16.9:4 fill-color : red draw : shape target : line traction // dedicated traction power lines, mixed 16.7 and 50 Hz lines rendered as 50 Hz lines define min-zoom : 9 line-color : black line-width : 3 for : cables >= 6 define line-offset : 1.8 line-offset-sides : both draw : line define line-width : 1 line-color : #aaccff draw : line else draw : line define line-width : 1 line-color : #aaccff draw : line target : line hvdc // dc power lines define line-color : #cc44aa for : voltage=0 // hvdc electrode line define line-width : 1.6 else // hvdc pole line define line-width : 3.2 draw : line target : line triple-voltage // only cater for German combinations so far (380/220/110 kV), assume default combinations (e.g. 2x380, 2x220, 2x110 for cables=18) for : cables<=9 OR (NOT cables) OR circuits=3 define line-color : red line-width : 3 line-offset : 3.6 line-offset-sides : left draw : line define line-color : #339933 line-width : 2.5 line-offset : 0 draw : line define line-color : #4488ff line-width : 1.6 line-offset : 3.6 line-offset-sides : right draw : line elsefor : cables>=10 OR cables<=12 OR cables="2;1;1" OR cables="1;2;1" or cables="1;1;2" OR circuits=4 define line-color : red line-width : 3 line-offset : 5.4 line-offset-sides : left draw : line define line-offset : 1.8 draw : line define line-color : #339933 line-width : 2.5 line-offset : 1.8 line-offset-sides : right draw : line define line-color : #4488ff line-width : 1.6 line-offset : 5.4 draw : line elsefor : (cables>12 AND cables<=15) OR cables="6;3;6" OR cables="6;6;3" OR cables="3;6;6" OR circuits=5 define line-color : red line-width : 3 line-offset : 7.2 line-offset-sides : left draw : line define line-offset : 3.6 draw : line define line-color : #339933 line-width : 2.5 line-offset : 0 draw : line define line-color : #339933 line-offset : 3.6 line-offset-sides : right draw : line define line-color : #4488ff line-width : 1.6 line-offset : 7.2 line-offset-sides : right draw : line for : cables>=16 OR cables="6;3;9" OR cables="6;6;6" OR cables="12;3;3" OR circuits>=6 define line-color : red line-width : 3 line-offset : 9.0 line-offset-sides : left draw : line define line-offset : 5.4 draw : line define line-color : #339933 line-width : 2.5 line-offset : 1.8 line-offset-sides : both draw : line define line-color : #4488ff line-width : 1.6 line-offset : 5.4 line-offset-sides : right draw : line define line-offset : 9.0 draw : line target : line ac // normal ac power lines // first deal with the primary voltage circuits for : @isMatch (voltage,"^1150000|^765000|^750000|^735000") define line-color : yellow line-width : 3 elsefor : @isMatch (voltage,"^380000|^400000|^420000|^500000") define line-color : red line-width : 3 elsefor : @isMatch (voltage,"^275000|^300000|^315000|^330000|^345000") define line-color : orange line-width : 2 elsefor : @isMatch (voltage,"^220000|^225000|^230000|^250000") define line-color : #339933 line-width : 2 elsefor : @isMatch (voltage,"^138000|^150000|^154000|^161000") define min-zoom : 7 line-color : blue line-width : 1.6 elsefor : @isMatch (voltage,"^90000|^110000|^115000|^120000|^130000|^132000") define min-zoom : 7 line-color : #4488ff line-width : 1.6 elsefor : @isMatch (voltage,"^50000|^60000|^63000|^65000|^66000|^69000|^70000|^77000") define min-zoom : 8.5 line-color : black line-width : 1.6 elsefor : power=minor_line OR voltage<50000 define min-zoom : 11 line-color : green line-width : 1.4 else // unknown voltage define min-zoom : 8.5 line-width : 1.6 line-color : gray for : line=bay OR line=busbar define min-zoom : 13 for : @isMatch (voltage,"^220000|^225000|^230000|^250000|^275000|^300000|^315000|^330000|^345000|^380000|^400000|^420000|^500000|^1150000|^765000|^750000|^735000") // cables=8 occasionally used for two-circuit lines having reduced magnetic field for : (cables=6 OR cables=8 OR circuits=2) NOT @isMatch (voltage,";") define line-offset : 1.8 line-offset-sides : left draw : line define line-offset-sides : right draw : line elsefor : (cables=6 OR cables=8 OR @isMatch(cables,"3;3") OR circuits=2) AND @isMatch (voltage,";") define line-offset : 1.8 line-offset-sides : left draw : line elsefor : (cables=9 OR circuits=3) AND NOT @isMatch (voltage,";") draw : line define line-offset : 3.6 line-offset-sides : both draw : line elsefor : cables=7 OR @isMatch (cables,"3;6") define line-offset : 3.6 line-offset-sides : left draw : line elsefor : (cables=9 OR @isMatch (cables,"6;3") OR circuits=3) AND @isMatch (voltage,";") draw : line define line-offset : 3.6 line-offset-sides : left draw : line elsefor : (cables=10 OR cables=12 OR circuits=4) AND NOT @isMatch (voltage,";") define line-offset : 1.8 line-offset-sides : both draw : line define line-offset : 5.4 line-offset-sides : both draw : line elsefor : @isMatch(cables,"9;3") define line-offset : 1.8 line-offset-sides : both draw : line define line-offset : 5.4 line-offset-sides : left draw : line elsefor : @isMatch(cables,"3;9") define line-offset : 5.4 line-offset-sides : left draw : line elsefor : (cables=10 OR cables=12 OR @isMatch(cables,"6;6") OR circuits=4) AND @isMatch (voltage,";") define line-offset : 1.8 line-offset-sides : left draw : line define line-offset : 5.4 line-offset-sides : left draw : line elsefor : (cables=13 OR cables=15 OR circuits=5) AND NOT @isMatch (voltage,";") draw : line define line-offset : 3.6 line-offset-sides : both draw : line define line-offset : 7.2 line-offset-sides : both draw : line elsefor : (cables=13 OR cables=15 OR @isMatch(cables,"9;6") OR @isMatch(cables,"6;9") OR circuits=5) AND @isMatch (voltage,";") draw : line define line-offset : 3.6 line-offset-sides : left draw : line define line-offset : 7.2 line-offset-sides : left draw : line elsefor : (cables>=16 OR circuits>=6) AND NOT @isMatch (voltage,";") define line-offset : 1.8 line-offset-sides : both draw : line define line-offset : 5.4 line-offset-sides : both draw : line define line-offset : 9.0 line-offset-sides : both draw : line elsefor : (cables>=16 OR @isMatch(cables,"9;9") OR @isMatch(cables,"6;12") OR @isMatch(cables,"12;6") OR circuits>=6) AND @isMatch (voltage,";") define line-offset : 1.8 line-offset-sides : left draw : line define line-offset : 5.4 line-offset-sides : left draw : line define line-offset : 9.0 line-offset-sides : left draw : line elsefor : @isMatch (voltage,";") // two voltages but unrecognised cables value or cables tag missing, default to 3+3 define line-offset : 1.8 line-offset-sides : left draw : line else // cables=3 or unrecognised value or cables tag missing, assume single circuit draw : line else for : (cables=6 OR cables=8 OR circuits=2) NOT @isMatch (voltage,";") define line-offset : 1.4 line-offset-sides : left draw : line define line-offset-sides : right draw : line elsefor : (cables=6 OR cables=8 OR @isMatch(cables,"3;3") OR circuits=2) AND @isMatch (voltage,";") define line-offset : 1.4 line-offset-sides : left draw : line elsefor : (cables=9 OR circuits=3) AND NOT @isMatch (voltage,";") draw : line define line-offset : 2.8 line-offset-sides : both elsefor : @isMatch (cables,"3;6") define line-offset : 2.8 line-offset-sides : left draw : line draw : line elsefor : (cables=9 OR @isMatch(cables,"6;3") OR circuits=3) AND @isMatch (voltage,";") draw : line define line-offset : 2.8 line-offset-sides : left draw : line elsefor : (cables=10 OR cables=12 OR circuits=4) AND NOT @isMatch (voltage,";") define line-offset : 1.4 line-offset-sides : both draw : line define line-offset : 4.2 line-offset-sides : both draw : line elsefor : @isMatch(cables,"9;3") define line-offset : 1.4 line-offset-sides : both draw : line define line-offset : 4.2 line-offset-sides : left draw : line elsefor : @isMatch(cables,"3;9") define line-offset : 4.2 line-offset-sides : left draw : line elsefor : (cables=10 OR cables=12 OR @isMatch(cables,"6;6") OR circuits=4) AND @isMatch (voltage,";") define line-offset : 1.4 line-offset-sides : left draw : line define line-offset : 4.2 line-offset-sides : left draw : line elsefor : (cables=13 OR cables=15 OR circuits=5) AND NOT @isMatch (voltage,";") draw : line define line-offset : 2.8 line-offset-sides : both draw : line define line-offset : 5.6 line-offset-sides : both draw : line elsefor : (cables=13 OR cables=15 OR @isMatch(cables,"9;6") OR @isMatch(cables,"6;9") OR circuits=5) AND @isMatch (voltage,";") draw : line define line-offset : 2.8 line-offset-sides : left draw : line define line-offset : 5.6 line-offset-sides : left draw : line elsefor : (cables>=16 OR @isMatch(cables,"9;9") OR @isMatch(cables,"6;12") OR @isMatch(cables,"12;6") OR circuits>=6) AND NOT @isMatch (voltage,";") define line-offset : 1.4 line-offset-sides : both draw : line define line-offset : 4.2 line-offset-sides : both draw : line define line-offset : 7.0 line-offset-sides : both draw : line elsefor : (cables>=16 OR circuits>=6) AND @isMatch (voltage,";") define line-offset : 1.4 line-offset-sides : left draw : line define line-offset : 4.2 line-offset-sides : left draw : line define line-offset : 7.0 line-offset-sides : left draw : line elsefor : @isMatch (voltage,";") define line-offset : 1.4 line-offset-sides : left draw : line else // cables=3 or unrecognised value or cables tag missing, assume single circuit draw : line // now deal with the secondary voltage circuits for : @isMatch (voltage,";380000|;400000|;420000|;500000") define line-color : red line-width : 3 elsefor : @isMatch (voltage,";275000|;300000|;315000|;330000|;345000") define line-color : orange line-width : 2 elsefor : @isMatch (voltage,";220000|;225000|;230000|;250000") define line-color : #44bb44 line-width : 2 elsefor : @isMatch (voltage,";138000|;150000|;154000|;161000") define min-zoom : 7 line-color : blue line-width : 1.6 elsefor : @isMatch (voltage,";90000|;110000|;115000|;120000|;130000|;132000") define min-zoom : 7 line-color : #4488ff line-width : 1.6 elsefor : @isMatch (voltage,";50000|;60000|;63000|;65000|;66000|;69000|;70000|;77000") define // min-zoom : 8.5 line-color : black line-width : 1.6 elsefor : @isMatch (voltage,";") // there is a second voltage but it is not recognised define min-zoom : 8.5 line-color : gray line-width : 1.4 for : @isMatch (voltage,";220000|;225000|;230000|;250000|;275000|;300000|;315000|;330000|;345000|;380000|;400000|;420000|;500000") for : cables=6 OR cables=8 OR @isMatch(cables,"3;3") OR circuits=2 define line-offset : 1.8 line-offset-sides : right draw : line elsefor : cables=7 OR @isMatch(cables,"3;6") define // bug? this line is necessary to prevent left offset line-offset : 0 draw : line define line-offset : 3.6 line-offset-sides : right draw : line elsefor : cables=9 OR @isMatch(cables,"6;3") OR circuits=3 define line-offset : 3.6 line-offset-sides : right draw : line elsefor : @isMatch(cables,"9;3") define line-offset : 5.4 line-offset-sides : right draw : line elsefor : @isMatch(cables,"3;9") define line-offset : 1.8 line-offset-sides : both draw : line define line-offset : 5.4 line-offset-sides : right draw : line elsefor : cables=10 OR cables=12 OR @isMatch(cables,"6;6") OR circuits=4 define line-offset : 1.8 line-offset-sides : right draw : line define line-offset : 5.4 line-offset-sides : right draw : line elsefor : cables=13 OR cables=15 OR @isMatch(cables,"9;6") OR @isMatch(cables,"6;9") OR circuits=5 define line-offset : 3.6 line-offset-sides : right draw : line define line-offset : 7.2 line-offset-sides : right draw : line elsefor : cables>=16 OR @isMatch(cables,"9;9") OR @isMatch(cables,"6;12") OR @isMatch(cables,"12;6") OR circuits>=6 define line-offset : 1.8 line-offset-sides : right draw : line define line-offset : 5.4 line-offset-sides : right draw : line define line-offset : 9.0 line-offset-sides : right draw : line else // unrecognised cables value or cables tag missing. Default to 3+3 define line-offset : 1.8 line-offset-sides : right draw : line elsefor : @isMatch (voltage,";") for : cables=6 OR cables=8 OR @isMatch(cables,"3;3") OR circuits=2 define line-offset : 1.6 line-offset-sides : right draw : line elsefor : cables=7 OR @isMatch (cables,"3;6") define // bug? this line is necessary to prevent left offset line-offset : 0 draw : line define line-offset : 3.0 line-offset-sides : right draw : line elsefor : cables=9 OR @isMatch(cables,"6;3") OR circuits=3 define line-offset : 3.0 line-offset-sides : right draw : line elsefor : @isMatch (cables,"9;3") define line-offset : 4.2 line-offset-sides : right draw : line elsefor : @isMatch (cables,"3;9") define line-offset : 1.4 line-offset-sides : both draw : line define line-offset : 4.2 line-offset-sides : right draw : line elsefor : cables=10 OR cables=12 OR @isMatch(cables,"6;6") OR circuits=4 define line-offset : 1.6 line-offset-sides : right draw : line define line-offset : 4.4 line-offset-sides : right draw : line elsefor : cables=13 OR cables=15 OR @isMatch(cables,"9;6") OR @isMatch(cables,"6;9") OR circuits=5 define line-offset : 2.8 line-offset-sides : right draw : line define line-offset : 5.6 line-offset-sides : right draw : line elsefor : cables>=16 OR @isMatch(cables,"9;9") OR @isMatch(cables,"6;12") OR @isMatch(cables,"12;6") OR circuits>=6 define line-offset : 1.4 line-offset-sides : right draw : line define line-offset : 4.2 line-offset-sides : right draw : line define line-offset : 7.0 line-offset-sides : right draw : line else // unrecognised cables value or cables tag missing. Default to 3+3 define line-offset : 1.6 line-offset-sides : right draw : line target : cable hvdc define line-style : dot line-color : #cc44aa for : voltage=0 // hvdc electrode cable define line-width : 1.6 else // hvdc pole cable define line-width : 3.2 draw : line target : cable ac // ac cables for : frequency=16.67 OR frequency=16.7 OR frequency=25 stop define line-style : dot for : @isMatch (voltage,"^380000|^400000|^420000|^500000") define line-color : red line-width : 3 elsefor : @isMatch (voltage,"^275000|^300000|^315000|^330000|^345000") define line-color : orange line-width : 2.5 elsefor : @isMatch (voltage,"^220000|^225000|^230000|^250000") define line-color : #44bb44 line-width : 2.5 elsefor : @isMatch (voltage,"^138000|^150000|^154000|^161000") define min-zoom : 7 line-color : blue line-width : 2 elsefor : @isMatch (voltage,"^90000|^110000|^115000|^120000|^130000|^132000") define min-zoom : 7 line-color : #4488ff line-width : 2 elsefor : @isMatch (voltage,"^50000|^60000|^63000|^65000|^66000|^69000|^70000|^77000") define min-zoom : 8.5 line-color : black line-width : 1.8 elsefor : voltage < 50000 define min-zoom : 11 line-color : #44dd22 line-width : 1.5 else // unknown or missing voltage define min-zoom : 10 line-color : gray line-width : 1.5 for : @isMatch (voltage,"^220000|^225000|^230000|^250000|^275000|^300000|^315000|^330000|^345000|^380000|^400000|^420000|^500000") for : circuits=2 define line-offset : 1.8 line-offset-sides : both draw : line elsefor : circuits=3 draw : line define line-offset : 3.6 line-offset-sides : both draw : line elsefor : circuits>=4 define line-offset : 1.8 line-offset-sides : both draw : line define line-offset : 5.4 line-offset-sides : both draw : line else draw : line else for : circuits=2 define line-offset : 1.4 line-offset-sides : left draw : line define line-offset-sides : right draw : line elsefor : circuits=3 draw : line define line-offset : 2.8 line-offset-sides : left draw : line define line-offset-sides : right draw : line elsefor : circuits>=4 define line-offset : 1.4 line-offset-sides : both draw : line define line-offset : 4.2 line-offset-sides : both draw : line else draw : line target : pole define min-zoom : 15 line-width: 1 shape : custom shape-def : m:-1,1;l:1,1,1,-1,-1,-1,-1,1,1,-1;m:-1,-1;l:1,1;z shape-size : 15:2;16:4;18:6 draw : shape target : power minor line define min-zoom : 11 line-color : green line-width : 1.4 draw : line target : busbar define min-zoom : 16 line-width : 5.5 line-color : white draw : line target : bay define min-zoom : 16 line-width : 5.5 line-color : white line-style : dot draw : line