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

Qgep swmm phase3 enhancements #190

Merged
merged 53 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1a8f44b
#730, #560 redirect correctly the catchments
tproduit Oct 11, 2022
b917353
#730, #560 add a column message to warn the user when default values …
tproduit Oct 11, 2022
c4fb5ae
update DWF message
tproduit Oct 12, 2022
06f730d
typo in comment
tproduit Oct 13, 2022
9654723
force 3D geom vw_conduites
RoMabillard Oct 13, 2022
31d1b36
typo in comment
tproduit Oct 13, 2022
e1c56a8
add qgep_od.hydraulic_load attribute
tproduit Oct 13, 2022
bb063cb
remove useless comment
tproduit Oct 13, 2022
24f8bfd
add hierarchy
tproduit Oct 18, 2022
1f1736d
add obj_id for selection
tproduit Oct 20, 2022
b8dc9e5
compute roughness using Strickler or Colebrook vw_conduites
RoMabillard Oct 27, 2022
04f3344
hierarchy and obj_id in vertices
tproduit Oct 28, 2022
58982d9
Populate qgep_swmm.vw_conduits with default friction from qgep_swmm.r…
RoMabillard Nov 3, 2022
f7c1530
test export
tproduit Nov 8, 2022
850e7b3
Set the profile parameters Geom1, Geom2, Geom3 correctly
RoMabillard Nov 8, 2022
397914b
no from node and / or no to node
tproduit Nov 9, 2022
2ba7c48
change to export special structures
tproduit Nov 10, 2022
34b7a3a
add X,Y location for raingages
tproduit Nov 11, 2022
c183f4f
change name of the coverages
tproduit Nov 11, 2022
c1a242f
Update 14_vw_swmm_xsections.sql
tproduit Nov 11, 2022
c2e8b5f
Merge pull request #2 from iggroup/690_Force3D
tproduit Nov 11, 2022
8f270f9
Merge pull request #3 from iggroup/648_import_backflow_level
tproduit Nov 11, 2022
67ecf68
Merge pull request #4 from iggroup/646_rain_gages
tproduit Nov 11, 2022
3f28aa0
Merge pull request #5 from iggroup/698_Pipe_profils
tproduit Nov 11, 2022
bd77f0c
Merge branch 'QgepSwmmPhase3Enhancements' into 719_special_structures
tproduit Nov 11, 2022
c6b11ef
Merge pull request #6 from iggroup/719_special_structures
tproduit Nov 11, 2022
746864a
Merge branch 'QgepSwmmPhase3Enhancements' into 720_729_network_selection
tproduit Nov 11, 2022
a320ccd
Merge pull request #7 from iggroup/720_729_network_selection
tproduit Nov 11, 2022
8f3c8f3
Merge pull request #8 from iggroup/727_RoughnessExport
tproduit Nov 11, 2022
9ee7281
Merge pull request #9 from iggroup/728_PopulateDefaultFriction
tproduit Nov 11, 2022
62437d7
Merge pull request #10 from iggroup/XXX_landuse_coverages
tproduit Nov 11, 2022
e75a7a9
Merge branch 'QgepSwmmPhase3Enhancements' into QgepSwmmPhase3Debug
tproduit Nov 11, 2022
795de47
Merge pull request #11 from iggroup/QgepSwmmPhase3Debug
tproduit Nov 11, 2022
d6701c2
add delta file for new attributes
tproduit Nov 11, 2022
9121ba4
separate views
tproduit Nov 11, 2022
39de29b
dividers
tproduit Nov 11, 2022
de1bd2f
dividers
tproduit Nov 11, 2022
4893a07
separate message and descriptions
tproduit Nov 16, 2022
cbe21da
merge and doc
tproduit Nov 24, 2022
0aab5f2
add comments
tproduit Nov 29, 2022
70915af
add new lines
tproduit Dec 6, 2022
a5dacdd
Merge branch 'master' into QgepSwmmPhase3Enhancements
tproduit Dec 6, 2022
671fdfb
renumber file
tproduit Dec 6, 2022
34f47ff
add version number
tproduit Dec 6, 2022
b94d40e
change field description
tproduit Dec 6, 2022
70d3ad2
change field description
tproduit Dec 6, 2022
0311048
update view in create_views.py
tproduit Dec 6, 2022
9256a55
escape % in delta
tproduit Dec 6, 2022
9444a15
comment swmm test
tproduit Dec 6, 2022
8f69a42
Sjb remarks
tproduit Dec 15, 2022
bf6e06f
Sjb remarks
tproduit Dec 15, 2022
aff96a8
Sjb remarks
tproduit Dec 15, 2022
4fe6d0b
update tests with new counts
tproduit Dec 15, 2022
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
1 change: 1 addition & 0 deletions 03_qgep_db_dss.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1914,6 +1914,7 @@ ALTER TABLE qgep_od.reach ADD COLUMN slope_building_plan smallint ;
COMMENT ON COLUMN qgep_od.reach.slope_building_plan IS 'yyy_Auf dem alten Plan eingezeichnetes Plangefälle [%o]. Nicht kontrolliert im Feld. Kann nicht für die hydraulische Berechnungen übernommen werden. Für Liegenschaftsentwässerung und Meliorationsleitungen. Darstellung als z.B. 3.5%oP auf Plänen. / Auf dem alten Plan eingezeichnetes Plangefälle [%o]. Nicht kontrolliert im Feld. Kann nicht für die hydraulische Berechnungen übernommen werden. Für Liegenschaftsentwässerung und Meliorationsleitungen. Darstellung als z.B. 3.5%oP auf Plänen. / Pente indiquée sur d''anciens plans non contrôlée [%o]. Ne peut pas être reprise pour des calculs hydrauliques. Indication pour des canalisations de biens-fonds ou d''amélioration foncière. Représentation sur de plan: 3.5‰ p';
ALTER TABLE qgep_od.reach ADD COLUMN wall_roughness decimal(5,2) ;
COMMENT ON COLUMN qgep_od.reach.wall_roughness IS 'yyy Hydraulische Kenngrösse zur Beschreibung der Beschaffenheit der Kanalwandung. Beiwert für die Formeln nach Prandtl-Colebrook (ks oder kb) / Hydraulische Kenngrösse zur Beschreibung der Beschaffenheit der Kanalwandung. Beiwert für die Formeln nach Prandtl-Colebrook (ks oder kb) / Coefficient de rugosité d''après Prandtl Colebrook (ks ou kb)';

-------
CREATE TRIGGER
update_last_modified_reach
Expand Down
23 changes: 23 additions & 0 deletions 05_data_model_extensions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,26 @@ ALTER TABLE qgep_od.wastewater_node ADD COLUMN _function_hierarchic integer;
COMMENT ON COLUMN qgep_od.wastewater_node._function_hierarchic IS 'not part of the VSA-DSS data model
added solely for QGEP
has to be updated by triggers';


-- Modifications applied for link with SWMM
-------------------------------------------

-- Add attributes
ALTER TABLE qgep_od.reach ADD COLUMN swmm_default_coefficient_of_friction smallint ;
COMMENT ON COLUMN qgep_od.reach.swmm_default_coefficient_of_friction IS '1 / N_Manning, value between 0 and 999. Value exported in SWMM if coefficient_of_friction and wall_roughness are not set. ';
ALTER TABLE qgep_od.reach ADD COLUMN dss2020_hydraulic_load_current smallint ;
COMMENT ON COLUMN qgep_od.reach.dss2020_hydraulic_load_current IS 'Dimensioning of the discharge divided by the normal discharge capacity of the reach [%]. / Dimensionierungsabfluss geteilt durch Normalabflusskapazität der Leitung [%]. / Débit de dimensionnement divisé par la capacité d''écoulement normale de la conduite [%].';

-- Add table for defaults coefficients of friction
CREATE SCHEMA IF NOT EXISTS qgep_swmm;
CREATE TABLE qgep_swmm.reach_coefficient_of_friction (fk_material integer, coefficient_of_friction smallint);
ALTER TABLE qgep_swmm.reach_coefficient_of_friction ADD CONSTRAINT pkey_qgep_vl_reach_coefficient_of_friction_id PRIMARY KEY (fk_material);
INSERT INTO qgep_swmm.reach_coefficient_of_friction(fk_material) SELECT vsacode FROM qgep_vl.reach_material;
UPDATE qgep_swmm.reach_coefficient_of_friction SET coefficient_of_friction = (CASE WHEN fk_material IN (5381,5081,3016) THEN 100
WHEN fk_material IN (2754,3638,3639,3640,3641,3256,147,148,3648,5079,5080,153,2762) THEN 83
WHEN fk_material IN (2755) THEN 67
WHEN fk_material IN (5076,5077,5078,5382) THEN 111
WHEN fk_material IN (3654) THEN 91
WHEN fk_material IN (154,2761) THEN 71
ELSE 100 END);
2 changes: 2 additions & 0 deletions 09_qgep_dictionaries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ CREATE TABLE qgep_sys.dictionary_od_field (
INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (31,4789,'reach','ring_stiffness','ring_stiffness','Ringsteifigkeit','RIGIDITE_ANNULAIRE','zzz_Ringsteifigkeit','rigiditate_inelara','yyy Ringsteifigkeitsklasse - Druckfestigkeit gegen Belastungen von aussen (gemäss ISO 13966 )','Ringsteifigkeitsklasse - Druckfestigkeit gegen Belastungen von aussen (gemäss ISO 13966 )','[kN/m2]','[kN/m2]','[kN/m2]',ARRAY['Werkinformation']::qgep_od.plantype[],'true','smallint','[kN/m2]','[kN/m2]','[kN/m2]','[kN/m2]','','','','','','',0,16);
INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (31,4800,'reach','slope_building_plan','slope_building_plan','Plangefaelle','PENTE_PLAN','zzz_Plangefaelle','panta_planificata','yyy_Auf dem alten Plan eingezeichnetes Plangefälle [%o]. Nicht kontrolliert im Feld. Kann nicht für die hydraulische Berechnungen übernommen werden. Für Liegenschaftsentwässerung und Meliorationsleitungen. Darstellung als z.B. 3.5%oP auf Plänen.','Auf dem alten Plan eingezeichnetes Plangefälle [%o]. Nicht kontrolliert im Feld. Kann nicht für die hydraulische Berechnungen übernommen werden. Für Liegenschaftsentwässerung und Meliorationsleitungen. Darstellung als z.B. 3.5%oP auf Plänen.',' [%o]',' [%o]',' [%o]',ARRAY['Werkinformation']::qgep_od.plantype[],'true','smallint',' [%o]','promille [%o]',' [%o]','Promille [%o]','','','','','','',-10000,10000);
INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (31,129,'reach','wall_roughness','wall_roughness','Wandrauhigkeit','K_COLEBROOK','zzz_Wandrauhigkeit','rugozitate_perete','yyy Hydraulische Kenngrösse zur Beschreibung der Beschaffenheit der Kanalwandung. Beiwert für die Formeln nach Prandtl-Colebrook (ks oder kb)','Hydraulische Kenngrösse zur Beschreibung der Beschaffenheit der Kanalwandung. Beiwert für die Formeln nach Prandtl-Colebrook (ks oder kb)','[mm]','[mm]','[mm]',ARRAY['Werkinformation']::qgep_od.plantype[],'true','decimal(5,2)','[mm]','roughness coefficient after Prandtl Colebrook (ks), unit milimeter [mm]','[mm]','Wandrauhigkeitsbeiwert nach Prandtl Colebrook (ks), Milimeter [mm]','','','','','','',0,100);
INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (31,9999999,'reach','swmm_default_coefficient_of_friction','swmm_default_coefficient_of_friction',NULL,NULL,NULL,NULL,'Default coefficient of friction for SWMM export.',NULL,NULL,NULL,NULL,NULL,'true','smallint','[m^(1/3)/s]','Manning-Strickler [m^(1/3)/s]','[m^(1/3)/s]','Manning-Strickler [m^(1/3)/s]','','','','','','',0,999);
sjib marked this conversation as resolved.
Show resolved Hide resolved
INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (31,9999999,'reach','dss2020_hydraulic_load_current','dss2020_hydraulic_load_current',NULL,NULL,NULL,NULL,'Dimensioning of the discharge divided by the normal discharge capacity of the reach [%].','Dimensionierungsabfluss geteilt durch Normalabflusskapazität der Leitung [%].','Débit de dimensionnement divisé par la capacité d''écoulement normale de la conduite [%].',NULL,NULL,NULL,'true','decimal(7,3)','[%]','Dimensionierungsabfluss geteilt durch Normalabflusskapazität der Leitung [%].','[m^(1/3)/s]','Dimensionierungsabfluss geteilt durch Normalabflusskapazität der Leitung [%].','','','','','','',0,100);
tproduit marked this conversation as resolved.
Show resolved Hide resolved
INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (3189,3558,'param_ca_general','dry_wheather_flow','dry_wheather_flow','Trockenwetteranfall','DEBIT_TEMPS_SEC','zzz_Trockenwetteranfall','fluxul_de_vreme_uscata','Dry wheather flow','NULL','[l/s]','[l/s]','[l/s]',ARRAY['kein_Plantyp_definiert']::qgep_od.plantype[],'true','decimal(9,3)','[l/s]','liters per second [l/s]','[l/s]','Liter pro Sekunde [l/s]','','','','','','',0,100000);
INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (3189,3195,'param_ca_general','flow_path_length','flow_path_length','Fliessweglaenge','L_LIGNE_ECOULEMENT','zzz_Fliessweglaenge','lungimea_traseului_de_curgere','Length of flow path','Fliessweglänge','[m]','[m]','[m]',ARRAY['kein_Plantyp_definiert']::qgep_od.plantype[],'true','decimal(7,2)','[m]','meter [m], 2 decimal digits','[m]','Meter [m], 2 Dezimalstellen','','','','','','',0,30000);
INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (3189,3194,'param_ca_general','flow_path_slope','flow_path_slope','Fliessweggefaelle','P_LIGNE_ECOULEMENT','zzz_Fliessweggefaelle','panta_traseului_de_curgere','Slope of flow path [%o]','Fliessweggefälle [%o]','[%o]','[%o]','[%o]',ARRAY['kein_Plantyp_definiert']::qgep_od.plantype[],'true','smallint','[%o]','permill [%]','[%o]','Promille [%o]','','','','','','',0,1000);
Expand Down
2 changes: 2 additions & 0 deletions delta/delta_1.5.8_add_reach_default_coefficient_friction.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE qgep_od.reach ADD COLUMN swmm_default_coefficient_of_friction smallint ;
COMMENT ON COLUMN qgep_od.reach.swmm_default_coefficient_of_friction IS 'yyy http://www.fsl.orst.edu/geowater/FX3/help/8_Hydraulic_Reference/Mannings_n_Tables.htm / (1 / N_Manning) value between 0 and 999';
2 changes: 2 additions & 0 deletions delta/delta_1.5.8_add_reach_hydraulic_load.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE qgep_od.reach ADD COLUMN dss2020_hydraulic_load_current smallint;
COMMENT ON COLUMN qgep_od.reach.dss2020_hydraulic_load_current IS 'Dimensioning of the discharge divided by the normal discharge capacity of the reach [%%]. / Débit de dimensionnement divisé par la capacité d''écoulement normale de la conduite [%%].';
10 changes: 10 additions & 0 deletions delta/delta_1.5.8_tbl_swmm_coefficient_friction.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE qgep_swmm.reach_coefficient_of_friction (fk_material integer, coefficient_of_friction smallint);
ponceta marked this conversation as resolved.
Show resolved Hide resolved
ALTER TABLE qgep_swmm.reach_coefficient_of_friction ADD CONSTRAINT pkey_qgep_vl_reach_coefficient_of_friction_id PRIMARY KEY (fk_material);
INSERT INTO qgep_swmm.reach_coefficient_of_friction(fk_material) SELECT vsacode FROM qgep_vl.reach_material;
UPDATE qgep_swmm.reach_coefficient_of_friction SET coefficient_of_friction = (CASE WHEN fk_material IN (5381,5081,3016) THEN 100
WHEN fk_material IN (2754,3638,3639,3640,3641,3256,147,148,3648,5079,5080,153,2762) THEN 83
WHEN fk_material IN (2755) THEN 67
WHEN fk_material IN (5076,5077,5078,5382) THEN 111
WHEN fk_material IN (3654) THEN 91
WHEN fk_material IN (154,2761) THEN 71
ELSE 100 END);
1 change: 0 additions & 1 deletion swmm_views/01_vw_swmm_create_schema.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
DROP SCHEMA IF EXISTS qgep_swmm CASCADE;
CREATE SCHEMA IF NOT EXISTS qgep_swmm;
Loading