openego / eGon-data

GNU Affero General Public License v3.0
10 stars 4 forks source link

Mismatch of building bus_ids from cts_heat_demand_building_share and mapping table #989

Closed nailend closed 1 year ago

nailend commented 1 year ago

There is a mismatch of building bus_ids in the result tables demand.egon_cts_heat_demand_building_share and demand.egon_cts_electricity_demand_building_share and the mapping table boundaries.egon_map_zensus_mvgd_buildings.

The mismatch probably results in the process of determining the cts demand share per building. Its is derived from the number of amenities within a census cell. If multiple amenities are tagged to a building which exceeds a census cell, there are edge cases in which not all amenities are assigned to the same mvgd.

A building however can not get demand from different mvgd by logic as well as by our methodology. This is a problem taken care of here. All amenities tagged to a building need to be of the mvgd, if not the ones lower in number per mvgd are dropped. These cells are compensated for with synthetic buildings.

Apparently there are edge cases in which the mvgd chosen is not the one containing the centroid of the building. This leads to an duplicated key error during the heat pump desaggregation.

To fix this, I propose to simply update the zensus_population_id in openstreetmap.egon_cts_buildings here