Skip to content

Commit

Permalink
Merge pull request #386 from openego/fixes/spatial-join-heat-buses-sm…
Browse files Browse the repository at this point in the history
…all-buffer

Add a very small buffer when joining etrago heat buses heat grids
  • Loading branch information
CarlosEpia authored Jan 29, 2025
2 parents bd12598 + 9ba8587 commit 3f31c0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/egon/data/datasets/heat_etrago/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,10 @@ def insert_central_direct_heat(scenario):
{targets['heat_buses']['table']}
JOIN {sources['district_heating_areas']['schema']}.
{sources['district_heating_areas']['table']}
ON ST_Transform(ST_Centroid(geom_polygon), 4326) = geom
ON ST_Intersects(
ST_Transform(
ST_Buffer(ST_Centroid(geom_polygon),
0.0000001), 4326), geom)
WHERE carrier = 'central_heat'
AND scenario = '{scenario}'
AND scn_name = '{scenario}'
Expand Down
4 changes: 3 additions & 1 deletion src/egon/data/datasets/heat_etrago/power_to_heat.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ def assign_electrical_bus(heat_pumps, carrier, scenario, multiple_per_mv_grid=Fa
{targets['heat_buses']['table']}
JOIN {sources['district_heating_areas']['schema']}.
{sources['district_heating_areas']['table']}
ON ST_Transform(ST_Centroid(geom_polygon), 4326) = geom
ON ST_Intersects(
ST_Transform(ST_Buffer(
ST_Centroid(geom_polygon), 0.0000001), 4326), geom)
WHERE carrier = 'central_heat'
AND scenario='{scenario}'
AND scn_name = '{scenario}'
Expand Down

0 comments on commit 3f31c0c

Please sign in to comment.