Transforming network geodata formats
Geodata in pandapower can be stored in different formats.
- pandapower.plotting.geo.convert_gis_to_geojson(net, delete=True)
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.
- Return type:
None
- pandapower.plotting.geo.convert_crs(net, epsg_in=4326, epsg_out=31467)
Converts bus and line geodata in net from epsg_in to epsg_out Supported geojson geometries are Point and LineString. Although Conversion away from WGS84 is highly discouraged.
- Parameters:
net (pandapowerNet) – 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
- Return type:
None
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, buses=False, lines=False, switches=False, trafos=False, t_is_3w=False, include_type_id=True)
Dumps all primitive values into a geojson object. Supports bus, line, switche, trafo, trafo3w. 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) – The pandapower network
buses (bool | list, default False) – if True return contains all bus data, can be a list of bus ids that should be contained
lines (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
include_type_id (bool, default true) – if True, pp_type and pp_index is added to every feature
- Returns:
A geojson object.
- Return type:
geojson.FeatureCollection
- Return type:
FeatureCollection