-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from QGEP/2024-06-19-add-view-blank_connection
Create vw_reaches_with_blank_connections.sql
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
view/additional_views/vw_reaches_with_blank_connections.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
DROP VIEW IF EXISTS qgep_od.vw_reaches_with_blank_connections; | ||
|
||
|
||
-------- | ||
-- View that shows all reaches with blank connections (Blindanschlüsse). Can be used for visualisation | ||
-- Author Urs Kaufmann 19.6.2024 | ||
-------- | ||
|
||
CREATE OR REPLACE VIEW qgep_od.vw_reaches_with_blank_connections AS | ||
|
||
SELECT re.obj_id, | ||
re.progression_geometry, | ||
ch.function_hierarchic, | ||
reto.obj_id AS to_obj_id | ||
FROM qgep_od.reach re | ||
LEFT JOIN qgep_od.reach_point rpto ON rpto.obj_id::text = re.fk_reach_point_to::text | ||
LEFT JOIN qgep_od.wastewater_networkelement neto ON neto.obj_id::text = rpto.fk_wastewater_networkelement::text | ||
LEFT JOIN qgep_od.reach reto ON reto.obj_id::text = neto.obj_id::text | ||
LEFT JOIN qgep_od.wastewater_networkelement ne ON ne.obj_id::text = re.obj_id::text | ||
LEFT JOIN qgep_od.channel ch ON ch.obj_id::text = ne.fk_wastewater_structure::text | ||
WHERE reto.obj_id IS NOT NULL; |