Generic Coordinates
If there are no geocoordinates in a network, generic coordinates can be created. There are two possibilities:
- igraph (http:/igraph.org/python) (recommended) based on
python-igraph
pycairo
- graphviz (http:/www.graphviz.org) based on
networkx
graphviz
To avoid having to compile C libraries, precompiled wheels are available on https://www.lfd.uci.edu/%7Egohlke/pythonlibs/ (unofficial)
Generically created geocoordinates can then be plotted in the same way as real geocoordinates.
- pandapower.plotting.create_generic_coordinates(net, mg=None, library='igraph', respect_switches=False, geodata_table='bus_geodata', buses=None, overwrite=False)
This function will add arbitrary geo-coordinates for all buses based on an analysis of branches and rings. It will remove out of service buses/lines from the net. The coordinates will be created either by igraph or by using networkx library.
- Parameters:
net (pandapowerNet) – pandapower network
mg (networkx.Graph) – Existing networkx multigraph, if available. Convenience to save computation time.
library (str) – “igraph” to use igraph package or “networkx” to use networkx package
geodata_table (str) – table to write the generic geodatas to
buses (list) – buses for which generic geodata are created, all buses will be used by default
overwrite (bool) – overwrite existing geodata
- Returns:
net - pandapower network with added geo coordinates for the buses
- Example:
net = create_generic_coordinates(net)
Example plot with mv_oberrhein network from the pandapower.networks package as geographical plan (respect_switches=False):
and as structural plan (respect_switches=True):