mv_grid_districts

Medium-voltage grid districts describe the area supplied by one MV grid

Medium-voltage grid districts are defined by one polygon that represents the supply area. Each MV grid district is connected to the HV grid via a single substation.

The methods used for identifying the MV grid districts are heavily inspired by Hülk et al. (2017) (section 2.3), but the implementation differs in detail. The main difference is that direct adjacency is preferred over proximity. For polygons of municipalities without a substation inside, it is iteratively checked for direct adjacent other polygons that have a substation inside. Speaking visually, a MV grid district grows around a polygon with a substation inside.

The grid districts are identified using three data sources

  1. Polygons of municipalities (Vg250GemClean)
  2. HV-MV substations (EgonHvmvSubstation)
  3. HV-MV substation voronoi polygons (EgonHvmvSubstationVoronoi)

Fundamentally, it is assumed that grid districts (supply areas) often go along borders of administrative units, in particular along the borders of municipalities due to the concession levy. Furthermore, it is assumed that one grid district is supplied via a single substation and that locations of substations and grid districts are designed for aiming least lengths of grid line and cables.

With these assumptions, the three data sources from above are processed as follows:

  • Find the number of substations inside each municipality

  • Split municipalities with more than one substation inside * Cut polygons of municipalities with voronoi polygons of respective

    substations

    • Assign resulting municipality polygon fragments to nearest substation
  • Assign municipalities without a single substation to nearest substation in the neighborhood

  • Merge all municipality polygons and parts of municipality polygons to a single polygon grouped by the assigned substation

For finding the nearest substation, as already said, direct adjacency is preferred over closest distance. This means, the nearest substation does not necessarily have to be the closest substation in the sense of beeline distance. But it is the substation definitely located in a neighboring polygon. This prevents the algorithm to find solutions where a MV grid districts consists of multi-polygons with some space in between. Nevertheless, beeline distance still plays an important role, as the algorithm acts in two steps

  1. Iteratively look for neighboring polygons until there are no further polygons
  2. Find a polygon to assign to by minimum beeline distance

The second step is required in order to cover edge cases, such as islands.

For understanding how this is implemented into separate functions, please see define_mv_grid_districts().

class HvmvSubstPerMunicipality(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

ags_0
area_ha
bem
bez
count_hole
gen
geometry
id
is_hole
nuts
old_id
path
rs_0
subst_count
class MvGridDistricts(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

area
bus_id
geom
class MvGridDistrictsDissolved(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

area
bus_id
geom
id
class Vg250GemClean(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

ags_0
area_ha
bem
bez
count_hole
gen
geometry
id
is_hole
nuts
old_id
path
rs_0
class VoronoiMunicipalityCuts(**kwargs)[source]

Bases: egon.data.datasets.mv_grid_districts.VoronoiMunicipalityCutsBase, sqlalchemy.ext.declarative.api.Base

ags_0
bus_id
geom
geom_sub
id
municipality_id
subst_count
voronoi_id
class VoronoiMunicipalityCutsAssigned(**kwargs)[source]

Bases: egon.data.datasets.mv_grid_districts.VoronoiMunicipalityCutsBase, sqlalchemy.ext.declarative.api.Base

ags_0
bus_id
geom
geom_sub
id
municipality_id
subst_count
temp_id
voronoi_id
class VoronoiMunicipalityCutsBase[source]

Bases: object

ags_0 = Column(None, String(), table=None)
bus_id = Column(None, Integer(), table=None)
geom = Column(None, Geometry(geometry_type='POLYGON', srid=3035), table=None)
geom_sub = Column(None, Geometry(geometry_type='POINT', srid=3035), table=None)
municipality_id = Column(None, Integer(), table=None)
subst_count = Column(None, Integer(), table=None)
voronoi_id = Column(None, Integer(), table=None)
assign_substation_municipality_fragments(with_substation, without_substation, strategy, session)[source]

Assign bus_id from next neighboring polygon to municipality fragment

For parts municipalities without a substation inside their polygon the next municipality polygon part is found and assigned.

Resulting data including information about the assigned substation is saved to VoronoiMunicipalityCutsAssigned.

Parameters:
  • with_substation (SQLAlchemy subquery) – Polygons that have a substation inside or are assigned to a substation
  • without_substation (SQLAlchemy subquery) – Subquery that includes polygons without a substation
  • strategy (str) – Either
    • “touches”: Only polygons that touch another polygon from with_substation are considered
    • “within”: Only polygons within a radius of 100 km of polygons without substation are considered for assignment
  • session (SQLAlchemy session) – SQLAlchemy session obejct

See also

The(), but(), different()

define_mv_grid_districts()[source]

Define spatial extent of MV grid districts

The process of identifying the boundary of medium-voltage grid districts is organized in three steps

  1. substations_in_municipalities(): The number of substations
located inside each municipality is calculated
  1. split_multi_substation_municipalities(): The municipalities with
>1 substation inside are split by Voronoi polygons around substations
  1. merge_polygons_to_grid_district(): All polygons are merged such
that one polygon has exactly one single substation inside

Finally, intermediate tables used for storing data temporarily are deleted.

merge_polygons_to_grid_district()[source]

Merge municipality polygon (parts) to MV grid districts

Polygons of municipalities and cut parts of such polygons are merged to a single grid district per one HV-MV substation. Prior determined assignment of cut polygons parts is used as well as proximity of entire municipality polygons to polygons with a substation inside.

  • Step 1: Merge municipality parts that are assigned to the same substation
  • Step 2: Insert municipality polygons with exactly one substation
  • Step 3: Assign municipality polygons without a substation and insert to table
  • Step 4: Merge MV grid district parts
nearest_polygon_with_substation(with_substation, without_substation, strategy, session)[source]

Assign next neighboring polygon

For municipalities without a substation inside their polygon the next MV grid district (part) polygon is found and assigned.

Resulting data including information about the assigned substation is saved to MvGridDistrictsDissolved.

Parameters:
  • with_substation (SQLAlchemy subquery) – Polygons that have a substation inside or are assigned to a substation
  • without_substation (SQLAlchemy subquery) – Subquery that includes polygons without a substation
  • strategy (str) – Either
    • “touches”: Only polygons that touch another polygon from with_substation are considered
    • “within”: Only polygons within a radius of 100 km of polygons without substation are considered for assignment
  • session (SQLAlchemy session) – SQLAlchemy session obejct
Returns:

list – IDs of polygons that were already assigned to a polygon with a substation

split_multi_substation_municipalities()[source]

Split municipalities that have more than one substation

Municipalities that contain more than one HV-MV substation in their polygon are cut by HV-MV voronoi polygons. Resulting fragments are then assigned to the next neighboring polygon that has a substation.

In detail, the following steps are performed:

  • Step 1: cut municipalities with voronoi polygons
  • Step 2: Determine number of substations inside cut polygons
  • Step 3: separate cut polygons with exactly one substation inside
  • Step 4: Assign polygon without a substation to next neighboring polygon with a substation
  • Step 5: Assign remaining polygons that are non-touching
substations_in_municipalities()[source]

Create a table that counts number of HV-MV substations in each MV grid

Counting is performed in two steps

  1. HV-MV substations are spatially joined on municipalities, grouped by municipality and number of substations counted
  2. Because (1) works only for number of substations >0, all municipalities not containing a substation, are added