Skip to content

Commit

Permalink
Merge pull request #236 from QGEP/2024-06-19-add-view-blank_connection
Browse files Browse the repository at this point in the history
Create vw_reaches_with_blank_connections.sql
  • Loading branch information
ponceta authored Aug 29, 2024
2 parents 10851f7 + c2ca6e4 commit 902c1e8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions view/additional_views/vw_reaches_with_blank_connections.sql
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;

0 comments on commit 902c1e8

Please sign in to comment.