Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buffer geometry used for surface and DWF #168

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading