Skip to content

Commit

Permalink
Alter weir view
Browse files Browse the repository at this point in the history
the old weir view linked the wastewater structure with the wastewater node via ws.fk_main_wastewater_node. This resulted in overflows being secondary if they didn't start from the main wn of a ws.
  • Loading branch information
cymed committed Oct 20, 2023
1 parent 0759fd1 commit 8aa1cde
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions swmm_views/21_vw_swmm_weirs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_characteristic = oc.obj_id
LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vl_oc_dig ON oc.overflow_characteristic_digital = vl_oc_dig.code
LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vl_oc_ki ON oc.kind_overflow_characteristic = vl_oc_ki.code
LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node
LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id
LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code
LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic
LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON wn._status = ws_st.code
LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=wn._function_hierarchic
WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959)
AND (vl_oc_dig.vsacode != 6223 OR vl_oc_dig.vsacode IS NULL) --'yes;
OR (vl_oc_ki.vsacode != 6220 OR vl_oc_ki.vsacode IS NULL)-- h/q relations (Q/Q relations are not supported by SWMM)
Expand Down Expand Up @@ -71,7 +70,6 @@ LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_characteristic = oc.obj_id
LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vl_oc_dig ON oc.overflow_characteristic_digital = vl_oc_dig.code
LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vl_oc_ki ON oc.kind_overflow_characteristic = vl_oc_ki.code
LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node
LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id
LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code
LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic
LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON wn._status = ws_st.code
LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=wn._function_hierarchic
WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959);

0 comments on commit 8aa1cde

Please sign in to comment.