User:Polderrunner/Maperitive rules/Power tower rules
Jump to navigation
Jump to search
// // Advanced power rules by polderrunner including tower shapes // Version 2.7 // // Added: // fixed layering: higher voltage lines rendered on top of lower voltage // support for minor_distribution substation // // Features: // Tower shapes according to design=* and tower:type=* tags // // Other features as in 'Power' rules (but the present rules may be more up to date) // 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). // Limited support for lines having 5 and 6 circuits and for triple voltage lines (e.g. found in Germany) // 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. Power=portal rendered as small portal tower. // 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. // Plant symbol: thermal (yellow), nuclear (icon), hydro (blue), solar (purple), wind (icon), other or missing (white) // Generator symbol: same colours as plant but only shown at z>=10 // // 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 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") line traction: power=line AND (frequency=16.7 OR frequency=16.67 OR frequency=25) cable hvdc: power=cable AND frequency=0 cable ac: power=cable AND (NOT frequency=0 OR NOT frequency) busbar : line=busbar bay : line=bay properties map-background-color : #ffffff rules target : power plant define min-zoom : 8 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,"coal|gas|oil|biomass|biogas|waste|geothermal") define min-zoom : 7 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 : @isMatch (plant:source,"nuclear") define min-zoom : 7 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 : 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 : 7 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 fill-color : red shape : square fill-opacity : 1 line-color : black line-width : 1 shape-size : 11:5;13:12 draw : shape define min-zoom : 12 font-weight : bold text-color : #444444 text : name text-halo-width : 0 text-offset-vertical : 15 font-size : 11:8;14:10 draw : text target : substation* define min-zoom : 12 fill-color : green fill-opacity : 0.3 if : *area define min-zoom : 14 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 : 9 shape-size : 7:4;10:10;14:16 font-size : 9:10;14:14 draw : text define min-zoom : 7 if : *area define max-zoom : 14 draw : shape elsefor : substation=transmission OR ((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 : 10 shape-size : 9:4;10:6;14:12 font-size : 9:8;14:12 draw : text define min-zoom : 8 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 : 11.5 shape-size : 11:3;14:8 font-size : 9:8;14:12 draw : text define min-zoom : 9.5 if : *area define max-zoom : 15 draw : shape elsefor : substation=minor_distribution define min-zoom : 14 shape-size : 14:2;16:6 font-size : 14:6;16:8 draw : text define min-zoom : 14 if : *area define max-zoom : 15 draw : shape else // any other substation define min-zoom : 13 shape-size : 13:2;14:6 font-size : 11:6;14:8 draw : text define min-zoom : 11.5 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 line-width : 1 fill-color : #aaaaaa for : tower:type=anchor OR tower:type=termination OR tower:type=branch OR tower:type=transposing define line-width : 2 elsefor : tower:type=crossing define shape-aspect : 2 for : NOT design define min-zoom : 12.5 for : design=one-level // Dutch 150 kV one-level tower Almere define shape : custom shape-def : m:-4,0;l:-2,12,-1,29,-17,29,-1,33,0,35,1,33,17,29,1,29,2,12,4,0,0,7;z shape-size : 13:16;16:40;18:160 elsefor : design=two-level OR design=donau // Dutch 380 kV donau tower Rotterdam define shape : custom shape-def : m:-9,0;l:-6,16,-3,71,-30,71,-3,77,-3,92,-30,92,-3,98,0,101,3,98,30,92,3,92,3,77,30,71,3,71,6,16,9,0,0,16;z shape-size : 13:16;16:50;18:200 elsefor : design="two-level;one-level" OR design="donau;one-level" // Dutch 380/110 kV combined donau, one-level tower Zwolle define shape : custom shape-def : m:-11,0;l:-7,14,-4,51,-29,51,-4,58,-3,75,-25,75,-3,80,-2,94,-20,94,-2,98,0,100,2,98,20,94,2,94,3,80,25,75,3,75,4,58,29,51,4,51,7,14,11,0,0,14;z shape-size : 13:20;16:60;18:240 elsefor : design=three-level // Dutch 110 kV three-level tower define shape : custom shape-def : m:-4,0;l:-2,56,-17,56,-2,61,-2,71,-17,71,-2,75,-2,86,-17,86,-2,90,-2,98,0,100,2,98,2,90,17,86,2,86,2,75,17,71,2,71,2,61,17,56,2,56,4,0;z shape-size : 13:20;16:60;18:240 elsefor : design=barrel // Dutch 110 kV barrel tower define shape : custom shape-def : m:-17,0;l:-11,44,-5,124,-28,124,-4,131,-4,149,-34,149,-4,154,-3,172,-26,172,-3,177,-3,197,0,200,3,197,3,177,26,172,3,172,4,154,34,149,4,149,5,131,28,124,5,124,11,44,17,0,0,36;z shape-size : 13:20;16:60;18:240 elsefor : design=four-level // based on three-level tower define shape : custom shape-def : m:-4,0;l:-2,56,-17,56,-2,61,-2,71,-17,71,-2,75,-2,86,-17,86,-2,90,-2,100,-17,100,-2,104,-2,112,0,114,2,112,2,104,17,100,2,100,2,90,17,86,2,86,2,75,17,71,2,71,2,61,17,56,2,56,4,0;z shape-size : 13:20;16:70;18:280 elsefor : design="three-level;one-level" OR design="barrel;one-level" // Dutch 380/110 kV combined three-level, one-level tower Enschede define shape : custom shape-def : m:-14,0;l:-7,58,-6,89,-43,89,-6,97,-5,126,-38,126,-5,133,-4,158,-36,158,-4,165,-3,189,-36,189,-3,196,0,200,3,196,36,189,3,189,4,165,36,158,4,158,5,133,38,126,5,126,6,97,43,89,6,89,7,58,14,0;z shape-size : 13:20;16:70;18:280 elsefor : design=delta // based on two-level delta tower define shape : custom shape-def : m:-6,0;l:-3,21,-13,42,-9,36,0,21,9,36,13,42,3,21,6,0,0,9;z;m:-14,34;l:-11,36,11,36,14,34;z shape-size : 13:16;16:50;18:200 elsefor : design=delta_two-level // Dutch 150 kV two-level delta tower Amsterdam define shape : custom shape-def : m:-6,0;l:-3,25,-14,50,-11,44,0,25,11,44,14,50,3,25,6,0,0,9;z;m:-15,42;l:-12,44,12,44,15,42;z;m:-16,33;l:-13,35,13,35,16,33;z shape-size : 13:16;16:60;18:240 elsefor : design=delta_three-level // Three-level tower Liege define shape : custom shape-def : m:-22,0;l:-13,73,-24,146,-24,200,-20,188,-20,184,-24,169,-20,165,-24,150,-24,146,0,73,24,146,24,150,20,165,24,169,20,184,20,188,24,200,24,146,13,73,22,0,0,73;z;m:-35,146;l:-24,150,24,150,35,146;z;m:-35,165;l:-24,169,24,169,35,165;z;m:-35,184;l:-24,188,24,188,35,184;z shape-size : 13:16;16:60;18:240 elsefor : design=x-frame OR design="x-frame;one-level" OR design="y-frame;one-level" // Danish 400 kV X-frame tower define shape : custom shape-def : m:-20,0;l:-5,66,-19,100,-18,100,0,66,18,100,19,100,5,66,20,0,17,0,0,66,-17,0;z;m:-21,51;l:-21,52,21,52,21,51;z;m:-29,76;l:-29,78,29,78,29,76;z shape-size : 13:16;16:50;18:200 elsefor : design=y-frame // Danish 400 kV y-frame tower define shape : custom shape-def : m:-6,0;l:-3,67,-27,67,-11,70,-23,100,-7,73,0,71,7,73,23,100,11,70,27,67,3,67,6,0;z shape-size : 13:16;16:50;18:200 elsefor : design=triangle OR design=asymmetric // Danish 60 kV triangle tower define shape : custom shape-def : m:-2,0;l:-1,27,-1,33,-7,33,-1,35,-1,41,0,44,1,41,6,39,1,39,1,29,6,27,1,27,2,0;z; shape-size : 13:16;16:50;18:200 elsefor : design=flag // Danish 60 kV angle tower define shape : custom shape-def : m:-5,0;l:-2,53,-2,96,0,100,2,96,2,53,5,0;z;m:0,100;l:10,100,2,96;m:2,89;l:10,84,2,84;m:2,76;l:10,71,2,71;m:2,63;l:10,58,2,58 shape-size : 13:16;16:50;18:200 elsefor : design=h-frame AND (material=wood OR structure=solid) // Icelandic 132 kV h-frame tower define shape : custom shape-def : m:-12,0;l:-11,72,-10,72,-9,0;z;m:9,0;l:10,72,11,72,12,0;z;m:-21,62;l:-21,64,21,64,21,62;z;m:-10,43;l:10,23;m:-10,23;l:10,43 shape-size : 13:16;16:40;18:160 elsefor : design=h-frame // Swedish 400 kV non-guyed 'stolpe' define shape : custom shape-def : m:-24,0;l:-22,95,-31,100,-22,95,-20,95,-18,0;z;m:18,0;l:20,95,22,95,31,100,22,95,24,0;z;m:-43,86;l:-22,95,22,95,43,86;z shape-size : 13:16;16:40;18:160 elsefor : design=guyed_h-frame // Icelandic 132 kv guyed h-frame tower define shape : custom shape-def : m:-54,0;l:-56,16,-38,150,-33,166,-31,150,-49,16;z;m:54,0;l:56,16,38,150,33,166,31,150,49,16;z;m:-66,166;l:-33,176,-32,200,-25,176,25,176,32,200,33,176,66,166;z shape-size : 13:16;16:40;18:160 elsefor : design=h-frame_two-level // based on three-level h-frame tower define shape : custom shape-def : m:-13,0;l:-13,75,-12,84,-11,75,-11,0;z;m:11,0;l:11,75,12,84,13,75,13,0;z;m:-26,54;l:-13,56,13,56,26,54;z;m:-26,69;l:-13,71,13,71,26,69;z shape-size : 13:16;16:50;18:200 elsefor : design=h-frame_three-level // Danish 150/60 kV three-level h-frame tower Aabenraa define shape : custom shape-def : m:-13,0;l:-13,91,-12,100,-11,91,-11,0;z;m:11,0;l:11,91,12,100,13,91,13,0;z;m:-26,54;l:-13,56,13,56,26,54;z;m:-26,69;l:-13,71,13,71,26,69;z;m:-26,85;l:-13,87,13,87,26,85;z shape-size : 13:16;16:60;18:240 elsefor : design=guyed_v-frame // Canadian (Quebec) 735 kV tower define shape : custom shape-def : m:-2,0;l:-7,14,-31,157,-31,171,-26,157,-2,14;z;m:2,0;l:7,14,31,157,31,171,26,157,2,14;z;m:-60,171;l:-35,181,-42,200,-39,200,-26,181,26,181,39,200,42,200,35,181,60,171;z shape-size : 13:16;16:40;18:160 elsefor : design=portal OR power=portal define shape : custom shape-def : m:-10,0;l:-9,24,-9,33,-8,36,-7,33,-7,24,-6,0;z;m:6,0;l:7,24,7,33,8,36,9,33,9,24,10,0;z;m:-9,28;l:-9,29,9,29,9,28;z shape-size : 13:16;16:35;18:140 for : power=portal define shape-size : 13:12;16:25;18:100 elsefor : design=portal_two-level // based on single-level portal define shape : custom shape-def : m:-10,0;l:-9,24,-9,41,-8,44,-7,41,-7,24,-6,0;z;m:6,0;l:7,24,7,41,8,44,9,41,9,24,10,0;z;m:-9,28;l:-9,29,9,29,9,28;z;m:-9,36;l:-9,37,9,37,9,36;z shape-size : 13:16;16:45;18:180 elsefor : design=portal_three-level // based on single-level portal define shape : custom shape-def : m:-10,0;l:-9,24,-9,49,-8,52,-7,49,-7,24,-6,0;z;m:6,0;l:7,24,7,49,8,52,9,49,9,24,10,0;z;m:-9,28;l:-9,29,9,29,9,28;z;m:-9,36;l:-9,37,9,37,9,36;z;m:-9,44;l:-9,45,9,45,9,44;z shape-size : 13:20;16:55;18:220 elsefor : design=bipole // Dutch 380 kV Wintrack tower Pijnacker define shape : custom shape-def : m:-33,0;l:-30,200,-28,200,-25,0;z;m:25,0;l:28,200,30,200,33,0;z;m:-27,115;l:-12,119,-27,131;m:-27,144;l:-12,148,-27,160;m:-27,174;l:-12,178,-27,190;m:27,115;l:12,119,27,131;m:27,144;l:12,148,27,160;m:27,174;l:12,178,27,190; shape-size : 13:20;16:60;18:240 elsefor : design=monopolar AND triple_tower=yes // Danish triple tower NB: shape to be adapted (now using the guyed version) define shape : custom shape-def : m:0,0;l:-6,36,-6,168,0,200,6,168,6,36;z;m:116,0;l:110,36,110,168,116,200,122,168,122,36;z;m:-116,0;l:-122,36,-122,168,-116,200,-110,168,-110,36;z; shape-size : 13:12;16:30;18:120 elsefor : design=monopolar // Danish 400 kV monopolar tower define shape : custom shape-def : m:-2,0;l:-1,24,-1,33,0,36,1,33,1,24,2,0;z shape-size : 13:16;16:40;18:160 elsefor : design=guyed_monopolar AND triple_tower=yes // Icelandic guyed triple tower define shape : custom shape-def : m:0,0;l:-6,36,-6,168,0,200,6,168,6,36;z;m:116,0;l:110,36,110,168,116,200,122,168,122,36;z;m:-116,0;l:-122,36,-122,168,-116,200,-110,168,-110,36;z; shape-size : 13:12;16:30;18:120 elsefor : design=guyed_monopolar // Icelandic guyed mono-tower define shape : custom shape-def : m:0,0;l:-6,36,-6,168,0,200,6,168,6,36;z; shape-size : 13:16;16:40;18:160 else define 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 : 13:2;16:6;18:10 draw : shape define min-zoom : 13.5 text : ref // text-offset-horizontal : 15 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 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 : power=minor_line OR voltage<50000 define min-zoom : 11 line-color : green line-width : 1.4 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,"^90000|^110000|^115000|^120000|^130000|^132000") define min-zoom : 7 line-color : #4488ff line-width : 2 elsefor : @isMatch (voltage,"^138000|^150000|^154000|^161000") define min-zoom : 7 line-color : blue line-width : 2 elsefor : @isMatch (voltage,"^220000|^225000|^230000|^250000") define line-color : #339933 line-width : 3 elsefor : @isMatch (voltage,"^275000|^300000|^315000|^330000|^345000") define line-color : orange line-width : 3 elsefor : @isMatch (voltage,"^380000|^400000|^420000|^500000") define line-color : red line-width : 3 elsefor : @isMatch (voltage,"^1150000|^765000|^750000|^735000") define line-color : yellow line-width : 3 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") 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 draw : line elsefor : @isMatch (cables,"3;6") define line-offset : 2.8 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 : 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 : 3 elsefor : @isMatch (voltage,";220000|;225000|;230000|;250000") define line-color : #44bb44 line-width : 3 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.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 : 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 : 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 : voltage < 50000 define min-zoom : 11 line-color : #44dd22 line-width : 1.5 elsefor : @isMatch (voltage,"^50000|^60000|^63000|^65000|^66000|^69000|^70000|^77000") define min-zoom : 8.5 line-color : black line-width : 1.8 elsefor : @isMatch (voltage,"^90000|^110000|^115000|^120000|^130000|^132000") define min-zoom : 7 line-color : #4488ff line-width : 2 elsefor : @isMatch (voltage,"^138000|^150000|^154000|^161000") define min-zoom : 7 line-color : blue line-width : 2 elsefor : @isMatch (voltage,"^220000|^225000|^230000|^250000") define line-color : #44bb44 line-width : 3 elsefor : @isMatch (voltage,"^275000|^300000|^315000|^330000|^345000") define line-color : orange line-width : 3 elsefor : @isMatch (voltage,"^380000|^400000|^420000|^500000") define line-color : red line-width : 3 else // unknown or missing voltage define min-zoom : 10 line-color : gray line-width : 2 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