Skip to content

Commit

Permalink
Fix buffer geometry used for surface and DWF (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
margrietpalm authored Jan 15, 2025
1 parent 93c706e commit 0a690e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Changelog of threedi-schema
0.229.1 (unreleased)
--------------------

- Nothing changed yet.
- Fix incorrect creation of geometry for dry weather flow and surface during migration


0.229.0 (2025-01-08)
Expand Down
3 changes: 2 additions & 1 deletion threedi_schema/migrations/versions/0223_upgrade_db_inflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,13 @@ def copy_polygons(src_table: str, tmp_geom: str):

def create_buffer_polygons(src_table: str, tmp_geom: str):
# create circular polygon of area 1 around the connection node
srid = get_global_srid()
surf_id = f"{src_table.strip('v2_')}_id"
query = f"""
WITH connection_data AS (
SELECT
{src_table}_map.{surf_id} AS item_id,
ST_Buffer(v2_connection_nodes.the_geom, 1) AS buffer_geom
ST_Transform(ST_Buffer(ST_Transform(v2_connection_nodes.the_geom, {srid}), 1), 4326) AS buffer_geom
FROM
v2_connection_nodes
JOIN
Expand Down

0 comments on commit 0a690e9

Please sign in to comment.