Transforming network geodata formats

Geodata in pandapower can be stored in different formats.

pandapower.plotting.geo.convert_gis_to_geodata(net, node_geodata=True, branch_geodata=True)

Extracts information on bus and line geodata from the geometries of a geopandas geodataframe.

Parameters:
  • net (pandapowerNet) – The net for which to convert the geodata

  • node_geodata (bool, default True) – flag if to extract x and y values for bus geodata

  • branch_geodata (bool, default True) – flag if to extract coordinates values for line geodata

Returns:

No output.

pandapower.plotting.geo.convert_geodata_to_gis(net, epsg=31467, node_geodata=True, branch_geodata=True, remove_xy=False)

Transforms the bus and line geodata of a net into a geopandas geodataframe with the respective geometries.

Parameters:
  • net (pandapowerNet) – The net for which to convert the geodata

  • epsg (int, default 4326 (= WGS84)) – current epsg projection

  • node_geodata (bool, default True) – flag if to transform the bus geodata table

  • branch_geodata (bool, default True) – flag if to transform the line geodata table

  • remove_xy – flag if to remove x,y and coords columns from geodata tables

Returns:

No output.

pandapower.plotting.geo.convert_gis_to_geojson(net: pandapowerNet, delete: bool = True) None

Transforms the bus and line geodataframes of a net into a geojson object.

Parameters:
  • net (pandapowerNet) – The net for which to convert the geodataframes

  • delete (bool, default True) – If True, the geodataframes are deleted after conversion

Returns:

No output.

pandapower.plotting.geo.convert_epsg_bus_geodata(net, epsg_in=4326, epsg_out=31467)

Converts bus geodata in net from epsg_in to epsg_out

Parameters:
  • net (pandapowerNet) – The pandapower network

  • epsg_in (int, default 4326 (= WGS84)) – current epsg projection

  • epsg_out (int, default 31467 (= Gauss-Krüger Zone 3)) – epsg projection to be transformed to

Returns:

net - the given pandapower network (no copy!)

pandapower.plotting.geo.convert_crs(net: pandapowerNet, epsg_in=4326, epsg_out=31467)

This function works for pandapowerNet and pandapipesNet. Documentation will refer to names from pandapower. Converts bus and line geodata in net from epsg_in to epsg_out if GeoDataFrame data is present convert_geodata_to_gis should be used to update geometries after crs conversion

Parameters:
  • net (pandapowerNet|pandapipesNet) – The pandapower network

  • epsg_in (int, default 4326 (= WGS84)) – current epsg projection

  • epsg_out (int, default 31467 (= Gauss-Krüger Zone 3)) – epsg projection to be transformed to

Returns:

net - the given pandapower network (no copy!)

All bus and lines of a network can be dumped to geojson, including all of their properties from bus,`res_bus`, line and res_line tables.

pandapower.plotting.geo.dump_to_geojson(net: pandapowerNet, nodes: bool | List[int] = False, branches: bool | List[int] = False, switches: bool | List[int] = False, trafos: bool | List[int] = False, t_is_3w: bool = False) FeatureCollection

This function works for pandapowerNet and pandapipesNet. Documentation will refer to names from pandapower. Dumps all primitive values from bus, bus_geodata, res_bus, line, line_geodata and res_line into a geojson object. It is recommended to only dump networks using WGS84 for GeoJSON specification compliance.

Since switches and trafos do not contain their own geodata in pandapower, geodata is taken from the components connected to them. Trafos are always given the geodata from the lv_bus connected at the trafo. Switches are given geodata from the bus the switch is connected to. They do not carry info about where the other components connected to them are located!

Parameters:
  • net (pandapowerNet|pandapipesNet) – The pandapower network

  • nodes (bool | list, default False) – if True return contains all bus data, can be a list of bus ids that should be contained

  • branches (bool | list, default False) – if True return contains all line data, can be a list of line ids that should be contained

  • switches (bool | list, default False) – if True return contains all switch data, can be a list of switch ids that should be contained (only supported for pandapowerNet)

  • trafos (bool | list, default False) – if True return contains all trafo data, can be a list of trafo ids that should be contained (only supported for pandapowerNet)

  • t_is_3w (bool, default False) – if True, the trafos are treated as 3W-trafos

Returns:

A geojson object.

Return type:

geojson.FeatureCollection