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

Alter sbw_einzugsgebiet Filter #53

Merged
merged 1 commit into from
Jul 17, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,14 @@ def _export_sbw_einzugsgebiet(self):
perimeter_query = text(
"""
WITH geoms AS (
SELECT *, ST_ForceCurve((ST_Dump(perimeter_ist)).geom) AS geom
FROM tww_ag6496.sbw_einzugsgebiet
)
SELECT *, ST_ForceCurve((ST_Dump(perimeter_ist)).geom) AS geom
FROM tww_ag6496.sbw_einzugsgebiet
WHERE ST_NumGeometries(perimeter_ist)>1
UNION
SELECT *, ST_ForceCurve(ST_GeometryN(perimeter_ist,1)) AS geom
FROM tww_ag6496.sbw_einzugsgebiet
WHERE ST_NumGeometries(perimeter_ist)=1
)
SELECT DISTINCT ON (obj_id) obj_id, ST_Area(geom) AS area, geom, ST_GeometryType(geom) as type
FROM geoms
ORDER BY obj_id, area DESC;
Expand Down