Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
QWAT DATA MODEL is NOT conform
pulmexa@ubuntu:~/qwat-data-model/update$ python test_migration.py --pg_service qwat
DataModel is NOT conform
Diff:
47a48
> "qwat_od","vw_element_valve"
50d50
< "qwat_od","vw_export_leak"
53d52
< "qwat_od","vw_export_pipe"
61a61
> "qwat_od","vw_leak"
62a63
> "qwat_od","vw_pipe"
316d316
< "qwat_od","pipe","_length2d",,"YES","numeric",,"8","10",
505,511d504
< "qwat_od","valve","_geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","valve","_geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","valve","_pipe_node_type",,"YES","USER-DEFINED",,,,
< "qwat_od","valve","_pipe_orientation","0","YES","double precision",,"53","2",
< "qwat_od","valve","_pipe_schema_visible","false","YES","boolean",,,,
< "qwat_od","valve","_printmaps",,"YES","text",,,,
< "qwat_od","valve","altitude","NULL::numeric","YES","numeric",,"10","10",
514,516d506
< "qwat_od","valve","fk_distributor",,"NO","integer",,"32","2",
< "qwat_od","valve","fk_district",,"YES","integer",,"32","2",
< "qwat_od","valve","fk_folder",,"YES","integer",,"32","2",
519d508
< "qwat_od","valve","fk_locationtype",,"YES","ARRAY",,,,
521d509
< "qwat_od","valve","fk_object_reference",,"YES","integer",,"32","2",
523,527d510
< "qwat_od","valve","fk_precision",,"NO","integer",,"32","2",
< "qwat_od","valve","fk_precisionalti",,"YES","integer",,"32","2",
< "qwat_od","valve","fk_pressurezone",,"YES","integer",,"32","2",
< "qwat_od","valve","fk_printmap",,"YES","ARRAY",,,,
< "qwat_od","valve","fk_status",,"NO","integer",,"32","2",
531,533d513
< "qwat_od","valve","geometry",,"NO","USER-DEFINED",,,,
< "qwat_od","valve","geometry_alt1",,"YES","USER-DEFINED",,,,
< "qwat_od","valve","geometry_alt2",,"YES","USER-DEFINED",,,,
536,547c516
< "qwat_od","valve","id","nextval('qwat_od.valve_id_seq'::regclass)","NO","integer",,"32","2",
< "qwat_od","valve","identification",,"YES","character varying","50",,,
< "qwat_od","valve","label_1_rotation",,"YES","double precision",,"53","2",
< "qwat_od","valve","label_1_text",,"YES","character varying","120",,,
< "qwat_od","valve","label_1_visible","1","YES","smallint",,"16","2",
< "qwat_od","valve","label_1_x",,"YES","double precision",,"53","2",
< "qwat_od","valve","label_1_y",,"YES","double precision",,"53","2",
< "qwat_od","valve","label_2_rotation",,"YES","double precision",,"53","2",
< "qwat_od","valve","label_2_text",,"YES","character varying","120",,,
< "qwat_od","valve","label_2_visible","1","YES","smallint",,"16","2",
< "qwat_od","valve","label_2_x",,"YES","double precision",,"53","2",
< "qwat_od","valve","label_2_y",,"YES","double precision",,"53","2",
---
> "qwat_od","valve","id",,"NO","integer",,"32","2",
549,555d517
< "qwat_od","valve","orientation",,"YES","double precision",,"53","2",
< "qwat_od","valve","remark",,"YES","text",,,,
< "qwat_od","valve","schema_force_visible",,"YES","boolean",,,,
< "qwat_od","valve","update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","valve","update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","valve","year",,"YES","smallint",,"16","2",
< "qwat_od","valve","year_end",,"YES","smallint",,"16","2",
878a841,891
> "qwat_od","vw_element_valve","_geometry_alt1_used",,"YES","boolean",,,,
> "qwat_od","vw_element_valve","_geometry_alt2_used",,"YES","boolean",,,,
> "qwat_od","vw_element_valve","_pipe_node_type",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_element_valve","_pipe_orientation",,"YES","double precision",,"53","2",
> "qwat_od","vw_element_valve","_pipe_schema_visible",,"YES","boolean",,,,
> "qwat_od","vw_element_valve","_printmaps",,"YES","text",,,,
> "qwat_od","vw_element_valve","altitude",,"YES","numeric",,"10","10",
> "qwat_od","vw_element_valve","closed",,"YES","boolean",,,,
> "qwat_od","vw_element_valve","diameter_nominal",,"YES","character varying","10",,,
> "qwat_od","vw_element_valve","fk_distributor",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_district",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_folder",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_handle_precision",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_handle_precisionalti",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_locationtype",,"YES","ARRAY",,,,
> "qwat_od","vw_element_valve","fk_maintenance",,"YES","ARRAY",,,,
> "qwat_od","vw_element_valve","fk_object_reference",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_pipe",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_precision",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_precisionalti",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_pressurezone",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_printmap",,"YES","ARRAY",,,,
> "qwat_od","vw_element_valve","fk_status",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_valve_actuation",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_valve_function",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","fk_valve_type",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_element_valve","geometry_alt1",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_element_valve","geometry_alt2",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_element_valve","handle_altitude",,"YES","numeric",,"10","10",
> "qwat_od","vw_element_valve","handle_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_element_valve","id",,"YES","integer",,"32","2",
> "qwat_od","vw_element_valve","identification",,"YES","character varying","50",,,
> "qwat_od","vw_element_valve","label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_element_valve","label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_element_valve","label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_element_valve","label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_element_valve","label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_element_valve","label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_element_valve","label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_element_valve","label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_element_valve","label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_element_valve","label_2_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_element_valve","networkseparation",,"YES","boolean",,,,
> "qwat_od","vw_element_valve","orientation",,"YES","double precision",,"53","2",
> "qwat_od","vw_element_valve","remark",,"YES","text",,,,
> "qwat_od","vw_element_valve","schema_force_visible",,"YES","boolean",,,,
> "qwat_od","vw_element_valve","update_geometry_alt1",,"YES","boolean",,,,
> "qwat_od","vw_element_valve","update_geometry_alt2",,"YES","boolean",,,,
> "qwat_od","vw_element_valve","year",,"YES","smallint",,"16","2",
> "qwat_od","vw_element_valve","year_end",,"YES","smallint",,"16","2",
887a901,911
> "qwat_od","vw_export_hydrant","district_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_hydrant","district_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","district_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_hydrant","district_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_hydrant","district_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","district_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","district_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","district_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_hydrant","district_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_hydrant","district_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","district_label_2_y",,"YES","double precision",,"53","2",
911a936,937
> "qwat_od","vw_export_hydrant","folder_geometry_line",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_hydrant","folder_geometry_polygon",,"YES","USER-DEFINED",,,,
1011a1038,1050
> "qwat_od","vw_export_hydrant","pressurezone_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_hydrant","pressurezone_geometry_alt1",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_hydrant","pressurezone_geometry_alt2",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_hydrant","pressurezone_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","pressurezone_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_hydrant","pressurezone_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_hydrant","pressurezone_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","pressurezone_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","pressurezone_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","pressurezone_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_hydrant","pressurezone_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_hydrant","pressurezone_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_hydrant","pressurezone_label_2_y",,"YES","double precision",,"53","2",
1034d1072
< "qwat_od","vw_export_hydrant","status_functional",,"YES","boolean",,,,
1091a1130,1140
> "qwat_od","vw_export_installation","district_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_installation","district_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","district_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_installation","district_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_installation","district_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","district_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","district_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","district_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_installation","district_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_installation","district_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","district_label_2_y",,"YES","double precision",,"53","2",
1131a1181,1182
> "qwat_od","vw_export_installation","folder_geometry_line",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_installation","folder_geometry_polygon",,"YES","USER-DEFINED",,,,
1217a1269,1281
> "qwat_od","vw_export_installation","pressurezone_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_installation","pressurezone_geometry_alt1",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_installation","pressurezone_geometry_alt2",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_installation","pressurezone_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","pressurezone_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_installation","pressurezone_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_installation","pressurezone_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","pressurezone_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","pressurezone_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","pressurezone_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_installation","pressurezone_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_installation","pressurezone_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_installation","pressurezone_label_2_y",,"YES","double precision",,"53","2",
1290d1353
< "qwat_od","vw_export_installation","status_functional",,"YES","boolean",,,,
1328,1515d1390
< "qwat_od","vw_export_leak","_repaired",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","address",,"YES","text",,,,
< "qwat_od","vw_export_leak","cause_description_en",,"YES","text",,,,
< "qwat_od","vw_export_leak","cause_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_leak","cause_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_leak","cause_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","cause_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","cause_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","cause_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","cause_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","cause_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","cause_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","description",,"YES","text",,,,
< "qwat_od","vw_export_leak","detection_date",,"YES","date",,,,"0"
< "qwat_od","vw_export_leak","fk_cause",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","fk_pipe",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","geometry",,"YES","USER-DEFINED",,,,
< "qwat_od","vw_export_leak","id",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","label_1_rotation",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","label_1_text",,"YES","character varying","120",,,
< "qwat_od","vw_export_leak","label_1_visible",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","label_1_x",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","label_1_y",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","label_2_rotation",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","label_2_text",,"YES","character varying","120",,,
< "qwat_od","vw_export_leak","label_2_visible",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","label_2_x",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","label_2_y",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","pipe__diff_elevation",,"YES","numeric",,"8","10",
< "qwat_od","vw_export_leak","pipe__geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe__geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe__length2d",,"YES","numeric",,"8","10",
< "qwat_od","vw_export_leak","pipe__length3d",,"YES","numeric",,"8","10",
< "qwat_od","vw_export_leak","pipe__printmaps",,"YES","character varying","100",,,
< "qwat_od","vw_export_leak","pipe__valve_closed",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe__valve_count",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_distributor_name",,"YES","character varying","30",,,
< "qwat_od","vw_export_leak","pipe_district_colorcode",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_district_land_registry",,"YES","character varying","12",,,
< "qwat_od","vw_export_leak","pipe_district_name",,"YES","character varying","40",,,
< "qwat_od","vw_export_leak","pipe_district_prefix",,"YES","character varying","12",,,
< "qwat_od","vw_export_leak","pipe_district_shortname",,"YES","character varying","12",,,
< "qwat_od","vw_export_leak","pipe_district_zip",,"YES","character varying","12",,,
< "qwat_od","vw_export_leak","pipe_fk_bedding",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_distributor",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_district",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_folder",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_function",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_installmethod",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_locationtype",,"YES","ARRAY",,,,
< "qwat_od","vw_export_leak","pipe_fk_material",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_node_a",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_node_b",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_parent",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_precision",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_pressurezone",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_printmap",,"YES","ARRAY",,,,
< "qwat_od","vw_export_leak","pipe_fk_protection",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_status",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_fk_watertype",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_folder_date_end",,"YES","date",,,,"0"
< "qwat_od","vw_export_leak","pipe_folder_date_start",,"YES","date",,,,"0"
< "qwat_od","vw_export_leak","pipe_folder_description",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_folder_identification",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_function_code_sire",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_function_description_en",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_function_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_function_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_function_major",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_function_schema_visible",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_function_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_function_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_function_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_function_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_function_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_function_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_function_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_installmethod_description_en",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_installmethod_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_installmethod_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_installmethod_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_installmethod_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_installmethod_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_installmethod_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_installmethod_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_installmethod_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_installmethod_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_material__displayname_en",,"YES","character varying","30",,,
< "qwat_od","vw_export_leak","pipe_material__displayname_fr",,"YES","character varying","30",,,
< "qwat_od","vw_export_leak","pipe_material__displayname_ro",,"YES","character varying","30",,,
< "qwat_od","vw_export_leak","pipe_material_code_sire",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_material_description_en",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_material_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_material_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_material_diameter",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_material_diameter_external",,"YES","numeric",,"7","10",
< "qwat_od","vw_export_leak","pipe_material_diameter_internal",,"YES","numeric",,"7","10",
< "qwat_od","vw_export_leak","pipe_material_diameter_nominal",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_material_pressure_nominal",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","pipe_material_sdr",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","pipe_material_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_material_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_material_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_material_sn",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_material_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_material_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_material_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_material_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_material_wall_thickness",,"YES","numeric",,"4","10",
< "qwat_od","vw_export_leak","pipe_node_a__geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_a__geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_a__pipe_node_type",,"YES","USER-DEFINED",,,,
< "qwat_od","vw_export_leak","pipe_node_a__pipe_orientation",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","pipe_node_a__pipe_schema_visible",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_a__printmaps",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_node_a_fk_district",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_node_a_fk_pressurezone",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_node_a_fk_printmap",,"YES","ARRAY",,,,
< "qwat_od","vw_export_leak","pipe_node_a_update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_a_update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_b__geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_b__geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_b__pipe_node_type",,"YES","USER-DEFINED",,,,
< "qwat_od","vw_export_leak","pipe_node_b__pipe_orientation",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_leak","pipe_node_b__pipe_schema_visible",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_b__printmaps",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_node_b_fk_district",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_node_b_fk_pressurezone",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_node_b_fk_printmap",,"YES","ARRAY",,,,
< "qwat_od","vw_export_leak","pipe_node_b_update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_node_b_update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_precision_code_sire",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_precision_description_en",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_precision_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_precision_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_precision_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_precision_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_precision_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_precision_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_precision_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_precision_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_precision_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_pressure_nominal",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_pressurezone__geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_pressurezone__geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_pressurezone_colorcode",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_pressurezone_fk_consumptionzone",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_pressurezone_fk_distributor",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_pressurezone_name",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_pressurezone_population",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_pressurezone_subscriber",,"YES","integer",,"32","2",
< "qwat_od","vw_export_leak","pipe_pressurezone_update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_pressurezone_update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_protection_description_en",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_protection_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_protection_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_protection_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_protection_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_protection_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_protection_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_protection_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_protection_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_protection_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_remark",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_replaced",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_schema_force_visible",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_status_active",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_status_code_sire",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_status_description_en",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_status_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_status_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_leak","pipe_status_functional",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_status_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_status_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_status_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_leak","pipe_status_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_status_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_status_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_leak","pipe_status_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_tunnel_or_bridge",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","vw_export_leak","pipe_year",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_year_end",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","pipe_year_rehabilitation",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_leak","repair",,"YES","text",,,,
< "qwat_od","vw_export_leak","repair_date",,"YES","date",,,,"0"
< "qwat_od","vw_export_leak","widespread_damage",,"YES","boolean",,,,
1524a1400,1410
> "qwat_od","vw_export_meter","district_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_meter","district_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","district_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_meter","district_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_meter","district_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","district_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","district_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","district_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_meter","district_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_meter","district_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","district_label_2_y",,"YES","double precision",,"53","2",
1543a1430,1431
> "qwat_od","vw_export_meter","folder_geometry_line",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_meter","folder_geometry_polygon",,"YES","USER-DEFINED",,,,
1598a1487,1499
> "qwat_od","vw_export_meter","pressurezone_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_meter","pressurezone_geometry_alt1",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_meter","pressurezone_geometry_alt2",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_meter","pressurezone_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","pressurezone_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_meter","pressurezone_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_meter","pressurezone_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","pressurezone_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","pressurezone_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","pressurezone_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_meter","pressurezone_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_meter","pressurezone_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_meter","pressurezone_label_2_y",,"YES","double precision",,"53","2",
1611d1511
< "qwat_od","vw_export_meter","status_functional",,"YES","boolean",,,,
1631a1532,1542
> "qwat_od","vw_export_part","district_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_part","district_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","district_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_part","district_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_part","district_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","district_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","district_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","district_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_part","district_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_part","district_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","district_label_2_y",,"YES","double precision",,"53","2",
1651a1563,1564
> "qwat_od","vw_export_part","folder_geometry_line",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_part","folder_geometry_polygon",,"YES","USER-DEFINED",,,,
1715a1629,1641
> "qwat_od","vw_export_part","pressurezone_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_part","pressurezone_geometry_alt1",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_part","pressurezone_geometry_alt2",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_part","pressurezone_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","pressurezone_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_part","pressurezone_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_part","pressurezone_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","pressurezone_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","pressurezone_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","pressurezone_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_part","pressurezone_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_part","pressurezone_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_part","pressurezone_label_2_y",,"YES","double precision",,"53","2",
1728d1653
< "qwat_od","vw_export_part","status_functional",,"YES","boolean",,,,
1740,1903d1664
< "qwat_od","vw_export_pipe","_diff_elevation",,"YES","numeric",,"8","10",
< "qwat_od","vw_export_pipe","_geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","_geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","_length2d",,"YES","numeric",,"8","10",
< "qwat_od","vw_export_pipe","_length3d",,"YES","numeric",,"8","10",
< "qwat_od","vw_export_pipe","_printmaps",,"YES","character varying","100",,,
< "qwat_od","vw_export_pipe","_valve_closed",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","_valve_count",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","distributor_name",,"YES","character varying","30",,,
< "qwat_od","vw_export_pipe","district_colorcode",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","district_land_registry",,"YES","character varying","12",,,
< "qwat_od","vw_export_pipe","district_name",,"YES","character varying","40",,,
< "qwat_od","vw_export_pipe","district_prefix",,"YES","character varying","12",,,
< "qwat_od","vw_export_pipe","district_shortname",,"YES","character varying","12",,,
< "qwat_od","vw_export_pipe","district_zip",,"YES","character varying","12",,,
< "qwat_od","vw_export_pipe","fk_bedding",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_distributor",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_district",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_folder",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_function",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_installmethod",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_locationtype",,"YES","ARRAY",,,,
< "qwat_od","vw_export_pipe","fk_material",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_node_a",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_node_b",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_parent",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_precision",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_pressurezone",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_printmap",,"YES","ARRAY",,,,
< "qwat_od","vw_export_pipe","fk_protection",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_status",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","fk_watertype",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","folder_date_end",,"YES","date",,,,"0"
< "qwat_od","vw_export_pipe","folder_date_start",,"YES","date",,,,"0"
< "qwat_od","vw_export_pipe","folder_description",,"YES","text",,,,
< "qwat_od","vw_export_pipe","folder_identification",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","function_code_sire",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","function_description_en",,"YES","text",,,,
< "qwat_od","vw_export_pipe","function_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_pipe","function_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_pipe","function_major",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","function_schema_visible",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","function_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","function_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","function_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","function_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","function_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","function_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","function_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","geometry",,"YES","USER-DEFINED",,,,
< "qwat_od","vw_export_pipe","geometry_alt1",,"YES","USER-DEFINED",,,,
< "qwat_od","vw_export_pipe","geometry_alt2",,"YES","USER-DEFINED",,,,
< "qwat_od","vw_export_pipe","id",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","installmethod_description_en",,"YES","text",,,,
< "qwat_od","vw_export_pipe","installmethod_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_pipe","installmethod_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_pipe","installmethod_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","installmethod_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","installmethod_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","installmethod_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","installmethod_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","installmethod_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","installmethod_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","label_1_text",,"YES","character varying","120",,,
< "qwat_od","vw_export_pipe","label_1_visible",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","label_2_text",,"YES","character varying","120",,,
< "qwat_od","vw_export_pipe","label_2_visible",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","material__displayname_en",,"YES","character varying","30",,,
< "qwat_od","vw_export_pipe","material__displayname_fr",,"YES","character varying","30",,,
< "qwat_od","vw_export_pipe","material__displayname_ro",,"YES","character varying","30",,,
< "qwat_od","vw_export_pipe","material_code_sire",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","material_description_en",,"YES","text",,,,
< "qwat_od","vw_export_pipe","material_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_pipe","material_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_pipe","material_diameter",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","material_diameter_external",,"YES","numeric",,"7","10",
< "qwat_od","vw_export_pipe","material_diameter_internal",,"YES","numeric",,"7","10",
< "qwat_od","vw_export_pipe","material_diameter_nominal",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","material_pressure_nominal",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_pipe","material_sdr",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_pipe","material_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","material_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","material_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","material_sn",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","material_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","material_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","material_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","material_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","material_wall_thickness",,"YES","numeric",,"4","10",
< "qwat_od","vw_export_pipe","node_a__geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_a__geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_a__pipe_node_type",,"YES","USER-DEFINED",,,,
< "qwat_od","vw_export_pipe","node_a__pipe_orientation",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_pipe","node_a__pipe_schema_visible",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_a__printmaps",,"YES","text",,,,
< "qwat_od","vw_export_pipe","node_a_fk_district",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","node_a_fk_pressurezone",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","node_a_fk_printmap",,"YES","ARRAY",,,,
< "qwat_od","vw_export_pipe","node_a_update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_a_update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_b__geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_b__geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_b__pipe_node_type",,"YES","USER-DEFINED",,,,
< "qwat_od","vw_export_pipe","node_b__pipe_orientation",,"YES","double precision",,"53","2",
< "qwat_od","vw_export_pipe","node_b__pipe_schema_visible",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_b__printmaps",,"YES","text",,,,
< "qwat_od","vw_export_pipe","node_b_fk_district",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","node_b_fk_pressurezone",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","node_b_fk_printmap",,"YES","ARRAY",,,,
< "qwat_od","vw_export_pipe","node_b_update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","node_b_update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","precision_code_sire",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","precision_description_en",,"YES","text",,,,
< "qwat_od","vw_export_pipe","precision_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_pipe","precision_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_pipe","precision_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","precision_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","precision_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","precision_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","precision_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","precision_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","precision_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","pressure_nominal",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","pressurezone__geometry_alt1_used",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","pressurezone__geometry_alt2_used",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","pressurezone_colorcode",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","pressurezone_fk_consumptionzone",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","pressurezone_fk_distributor",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","pressurezone_name",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","pressurezone_population",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","pressurezone_subscriber",,"YES","integer",,"32","2",
< "qwat_od","vw_export_pipe","pressurezone_update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","pressurezone_update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","protection_description_en",,"YES","text",,,,
< "qwat_od","vw_export_pipe","protection_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_pipe","protection_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_pipe","protection_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","protection_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","protection_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","protection_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","protection_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","protection_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","protection_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","remark",,"YES","text",,,,
< "qwat_od","vw_export_pipe","schema_force_visible",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","status_active",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","status_code_sire",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","status_description_en",,"YES","text",,,,
< "qwat_od","vw_export_pipe","status_description_fr",,"YES","text",,,,
< "qwat_od","vw_export_pipe","status_description_ro",,"YES","text",,,,
< "qwat_od","vw_export_pipe","status_functional",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","status_short_en",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","status_short_fr",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","status_short_ro",,"YES","character varying","10",,,
< "qwat_od","vw_export_pipe","status_value_en",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","status_value_fr",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","status_value_ro",,"YES","character varying","50",,,
< "qwat_od","vw_export_pipe","status_vl_active",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","tunnel_or_bridge",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","update_geometry_alt1",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","update_geometry_alt2",,"YES","boolean",,,,
< "qwat_od","vw_export_pipe","year",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","year_end",,"YES","smallint",,"16","2",
< "qwat_od","vw_export_pipe","year_rehabilitation",,"YES","smallint",,"16","2",
1912a1674,1684
> "qwat_od","vw_export_subscriber","district_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_subscriber","district_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","district_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_subscriber","district_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_subscriber","district_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","district_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","district_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","district_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_subscriber","district_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_subscriber","district_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","district_label_2_y",,"YES","double precision",,"53","2",
1934a1707,1708
> "qwat_od","vw_export_subscriber","folder_geometry_line",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_subscriber","folder_geometry_polygon",,"YES","USER-DEFINED",,,,
1989a1764,1776
> "qwat_od","vw_export_subscriber","pressurezone_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_subscriber","pressurezone_geometry_alt1",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_subscriber","pressurezone_geometry_alt2",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_subscriber","pressurezone_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","pressurezone_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_subscriber","pressurezone_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_subscriber","pressurezone_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","pressurezone_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","pressurezone_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","pressurezone_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_subscriber","pressurezone_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_subscriber","pressurezone_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_subscriber","pressurezone_label_2_y",,"YES","double precision",,"53","2",
2002d1788
< "qwat_od","vw_export_subscriber","status_functional",,"YES","boolean",,,,
2034a1821,1831
> "qwat_od","vw_export_valve","district_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_valve","district_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","district_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_valve","district_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_valve","district_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","district_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","district_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","district_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_valve","district_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_valve","district_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","district_label_2_y",,"YES","double precision",,"53","2",
2059a1857,1858
> "qwat_od","vw_export_valve","folder_geometry_line",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_valve","folder_geometry_polygon",,"YES","USER-DEFINED",,,,
2116a1916,1928
> "qwat_od","vw_export_valve","pressurezone_geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_valve","pressurezone_geometry_alt1",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_valve","pressurezone_geometry_alt2",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_export_valve","pressurezone_label_1_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","pressurezone_label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_valve","pressurezone_label_1_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_valve","pressurezone_label_1_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","pressurezone_label_1_y",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","pressurezone_label_2_rotation",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","pressurezone_label_2_text",,"YES","character varying","120",,,
> "qwat_od","vw_export_valve","pressurezone_label_2_visible",,"YES","smallint",,"16","2",
> "qwat_od","vw_export_valve","pressurezone_label_2_x",,"YES","double precision",,"53","2",
> "qwat_od","vw_export_valve","pressurezone_label_2_y",,"YES","double precision",,"53","2",
2129d1940
< "qwat_od","vw_export_valve","status_functional",,"YES","boolean",,,,
2278a2090,2099
> "qwat_od","vw_leak","_repaired",,"YES","boolean",,,,
> "qwat_od","vw_leak","address",,"YES","text",,,,
> "qwat_od","vw_leak","cause",,"YES","character varying","50",,,
> "qwat_od","vw_leak","description",,"YES","text",,,,
> "qwat_od","vw_leak","detection_date",,"YES","date",,,,"0"
> "qwat_od","vw_leak","geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_leak","pipe_replaced",,"YES","boolean",,,,
> "qwat_od","vw_leak","repair",,"YES","text",,,,
> "qwat_od","vw_leak","repair_date",,"YES","date",,,,"0"
> "qwat_od","vw_leak","widespread_damage",,"YES","boolean",,,,
2317a2139,2183
> "qwat_od","vw_pipe","_diff_elevation",,"YES","numeric",,"8","10",
> "qwat_od","vw_pipe","_distributor",,"YES","character varying","30",,,
> "qwat_od","vw_pipe","_function",,"YES","character varying","50",,,
> "qwat_od","vw_pipe","_function_code_sire",,"YES","smallint",,"16","2",
> "qwat_od","vw_pipe","_installmethod",,"YES","character varying","50",,,
> "qwat_od","vw_pipe","_length3d",,"YES","numeric",,"8","10",
> "qwat_od","vw_pipe","_material_code_sire",,"YES","smallint",,"16","2",
> "qwat_od","vw_pipe","_material_diameter",,"YES","character varying","10",,,
> "qwat_od","vw_pipe","_material_diameter_external",,"YES","numeric",,"7","10",
> "qwat_od","vw_pipe","_material_diameter_internal",,"YES","numeric",,"7","10",
> "qwat_od","vw_pipe","_material_longname",,"YES","character varying","50",,,
> "qwat_od","vw_pipe","_material_name",,"YES","character varying","30",,,
> "qwat_od","vw_pipe","_precision",,"YES","character varying","50",,,
> "qwat_od","vw_pipe","_pressurezone",,"YES","character varying","50",,,
> "qwat_od","vw_pipe","_pressurezone_colorcode",,"YES","smallint",,"16","2",
> "qwat_od","vw_pipe","_printmaps",,"YES","character varying","100",,,
> "qwat_od","vw_pipe","_protection",,"YES","character varying","50",,,
> "qwat_od","vw_pipe","_schema_visible",,"YES","boolean",,,,
> "qwat_od","vw_pipe","_status",,"YES","character varying","50",,,
> "qwat_od","vw_pipe","_status_active",,"YES","boolean",,,,
> "qwat_od","vw_pipe","_valve_closed",,"YES","boolean",,,,
> "qwat_od","vw_pipe","_valve_count",,"YES","smallint",,"16","2",
> "qwat_od","vw_pipe","fk_distributor",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_district",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_folder",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_function",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_installmethod",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_material",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_node_a",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_node_b",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_parent",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_precision",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_pressurezone",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_printmap",,"YES","ARRAY",,,,
> "qwat_od","vw_pipe","fk_protection",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","fk_status",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","folder",,"YES","character varying","50",,,
> "qwat_od","vw_pipe","geometry",,"YES","USER-DEFINED",,,,
> "qwat_od","vw_pipe","id",,"YES","integer",,"32","2",
> "qwat_od","vw_pipe","label_1_text",,"YES","character varying","120",,,
> "qwat_od","vw_pipe","pressure_nominal",,"YES","smallint",,"16","2",
> "qwat_od","vw_pipe","remark",,"YES","text",,,,
> "qwat_od","vw_pipe","schema_force_visible",,"YES","boolean",,,,
> "qwat_od","vw_pipe","tunnel_or_bridge",,"YES","boolean",,,,
> "qwat_od","vw_pipe","year",,"YES","smallint",,"16","2",
2321c2187
< "qwat_od","vw_pipe_schema","_length2d",,"YES","numeric",,,"10",
---
> "qwat_od","vw_pipe_schema","_length2d",,"YES","double precision",,"53","2",
2352c2218
< "qwat_od","vw_pipe_schema_merged","_length2d",,"YES","numeric",,,"10",
---
> "qwat_od","vw_pipe_schema_merged","_length2d",,"YES","double precision",,"53","2",
2360c2226
< "qwat_od","vw_pipe_schema_visibleitems","_length2d",,"YES","numeric",,"8","10",
---
> "qwat_od","vw_pipe_schema_visibleitems","_length2d",,"YES","double precision",,"53","2",
2484a2351
> "qwat_od","vw_qwat_network_element","closed",,"YES","boolean",,,,
2486a2354
> "qwat_od","vw_qwat_network_element","diameter_nominal",,"YES","character varying","10",,,
2495a2364,2365
> "qwat_od","vw_qwat_network_element","fk_handle_precision",,"YES","integer",,"32","2",
> "qwat_od","vw_qwat_network_element","fk_handle_precisionalti",,"YES","integer",,"32","2",
2496a2367
> "qwat_od","vw_qwat_network_element","fk_maintenance",,"YES","ARRAY",,,,
2521a2393,2395
> "qwat_od","vw_qwat_network_element","fk_valve_actuation",,"YES","integer",,"32","2",
> "qwat_od","vw_qwat_network_element","fk_valve_function",,"YES","integer",,"32","2",
> "qwat_od","vw_qwat_network_element","fk_valve_type",,"YES","integer",,"32","2",
2535a2410,2411
> "qwat_od","vw_qwat_network_element","handle_altitude",,"YES","numeric",,"10","10",
> "qwat_od","vw_qwat_network_element","handle_geometry",,"YES","USER-DEFINED",,,,
2999d2874
< "qwat_vl","status","functional","true","YES","boolean",,,,
3275,3277d3149
< "valve_fk_distributor","qwat_od.valve.fk_distributor","qwat_od","valve","fk_distributor","distributor","id","FOREIGN KEY"
< "valve_fk_district","qwat_od.valve.fk_district","qwat_od","valve","fk_district","district","id","FOREIGN KEY"
< "valve_fk_folder","qwat_od.valve.fk_folder","qwat_od","valve","fk_folder","folder","id","FOREIGN KEY"
3281d3152
< "valve_fk_object_reference","qwat_od.valve.fk_object_reference","qwat_od","valve","fk_object_reference","object_reference","id","FOREIGN KEY"
3283,3286d3153
< "valve_fk_precision","qwat_od.valve.fk_precision","qwat_od","valve","fk_precision","precision","id","FOREIGN KEY"
< "valve_fk_precisionalti","qwat_od.valve.fk_precisionalti","qwat_od","valve","fk_precisionalti","precisionalti","id","FOREIGN KEY"
< "valve_fk_pressurezone","qwat_od.valve.fk_pressurezone","qwat_od","valve","fk_pressurezone","pressurezone","id","FOREIGN KEY"
< "valve_fk_status","qwat_od.valve.fk_status","qwat_od","valve","fk_status","status","id","FOREIGN KEY"
3289,3290c3156
< "valve_label_1_visible","qwat_od.valve.label_1_visible","qwat_od","valve","label_1_visible","visible","vl_code_int","FOREIGN KEY"
< "valve_label_2_visible","qwat_od.valve.label_2_visible","qwat_od","valve","label_2_visible","visible","vl_code_int","FOREIGN KEY"
---
> "valve_id_fkey","qwat_od.valve.id","qwat_od","valve","id","network_element","id","FOREIGN KEY"
3292d3157
< "valve_schema_force_visible","qwat_od.valve.schema_force_visible","qwat_od","valve","schema_force_visible","visible","vl_code","FOREIGN KEY"
3681a3547,3599
> "vw_element_valve"," SELECT element.id,
> element.fk_district,
> element.fk_pressurezone,
> element.fk_printmap,
> element._printmaps,
> element._geometry_alt1_used,
> element._geometry_alt2_used,
> element._pipe_node_type,
> element._pipe_orientation,
> element._pipe_schema_visible,
> element.geometry,
> element.geometry_alt1,
> element.geometry_alt2,
> element.update_geometry_alt1,
> element.update_geometry_alt2,
> element.identification,
> element.fk_distributor,
> element.fk_status,
> element.fk_folder,
> element.fk_locationtype,
> element.fk_precision,
> element.fk_precisionalti,
> element.fk_object_reference,
> element.altitude,
> element.year,
> element.year_end,
> element.orientation,
> element.remark,
> element.schema_force_visible,
> element.label_1_visible,
> element.label_1_x,
> element.label_1_y,
> element.label_1_rotation,
> element.label_1_text,
> element.label_2_visible,
> element.label_2_x,
> element.label_2_y,
> element.label_2_rotation,
> element.label_2_text,
> valve.fk_valve_type,
> valve.fk_valve_function,
> valve.fk_valve_actuation,
> valve.fk_pipe,
> valve.fk_handle_precision,
> valve.fk_handle_precisionalti,
> valve.fk_maintenance,
> valve.diameter_nominal,
> valve.closed,
> valve.networkseparation,
> valve.handle_altitude,
> valve.handle_geometry
> FROM (qwat_od.valve valve
> JOIN qwat_od.vw_node_element element ON ((valve.id = element.id)));"
3799a3718,3729
> "vw_leak"," SELECT leak_cause.value_fr AS cause,
> leak.widespread_damage,
> leak.detection_date,
> leak.repair_date,
> leak._repaired,
> leak.address,
> leak.pipe_replaced,
> leak.description,
> leak.repair,
> leak.geometry
> FROM (qwat_od.leak
> JOIN qwat_vl.leak_cause ON ((leak.fk_cause = leak_cause.id)));"
3826c3756
< COALESCE(element.orientation, (- node._pipe_orientation)) AS orientation,
---
> COALESCE(element.orientation, node._pipe_orientation) AS orientation,
3840a3771,3827
> "vw_pipe"," SELECT pipe.id,
> pipe.fk_parent,
> pipe.fk_function,
> pipe.fk_installmethod,
> pipe.fk_material,
> pipe.fk_distributor,
> pipe.fk_precision,
> pipe.fk_protection,
> pipe.fk_status,
> pipe.fk_folder,
> pipe.schema_force_visible,
> pipe.year,
> pipe.tunnel_or_bridge,
> pipe.pressure_nominal,
> pipe.label_1_text,
> pipe.remark,
> pipe._valve_count,
> pipe._valve_closed,
> pipe.fk_node_a,
> pipe.fk_node_b,
> pipe.fk_district,
> pipe.fk_pressurezone,
> pipe.fk_printmap,
> pipe._length3d,
> pipe._diff_elevation,
> pipe._printmaps,
> (pipe.geometry)::geometry(LineString,21781) AS geometry,
> COALESCE(pipe.schema_force_visible, pipe_function.schema_visible) AS _schema_visible,
> pipe_function.value_fr AS _function,
> pipe_function.code_sire AS _function_code_sire,
> pipe_installmethod.value_fr AS _installmethod,
> pipe_material._displayname_fr AS _material_name,
> pipe_material.value_fr AS _material_longname,
> pipe_material.diameter AS _material_diameter,
> pipe_material.diameter_internal AS _material_diameter_internal,
> pipe_material.diameter_external AS _material_diameter_external,
> pipe_material.code_sire AS _material_code_sire,
> distributor.name AS _distributor,
> precision.value_fr AS _precision,
> pipe_protection.value_fr AS _protection,
> status.value_fr AS _status,
> status.active AS _status_active,
> pressurezone.name AS _pressurezone,
> pressurezone.colorcode AS _pressurezone_colorcode,
> folder.identification AS folder
> FROM (((((((((((qwat_od.pipe
> JOIN qwat_vl.pipe_function ON ((pipe.fk_function = pipe_function.id)))
> JOIN qwat_vl.pipe_installmethod ON ((pipe.fk_installmethod = pipe_installmethod.id)))
> JOIN qwat_vl.pipe_material ON ((pipe.fk_material = pipe_material.id)))
> JOIN qwat_od.distributor ON ((pipe.fk_distributor = distributor.id)))
> JOIN qwat_vl.precision ON ((pipe.fk_precision = precision.id)))
> LEFT JOIN qwat_vl.pipe_protection ON ((pipe.fk_protection = pipe_protection.id)))
> JOIN qwat_vl.status ON ((pipe.fk_status = status.id)))
> LEFT JOIN qwat_od.pressurezone ON ((pipe.fk_pressurezone = pressurezone.id)))
> LEFT JOIN qwat_od.node node_a ON ((pipe.fk_node_a = node_a.id)))
> LEFT JOIN qwat_od.node node_b ON ((pipe.fk_node_b = node_b.id)))
> LEFT JOIN qwat_od.folder ON ((pipe.fk_folder = folder.id)));"
3850c3837
< (st_lineinterpolatepoint(st_makeline(foo.start_point, foo.end_point), (0.5)::double precision))::geometry(Point,21781) AS middle_point
---
> (st_line_interpolate_point(st_makeline(foo.start_point, foo.end_point), (0.5)::double precision))::geometry(Point,21781) AS middle_point
3853,3854c3840,3841
< (st_force2d(st_lineinterpolatepoint(a.geometry, (0.5)::double precision)))::geometry(Point,21781) AS start_point,
< st_closestpoint(st_makeline((st_lineinterpolatepoint(st_force2d(b.geometry), (LEAST((1)::numeric, (((4)::numeric / b._length2d) / (2)::numeric)))::double precision))::geometry(Point,21781), (st_lineinterpolatepoint(st_force2d(b.geometry), (GREATEST((0)::numeric, ((1)::numeric - (((4)::numeric / b._length2d) / (2)::numeric))))::double precision))::geometry(Point,21781)), a.geometry) AS end_point
---
> (st_force2d(st_line_interpolate_point(a.geometry, (0.5)::double precision)))::geometry(Point,21781) AS start_point,
> st_closestpoint(st_makeline((st_line_interpolate_point(st_force2d(b.geometry), LEAST((1)::double precision, (((4)::double precision / st_length(b.geometry)) / (2)::double precision))))::geometry(Point,21781), (st_line_interpolate_point(st_force2d(b.geometry), GREATEST((0)::double precision, ((1)::double precision - (((4)::double precision / st_length(b.geometry)) / (2)::double precision)))))::geometry(Point,21781)), a.geometry) AS end_point
3959c3946
< pipe._length2d,
---
> st_length(pipe.geometry) AS _length2d,
3969c3956
< WHERE ((COALESCE(pipe.schema_force_visible, pipe_function.schema_visible) IS TRUE) AND (status.functional IS TRUE));"
---
> WHERE ((COALESCE(pipe.schema_force_visible, pipe_function.schema_visible) IS TRUE) AND (status.active IS TRUE));"
4090a4078
> WHEN (valve.id IS NOT NULL) THEN 'valve'::qwat_od.element_type
4133a4122
> WHEN (valve.id IS NOT NULL) THEN valve.networkseparation
4145a4135
> WHEN (valve.id IS NOT NULL) THEN valve.fk_pipe
4223,4224c4213,4224
< hydrant.observation_source
< FROM ((((((qwat_od.vw_node_element element
---
> hydrant.observation_source,
> valve.fk_valve_type,
> valve.fk_valve_function,
> valve.fk_valve_actuation,
> valve.fk_handle_precision,
> valve.fk_handle_precisionalti,
> valve.fk_maintenance,
> valve.diameter_nominal,
> valve.closed,
> valve.handle_altitude,
> valve.handle_geometry
> FROM (((((((qwat_od.vw_node_element element
4229a4230
> LEFT JOIN qwat_od.valve valve ON ((element.id = valve.id)))
4262c4263
< COALESCE(element.orientation, (- node._pipe_orientation)) AS orientation,
---
> COALESCE(element.orientation, node._pipe_orientation) AS orientation,
4341c4342
< (st_makeline(st_force2d(a.geometry), st_lineinterpolatepoint(st_force2d(b.geometry), (0.5)::double precision)))::geometry(LineString,21781) AS geometry
---
> (st_makeline(st_force2d(a.geometry), st_line_interpolate_point(st_force2d(b.geometry), (0.5)::double precision)))::geometry(LineString,21781) AS geometry
4347c4348
< FROM qwat_od.valve
---
> FROM qwat_od.vw_element_valve valve
4371d4371
< "valve_id_seq"
4723,4725d4722
< "valve","fki_valve_fk_distributor","fk_distributor"
< "valve","fki_valve_fk_district","fk_district"
< "valve","fki_valve_fk_folder","fk_folder"
4729d4725
< "valve","fki_valve_fk_object_reference","fk_object_reference"
4731,4734d4726
< "valve","fki_valve_fk_precision","fk_precision"
< "valve","fki_valve_fk_precisionalti","fk_precisionalti"
< "valve","fki_valve_fk_pressurezone","fk_pressurezone"
< "valve","fki_valve_fk_status","fk_status"
4737,4742d4728
< "valve","fki_valve_label_1_visible","label_1_visible"
< "valve","fki_valve_label_2_visible","label_2_visible"
< "valve","fki_valve_schema_force_visible","schema_force_visible"
< "valve","valve_geoidx","geometry"
< "valve","valve_geoidx_alt1","geometry_alt1"
< "valve","valve_geoidx_alt2","geometry_alt2"
4881a4868,4870
> "tr_element_valve_delete"
> "tr_element_valve_insert"
> "tr_element_valve_update"
4902a4892,4893
> "tr_node_add_pipe_vertex_insert"
> "tr_node_add_pipe_vertex_update"
4929,4935d4919
< "tr_valve_add_pipe_vertex_insert"
< "tr_valve_add_pipe_vertex_update"
< "tr_valve_altgeom_alt"
< "tr_valve_altgeom_insert"
< "tr_valve_altgeom_update"
< "tr_valve_infos_insert_trigger"
< "tr_valve_infos_update_trigger"
4949a4934
> "valve_node_set_type"
5162,5201d5146
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_noaction_del"
< "RI_FKey_noaction_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
< "RI_FKey_check_ins"
< "RI_FKey_check_upd"
12827a12773,12955
> DELETE FROM qwat_od.valve WHERE id = OLD.id;
> DELETE FROM qwat_od.vw_node_element WHERE id = OLD.id;
> RETURN NULL;
> END;
> "
> "
> BEGIN
> INSERT INTO qwat_od.vw_node_element (
> id
> , fk_district
> , fk_pressurezone
> , fk_printmap
> , _printmaps
> , _geometry_alt1_used
> , _geometry_alt2_used
> , _pipe_node_type
> , _pipe_orientation
> , _pipe_schema_visible
> , geometry
> , geometry_alt1
> , geometry_alt2
> , update_geometry_alt1
> , update_geometry_alt2
> , identification
> , fk_distributor
> , fk_status
> , fk_folder
> , fk_locationtype
> , fk_precision
> , fk_precisionalti
> , fk_object_reference
> , altitude
> , year
> , year_end
> , orientation
> , remark
> , schema_force_visible
> , label_1_visible
> , label_1_x
> , label_1_y
> , label_1_rotation
> , label_1_text
> , label_2_visible
> , label_2_x
> , label_2_y
> , label_2_rotation
> , label_2_text
> ) VALUES (
> NEW.id
> , NEW.fk_district
> , NEW.fk_pressurezone
> , NEW.fk_printmap
> , NEW._printmaps
> , NEW._geometry_alt1_used
> , NEW._geometry_alt2_used
> , NEW._pipe_node_type
> , NEW._pipe_orientation
> , NEW._pipe_schema_visible
> , NEW.geometry
> , NEW.geometry_alt1
> , NEW.geometry_alt2
> , NEW.update_geometry_alt1
> , NEW.update_geometry_alt2
> , NEW.identification
> , NEW.fk_distributor
> , NEW.fk_status
> , NEW.fk_folder
> , NEW.fk_locationtype
> , NEW.fk_precision
> , NEW.fk_precisionalti
> , NEW.fk_object_reference
> , NEW.altitude
> , NEW.year
> , NEW.year_end
> , NEW.orientation
> , NEW.remark
> , NEW.schema_force_visible
> , NEW.label_1_visible
> , NEW.label_1_x
> , NEW.label_1_y
> , NEW.label_1_rotation
> , NEW.label_1_text
> , NEW.label_2_visible
> , NEW.label_2_x
> , NEW.label_2_y
> , NEW.label_2_rotation
> , NEW.label_2_text
> ) RETURNING id INTO NEW.id;
>
> INSERT INTO qwat_od.valve (
> id
> , fk_valve_type
> , fk_valve_function
> , fk_valve_actuation
> , fk_pipe
> , fk_handle_precision
> , fk_handle_precisionalti
> , fk_maintenance
> , diameter_nominal
> , closed
> , networkseparation
> , handle_altitude
> , handle_geometry
> ) VALUES (
> NEW.id
> , NEW.fk_valve_type
> , NEW.fk_valve_function
> , NEW.fk_valve_actuation
> , qwat_od.fn_pipe_get_id(NEW.geometry)
> , NEW.fk_handle_precision
> , NEW.fk_handle_precisionalti
> , NEW.fk_maintenance
> , NEW.diameter_nominal
> , NEW.closed
> , NEW.networkseparation
> , NEW.handle_altitude
> , NEW.handle_geometry
> );
> RETURN NEW;
> END;
> "
> "
> BEGIN
> UPDATE qwat_od.vw_node_element SET
> fk_district = NEW.fk_district,
> fk_pressurezone = NEW.fk_pressurezone,
> fk_printmap = NEW.fk_printmap,
> _printmaps = NEW._printmaps,
> _geometry_alt1_used = NEW._geometry_alt1_used,
> _geometry_alt2_used = NEW._geometry_alt2_used,
> _pipe_node_type = NEW._pipe_node_type,
> _pipe_orientation = NEW._pipe_orientation,
> _pipe_schema_visible = NEW._pipe_schema_visible,
> geometry = NEW.geometry,
> geometry_alt1 = NEW.geometry_alt1,
> geometry_alt2 = NEW.geometry_alt2,
> update_geometry_alt1 = NEW.update_geometry_alt1,
> update_geometry_alt2 = NEW.update_geometry_alt2,
> identification = NEW.identification,
> fk_distributor = NEW.fk_distributor,
> fk_status = NEW.fk_status,
> fk_folder = NEW.fk_folder,
> fk_locationtype = NEW.fk_locationtype,
> fk_precision = NEW.fk_precision,
> fk_precisionalti = NEW.fk_precisionalti,
> fk_object_reference = NEW.fk_object_reference,
> altitude = NEW.altitude,
> year = NEW.year,
> year_end = NEW.year_end,
> orientation = NEW.orientation,
> remark = NEW.remark,
> schema_force_visible = NEW.schema_force_visible,
> label_1_visible = NEW.label_1_visible,
> label_1_x = NEW.label_1_x,
> label_1_y = NEW.label_1_y,
> label_1_rotation = NEW.label_1_rotation,
> label_1_text = NEW.label_1_text,
> label_2_visible = NEW.label_2_visible,
> label_2_x = NEW.label_2_x,
> label_2_y = NEW.label_2_y,
> label_2_rotation = NEW.label_2_rotation,
> label_2_text = NEW.label_2_text
> WHERE id = OLD.id;
>
> UPDATE qwat_od.valve SET
> fk_valve_type = NEW.fk_valve_type,
> fk_valve_function = NEW.fk_valve_function,
> fk_valve_actuation = NEW.fk_valve_actuation,
> fk_pipe = qwat_od.fn_pipe_get_id(NEW.geometry),
> fk_handle_precision = NEW.fk_handle_precision,
> fk_handle_precisionalti = NEW.fk_handle_precisionalti,
> fk_maintenance = NEW.fk_maintenance,
> diameter_nominal = NEW.diameter_nominal,
> closed = NEW.closed,
> networkseparation = NEW.networkseparation,
> handle_altitude = NEW.handle_altitude,
> handle_geometry = NEW.handle_geometry
> WHERE id = OLD.id;
> RETURN NEW;
> END;
> "
> "
> BEGIN
13357a13486,13503
> -- add a vertex to the corresponding pipe if it intersects
> -- when the node is close enough to the pipe (< 1 micrometer) the node is considered to intersect the pipe
> -- it allows to deal with intersections that cannot be represented by floating point numbers
> UPDATE qwat_od.pipe SET geometry = ST_Snap(geometry, NEW.geometry, 1e-6) WHERE ST_Distance(geometry, NEW.geometry) < 1e-6;
> RETURN NEW;
> END;
> "
> "
> BEGIN
> -- add a vertex to the corresponding pipe if it intersects
> -- when the node is close enough to the pipe (< 1 micrometer) the node is considered to intersect the pipe
> -- it allows to deal with intersections that cannot be represented by floating point numbers
> UPDATE qwat_od.pipe SET geometry = ST_Snap(geometry, NEW.geometry, 1e-6) WHERE ST_Distance(geometry, NEW.geometry) < 1e-6;
> RETURN NEW;
> END;
> "
> "
> BEGIN
13606d13751
< NEW._length2d := ST_Length(NEW.geometry);
13624d13768
< NEW._length2d := ST_Length(NEW.geometry);
13633,13650c13777,13779
< new_node_a integer;
< new_node_b integer;
< start_geom geometry;
< end_geom geometry;
< BEGIN
< -- We get start and end points of the pipe
< SELECT ST_StartPoint(geometry) into start_geom FROM qwat_od.pipe WHERE fk_node_a = OLD.id;
< SELECT ST_EndPoint(geometry) into end_geom FROM qwat_od.pipe WHERE fk_node_b = OLD.id;
< IF start_geom IS NOT NULL THEN
< -- In that case, we can create a new node, and affect it to the pipe
< new_node_a := qwat_od.fn_node_create(start_geom);
< UPDATE qwat_od.pipe SET fk_node_a = new_node_a WHERE fk_node_a = OLD.id;
< END IF;
< IF end_geom IS NOT NULL THEN
< -- In that case, we can create a new node, and affect it to the pipe
< new_node_b := qwat_od.fn_node_create(end_geom);
< UPDATE qwat_od.pipe SET fk_node_b = new_node_b WHERE fk_node_b = OLD.id;
< END IF;
---
> BEGIN
> UPDATE qwat_od.pipe SET fk_node_a = qwat_od.fn_node_create(ST_StartPoint(geometry)) WHERE fk_node_a = OLD.id;
> UPDATE qwat_od.pipe SET fk_node_b = qwat_od.fn_node_create(ST_EndPoint( geometry)) WHERE fk_node_b = OLD.id;
13816,13876d13944
< DECLARE
< pipe_id integer;
< BEGIN
< -- add a vertex to the corresponding pipe if it intersects
< -- when the valve is close enough to the pipe (< 1 micrometer) the valve is considered to intersect the pipe
< -- it allows to deal with intersections that cannot be represented by floating point numbers
< UPDATE qwat_od.pipe SET geometry = ST_Snap(geometry, NEW.geometry, 1e-6) WHERE ST_Distance(geometry, NEW.geometry) < 1e-6;
< PERFORM qwat_od.fn_valve_set_orientation(NEW.id);
< RETURN NEW;
< END;
< "
< "
< DECLARE
< pipe_id integer;
< BEGIN
< -- add a vertex to the corresponding pipe if it intersects
< -- when the valve is close enough to the pipe (< 1 micrometer) the valve is considered to intersect the pipe
< -- it allows to deal with intersections that cannot be represented by floating point numbers
< UPDATE qwat_od.pipe SET geometry = ST_Snap(geometry, NEW.geometry, 1e-6) WHERE ST_Distance(geometry, NEW.geometry) < 1e-6;
< PERFORM qwat_od.fn_valve_set_orientation(NEW.id);
< RETURN NEW;
< END;
< "
< "
< BEGIN
< NEW._geometry_alt1_used := NEW.geometry_alt1 IS NOT NULL AND ST_Equals(ST_Force2d(NEW.geometry_alt1), ST_Force2d(NEW.geometry)) IS FALSE;
< NEW._geometry_alt2_used := NEW.geometry_alt2 IS NOT NULL AND ST_Equals(ST_Force2d(NEW.geometry_alt2), ST_Force2d(NEW.geometry)) IS FALSE;
< RETURN NEW;
< END;
< "
< "
< BEGIN
< IF NEW.geometry_alt1 IS NULL OR NEW.update_geometry_alt1 IS TRUE OR ( TG_OP = 'UPDATE' AND NEW.update_geometry_alt1 IS NULL AND ST_Equals(OLD.geometry, OLD.geometry_alt1) ) THEN
< NEW.geometry_alt1 := NEW.geometry;
< END IF;
< IF NEW.geometry_alt2 IS NULL OR NEW.update_geometry_alt2 IS TRUE OR ( TG_OP = 'UPDATE' AND NEW.update_geometry_alt2 IS NULL AND ST_Equals(OLD.geometry, OLD.geometry_alt2) ) THEN
< NEW.geometry_alt2 := NEW.geometry;
< END IF;
< NEW._geometry_alt1_used := ST_Equals(ST_Force2d(NEW.geometry_alt1), ST_Force2d(NEW.geometry)) IS FALSE;
< NEW._geometry_alt2_used := ST_Equals(ST_Force2d(NEW.geometry_alt2), ST_Force2d(NEW.geometry)) IS FALSE;
< NEW.update_geometry_alt1 := NULL; -- used to determine if alternative geometry 1 should be updated when main geometry is updated
< NEW.update_geometry_alt2 := NULL; -- used to determine if alternative geometry 2 should be updated when main geometry is updated
< RETURN NEW;
< END;
< "
< "
< BEGIN
< IF NEW.geometry_alt1 IS NULL OR NEW.update_geometry_alt1 IS TRUE OR ( TG_OP = 'UPDATE' AND NEW.update_geometry_alt1 IS NULL AND ST_Equals(OLD.geometry, OLD.geometry_alt1) ) THEN
< NEW.geometry_alt1 := NEW.geometry;
< END IF;
< IF NEW.geometry_alt2 IS NULL OR NEW.update_geometry_alt2 IS TRUE OR ( TG_OP = 'UPDATE' AND NEW.update_geometry_alt2 IS NULL AND ST_Equals(OLD.geometry, OLD.geometry_alt2) ) THEN
< NEW.geometry_alt2 := NEW.geometry;
< END IF;
< NEW._geometry_alt1_used := ST_Equals(ST_Force2d(NEW.geometry_alt1), ST_Force2d(NEW.geometry)) IS FALSE;
< NEW._geometry_alt2_used := ST_Equals(ST_Force2d(NEW.geometry_alt2), ST_Force2d(NEW.geometry)) IS FALSE;
< NEW.update_geometry_alt1 := NULL; -- used to determine if alternative geometry 1 should be updated when main geometry is updated
< NEW.update_geometry_alt2 := NULL; -- used to determine if alternative geometry 2 should be updated when main geometry is updated
< RETURN NEW;
< END;
< "
< "
13878,13880c13946
< NEW.fk_pipe := qwat_od.fn_pipe_get_id(NEW.geometry);
< NEW.fk_district := qwat_od.fn_get_district(NEW.geometry);
< NEW.fk_pressurezone := qwat_od.fn_get_pressurezone(NEW.geometry);
---
> UPDATE qwat_od.vw_element_valve valve SET fk_pipe = qwat_od.fn_pipe_get_id(geometry) WHERE fk_pipe = OLD.id OR ST_Distance(geometry, NEW.geometry) < 1e-4;
13886,13888c13952
< NEW.fk_pipe := qwat_od.fn_pipe_get_id(NEW.geometry);
< NEW.fk_district := qwat_od.fn_get_district(NEW.geometry);
< NEW.fk_pressurezone := qwat_od.fn_get_pressurezone(NEW.geometry);
---
> UPDATE qwat_od.vw_element_valve valve SET fk_pipe = qwat_od.fn_pipe_get_id(geometry) WHERE fk_pipe = OLD.id OR ST_Distance(geometry, NEW.geometry) < 1e-4;
13893,13922d13956
< DECLARE
< r record;
< BEGIN
< UPDATE qwat_od.valve SET fk_pipe = qwat_od.fn_pipe_get_id(geometry) WHERE fk_pipe = OLD.id OR ST_Distance(geometry, OLD.geometry) < 1e-4;
<
< -- Il faudrait un trigger sur un changement de géom sur les conduites qui appellent valve_set_orientation pour toutes les vannes avec fk_pipe = id.
< FOR r IN SELECT id FROM qwat_od.valve WHERE fk_pipe = OLD.id
< LOOP
< PERFORM qwat_od.fn_valve_set_orientation(r.id);
< END LOOP;
<
< RETURN NULL;
< END;
< "
< "
< DECLARE
< r record;
< BEGIN
< UPDATE qwat_od.valve SET fk_pipe = qwat_od.fn_pipe_get_id(geometry) WHERE fk_pipe = OLD.id OR ST_Distance(geometry, OLD.geometry) < 1e-4;
<
< -- Il faudrait un trigger sur un changement de géom sur les conduites qui appellent valve_set_orientation pour toutes les vannes avec fk_pipe = id.
< FOR r IN SELECT id FROM qwat_od.valve WHERE fk_pipe = OLD.id
< LOOP
< PERFORM qwat_od.fn_valve_set_orientation(r.id);
< END LOOP;
<
< RETURN NULL;
< END;
< "
< "
14120d14153
< ELSE NULL;
14230a14264,14265
> WHEN OLD.element_type::qwat_od.element_type = 'valve'::qwat_od.element_type THEN
> DELETE FROM qwat_od.valve WHERE id = OLD.id;
14517a14553,14583
> WHEN NEW.element_type::qwat_od.element_type = 'valve'::qwat_od.element_type
> THEN INSERT INTO qwat_od.valve (
> id
> , fk_valve_type
> , fk_valve_function
> , fk_valve_actuation
> , fk_pipe
> , fk_handle_precision
> , fk_handle_precisionalti
> , fk_maintenance
> , diameter_nominal
> , closed
> , networkseparation
> , handle_altitude
> , handle_geometry
> ) VALUES (
> NEW.id
> , NEW.fk_valve_type
> , NEW.fk_valve_function
> , NEW.fk_valve_actuation
> , qwat_od.fn_pipe_get_id(NEW.geometry)
> , NEW.fk_handle_precision
> , NEW.fk_handle_precisionalti
> , NEW.fk_maintenance
> , NEW.diameter_nominal
> , NEW.closed
> , NEW.networkseparation
> , NEW.handle_altitude
> , NEW.handle_geometry
> );
>
14529d14594
< ELSE NULL;
14676a14742,14756
> WHEN NEW.element_type::qwat_od.element_type = 'valve'::qwat_od.element_type
> THEN UPDATE qwat_od.valve SET
> fk_valve_type = NEW.fk_valve_type
> , fk_valve_function = NEW.fk_valve_function
> , fk_valve_actuation = NEW.fk_valve_actuation
> , fk_pipe = qwat_od.fn_pipe_get_id(NEW.geometry)
> , fk_handle_precision = NEW.fk_handle_precision
> , fk_handle_precisionalti = NEW.fk_handle_precisionalti
> , fk_maintenance = NEW.fk_maintenance
> , diameter_nominal = NEW.diameter_nominal
> , closed = NEW.closed
> , networkseparation = NEW.networkseparation
> , handle_altitude = NEW.handle_altitude
> , handle_geometry = NEW.handle_geometry
> WHERE id = OLD.id;
14793d14872
< ELSE NULL;
14891a14971,14976
> "
> BEGIN
> PERFORM qwat_od.fn_node_set_type(NEW.id);
> RETURN NEW;
> END;
> "
15254c15339,15342
<
---
> IF deactivate_node_add_pipe_vertex THEN
> -- if we are called from a pipe creation, do not try to add a vertex on the pipe
> ALTER TABLE qwat_od.node DISABLE TRIGGER tr_node_add_pipe_vertex_insert;
> END IF;
15256c15344,15346
<
---
> IF deactivate_node_add_pipe_vertex THEN
> ALTER TABLE qwat_od.node ENABLE TRIGGER tr_node_add_pipe_vertex_insert;
> END IF;
15270c15360,15363
<
---
> IF deactivate_node_add_pipe_vertex THEN
> -- if we are called from a pipe creation, do not try to add a vertex on the pipe
> ALTER TABLE qwat_od.node DISABLE TRIGGER tr_node_add_pipe_vertex_insert;
> END IF;
15272c15365,15367
<
---
> IF deactivate_node_add_pipe_vertex THEN
> ALTER TABLE qwat_od.node ENABLE TRIGGER tr_node_add_pipe_vertex_insert;
> END IF;
15326c15421
< -- get the geometry
---
> -- get the geoemetry
15329c15424
< -- count the functional pipes associated to this node
---
> -- count the active pipes associated to this node
15338c15433
< AND status.functional IS TRUE;
---
> AND status.active IS TRUE;
15342c15437
< -- check it is not associated to any pipe (including non functional ones)
---
> -- check it is not associated to any pipe (including inactive ones)
15349a15445,15476
> -- otherwise this means the node is node at the end of a pipe, it must be on a vertex
> ELSE
> -- calculate the orientation on that vertex
> _pipe_geom := geometry
> FROM qwat_od.pipe
> WHERE ST_Intersects(pipe.geometry, _node_geom)
> ORDER BY (
> _node_geom IN (
> ST_StartPoint(pipe.geometry),
> ST_EndPoint(pipe.geometry))
> )::integer ASC -- prefer a pipe which doesn't end on the valve
> LIMIT 1;
>
> IF _pipe_geom IS NULL THEN
> RAISE NOTICE 'Network element of type % with ID % is not located on a pipe!'
> , element_type FROM qwat_od.vw_qwat_network_element WHERE id = _node_id
> , _node_id ;
> ELSE
> _lin_ref := ST_LineLocatePoint(_pipe_geom,_node_geom); -- shouldn't be 0 or 1 as it would mean that the node is a pipe end
>
> _sub_geom := ST_LineSubstring( _pipe_geom, 0, _lin_ref);
> _orientation := pi()/2 - ST_Azimuth( ST_PointN(_sub_geom, ST_NumPoints(_sub_geom)-1),
> ST_EndPoint(_sub_geom) );
> _sub_geom := ST_LineSubstring( _pipe_geom, _lin_ref, 1);
> _orientation2 := pi()/2 - ST_Azimuth( ST_PointN(_sub_geom, 2),
> ST_StartPoint(_sub_geom) );
> _orientation2 := pi() + _orientation2; -- reverse angle
> -- RAISE NOTICE 'pipe 1 %', degrees( _orientation );
> -- RAISE NOTICE 'pipe 2 %', degrees( _orientation2 );
> _orientation := ATAN2( (SIN(_orientation)+SIN(_orientation2))/2 , (COS(_orientation)+COS(_orientation2))/2 );
> -- RAISE NOTICE 'mean %', degrees( _orientation );
> END IF;
15365c15492
< WHERE fk_node_a = _node_id AND status.functional IS TRUE
---
> WHERE fk_node_a = _node_id AND status.active IS TRUE
15373c15500
< WHERE fk_node_b = _node_id AND status.functional IS TRUE
---
> WHERE fk_node_b = _node_id AND status.active IS TRUE
15748,15843d15874
< "fn_valve_set_orientation","integer","
< DECLARE
< _pipeitem record;
< _pipe_id integer;
< _grouped record;
< _diameter smallint;
< _looppos integer := 0;
< _orientation double precision := 0;
< _orientation2 double precision := 0;
< _node_geom geometry;
< _pipe_geom geometry;
< _sub_geom geometry;
< _lin_ref float;
< BEGIN
<
< -- get the geometry
< _node_geom := geometry FROM qwat_od.valve WHERE id = _valve_id;
<
< -- count the active pipes associated to this valve
< SELECT
< COUNT(*) AS count,
< bool_or(coalesce(schema_force_visible,pipe_function.schema_visible)) AS schema_visible
< INTO _grouped
< FROM qwat_od.pipe
< INNER JOIN qwat_vl.status ON pipe.fk_status = status.id
< INNER JOIN qwat_vl.pipe_function ON pipe.fk_function = pipe_function.id
< WHERE (pipe.id = (SELECT fk_pipe FROM qwat_od.valve WHERE id = _valve_id))
< AND status.active IS TRUE;
<
< -- if not connected to any pipe, do nothing
< IF _grouped.count <= 2 THEN
< /* loop over them, and take the 2 first/last vertices
< of the pipe to determine orientation (used for symbology) */
< FOR _pipeitem IN (
< SELECT pipe.id, pipe.year, pipe_material.value_fr AS material, pipe_material.diameter_nominal AS diameter,
< ST_StartPoint(geometry) AS point_1,
< ST_PointN(geometry,2) AS point_2
< FROM qwat_od.pipe
< INNER JOIN qwat_vl.pipe_material ON pipe.fk_material = pipe_material.id
< INNER JOIN qwat_vl.status ON pipe.fk_status = status.id
< WHERE pipe.id = (SELECT fk_pipe FROM qwat_od.valve WHERE id = _valve_id) AND status.active IS TRUE
< ) LOOP
< IF _looppos=0 THEN
< -- first pipe
< _diameter := _pipeitem.diameter;
< _pipe_id := _pipeitem.id;
< _looppos := 1;
< _orientation := pi()/2 - ST_Azimuth(_pipeitem.point_2,_pipeitem.point_1);
< -- RAISE NOTICE 'pipe % %', _pipe_id, degrees( _orientation );
< ELSE
< -- second pipe if exists
< _orientation2 := pi()/2 - ST_Azimuth(_pipeitem.point_2,_pipeitem.point_1);
< _orientation2 := pi() + _orientation2; -- reverse angle
< -- RAISE NOTICE 'pipe % %', _pipeitem.id, degrees( _orientation2 );
< _orientation := ATAN2( (SIN(_orientation)+SIN(_orientation2))/2 , (COS(_orientation)+COS(_orientation2))/2 );
< -- RAISE NOTICE 'mean: %', degrees(_orientation );
< -- reverse arrow according to diameter reduction
< IF _pipeitem.diameter > _diameter THEN
< _orientation := _orientation + pi();
< END IF;
< END IF;
< END LOOP;
< END IF;
<
< -- update the valve table
< UPDATE qwat_od.valve SET
< orientation = degrees(_orientation)
< --_pipe_schema_visible = _grouped.schema_visible
< WHERE id = _valve_id;
< END;
< "
< "replay_event","integer","
< DECLARE
< query text;
< BEGIN
< select into query
< case
< when action = 'I' then
< 'INSERT INTO ' || schema_name || '.' || table_name ||
< ' ('||(select string_agg(key, ',') from each(row_data))||') VALUES ' ||
< '('||(select string_agg(case when value is null then 'null' else '''' || value || '''' end, ',') from each(row_data))||')'
< when action = 'D' then
< 'DELETE FROM ' || schema_name || '.' || table_name ||
< ' WHERE id=' || (row_data->'id')::text
< when action = 'U' then
< 'UPDATE ' || schema_name || '.' || table_name ||
< ' SET ' || (select string_agg(key || '=' || case when value is null then 'null' else ''''||value||'''' end, ',') from each(changed_fields)) ||
< ' WHERE id=' || (row_data->'id')::text
< end
< from qwat_sys.logged_actions where event_id=pevent_id;
<
< --raise notice '%', query;
<
< execute query;
< END;
< "
15860a15892
> "qwat_od","vw_element_valve","SELECT"
15863d15894
< "qwat_od","vw_export_leak","SELECT"
15866d15896
< "qwat_od","vw_export_pipe","SELECT"
15874a15905
> "qwat_od","vw_leak","SELECT"
15875a15907
> "qwat_od","vw_pipe","SELECT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment