I'm working on building a GIS for Electric power distribution system. Can someone help me on representing an electric switch( With On/OFF state which will connect /disconnect downstream lines from the network) in QGIS. I want to detect the number of customers who will get affected due to turning off an upstream switch in a power line.

  • how did you implement your network ? pgrouting ? qgis network graph ? what output are you expecting (object list ?, cartography ?) – Hugo Roussaffa - GeoDatup Oct 24 '17 at 7:26
  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Oct 24 '17 at 16:55
  • I have created the spatial light database and created line layer to represent medium voltage lines. By using Networks plugin (Under Vector menu) I have created a Network. Once I created the network, a node layer got automatically created. There I want to place switch feature to represent medium voltage switch. – RMJR Oct 25 '17 at 4:06

According to the help doc of 'Linear interpolation' module of Network plugin

you can set "Flow direction" to '0' for closed switches and to '3' for opened one. Flow direction :

  • ‘0’ : prohibited link
  • ‘1’ : one way link, in the same direction of digitizing
  • ‘2’ : one way link, in the opposite direction of digitizing
  • ‘3’ : two way link

for this use an attribute in your table and set this attribute to flow direction listbox.

I think you can also use 'impassibility' as well.

After that, generate your Linear interpolation raster.


You could use the split tool to split the network line into the section you want to be the 'switch'. Add a new field in the attribute table called 'switch' and put "yes" in it for the new feature. You can then style the layer by the 'switch' column. To turn them on or off you can make them 'one way' as if they were roads.


Probably already solved, but anyway. Switches are represented in different gis for power systems differently. We usually tend to represent them by points with locations or short unroutable lines. First simple approach is just making a short line between line and final electrical node, the other approach is to cut line with buffered point (small circle) and applying no route parameter on this short line creating 2 extra nodes.

Second approach is usually more advisable if you need visible representation of the switch status since points usually make better representation of the switch icon. This approach is more expensive on the database since you have to create trigger that splits network creating 2 more nodes on switch insertion. When trying to run loadflow with this new nodes sometimes there is a problem with convergence of loadflow algorithm, so you need to simplyfy network etc. but that is whole new story altogether.

For qgis solution, second approach still works better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.