gw_fct_rpt2pg_main - Giswater/giswater_dbmodel GitHub Wiki
Description
Function to import result files generated by EPA SWMM or EPANET
Input example
SELECT gw_fct_rpt2pg_main('{
"client":{"device":4, "infoType":1, "lang":"ES"},
"form":{}, "feature":{},
"data":{"resultId":"r1", "file":[{"target": "null", "col40": "null", "col1":"Page", "col2":"1", "col3":"Tue", "col4":"Jun", "col5":"02", "col6":"22:20:38", "col7":"2020"},
{"source": "null", "col40": "null", "col1":"*", "col2":"E", "col3":"P", "col4":"A", "col5":"N", "col6":"E", "col7":"T", "col8":"*"},
{"source": "null", "col40": "null", "col1":"*", "col2":"Hydraulic", "col3":"and", "col4":"Water", "col5":"Quality", "col6":"*"},
{"source": "null", "col40": "null", "col1":"*", "col2":"Analysis", "col3":"for", "col4":"Pipe", "col5":"Networks", "col6":"*"},
{"source": "null", "col40": "null", "col1":"*", "col2":"Version", "col3":"*"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Input", "col2":"Data", "col3":"File", "col4":"...................", "col5":"C:/Temp/a20.inp"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Number", "col2":"of", "col3":"Junctions................", "col4":"232"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Number", "col2":"of", "col3":"Reservoirs...............", "col4":"5"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Number", "col2":"of", "col3":"Tanks", "col4":"...................", "col5":"0"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Number", "col2":"of", "col3":"Pipes", "col4":"...................", "col5":"261"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Number", "col2":"of", "col3":"Pumps", "col4":"...................", "col5":"3"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Number", "col2":"of", "col3":"Valves", "col4":"..................", "col5":"2"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Headloss", "col2":"Formula", "col3":"..................", "col4":"Darcy-Weisbach"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Hydraulic", "col2":"Timestep", "col3":"................", "col4":"0.50", "col5":"hrs"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Hydraulic", "col2":"Accuracy", "col3":"................", "col4":"0.001000"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Status", "col2":"Check", "col3":"Frequency", "col4":"............", "col5":"2"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Maximum", "col2":"Trials", "col3":"Checked", "col4":"............", "col5":"10"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Damping", "col2":"Limit", "col3":"Threshold", "col4":"...........", "col5":"0.000000"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Maximum", "col2":"Trials", "col3":"....................", "col4":"40"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Quality", "col2":"Analysis", "col3":"..................", "col4":"None"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Specific", "col2":"Gravity", "col3":"..................", "col4":"1.00"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Relative", "col2":"Kinematic", "col3":"Viscosity", "col4":"......", "col5":"1.00"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Relative", "col2":"Chemical", "col3":"Diffusivity", "col4":".....", "col5":"1.00"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Demand", "col2":"Multiplier", "col3":".................", "col4":"1.00"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Total", "col2":"Duration", "col3":"....................", "col4":"20.00", "col5":"hrs"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Reporting", "col2":"Criteria:"},
{"source": "rpt_cat_result", "col40": "null", "col1":"All", "col2":"Nodes"},
{"source": "rpt_cat_result", "col40": "null", "col1":"All", "col2":"Links"},
{"source": "rpt_cat_result", "col40": "null", "col1":"Analysis", "col2":"begun", "col3":"Tue", "col4":"Jun", "col5":"02", "col6":"22:20:38", "col7":"2020"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"Hydraulic", "col2":"Status:"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"0:00:00:", "col2":"Balanced", "col3":"after", "col4":"10", "col5":"trials"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"0:00:00:", "col2":"Reservoir", "col3":"113766", "col4":"is", "col5":"filling"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"0:00:00:", "col2":"Reservoir", "col3":"113952", "col4":"is", "col5":"filling"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"0:00:00:", "col2":"Reservoir", "col3":"1101", "col4":"is", "col5":"closed"}, {"source": "rpt_hydraulic_status", "col40": "null", "col1":"0:00:00:", "col2":"Reservoir", "col3":"1097", "col4":"is", "col5":"emptying"}, {"source": "rpt_hydraulic_status", "col40": "null", "col1":"0:00:00:", "col2":"Reservoir", "col3":"111111", "col4":"is", "col5":"emptying"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"0:30:00:", "col2":"Balanced", "col3":"after", "col4":"1", "col5":"trials"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"1:00:00:", "col2":"Balanced", "col3":"after", "col4":"1", "col5":"trials"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"1:30:00:", "col2":"Balanced", "col3":"after", "col4":"1", "col5":"trials"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"2:00:00:", "col2":"Balanced", "col3":"after", "col4":"1", "col5":"trials"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"2:30:00:", "col2":"Balanced", "col3":"after", "col4":"1", "col5":"trials"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"3:00:00:", "col2":"Balanced", "col3":"after", "col4":"1", "col5":"trials"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"3:30:00:", "col2":"Balanced", "col3":"after", "col4":"1", "col5":"trials"},
{"source": "rpt_hydraulic_status", "col40": "null", "col1":"4:00:00:", "col2":"Balanced", "col3":"after", "col4":"1", "col5":"trials"}]}}'::json);
Output example
{
"status": "Accepted",
"message": {
"level": 1,
"text": "Rpt file have been imported"
},
"version": "3.4.019",
"body": {
"form": {},
"data": {
"info": {
"geometryType": "",
"values": [
{
"id": 3403,
"message": "IMPORT RPT FILE LOG"
},
{
"id": 3404,
"message": "---------------------------------"
},
{
"id": 3405,
"message": "Result id: r1"
},
{
"id": 3406,
"message": "Imported by: postgres, on 2020-08-17 01:08:18"
},
{
"id": 3407,
"message": ""
},
{
"id": 3408,
"message": "CRITICAL ERRORS"
},
{
"id": 3409,
"message": "----------------------"
},
{
"id": 3410,
"message": "Page 1 Tue Jun 02 22:20:38 2020 "
},
{
"id": 3411,
"message": "Input Data File ................... C:/Temp/a20.inp "
},
{
"id": 3412,
"message": "Number of Junctions................ 232 "
},
{
"id": 3413,
"message": "Number of Reservoirs............... 5 "
},
{
"id": 3414,
"message": "Number of Tanks ................... 0 "
},
{
"id": 3415,
"message": "Number of Pipes ................... 261 "
},
{
"id": 3416,
"message": "Number of Pumps ................... 3 "
},
{
"id": 3417,
"message": "Number of Valves .................. 2 "
},
{
"id": 3418,
"message": "Headloss Formula .................. Darcy-Weisbach "
},
{
"id": 3419,
"message": "Hydraulic Timestep ................ 0.50 hrs "
},
{
"id": 3420,
"message": "Hydraulic Accuracy ................ 0.001000 "
},
{
"id": 3421,
"message": "Status Check Frequency ............ 2 "
},
{
"id": 3422,
"message": "Maximum Trials Checked ............ 10 "
},
{
"id": 3423,
"message": "Damping Limit Threshold ........... 0.000000 "
},
{
"id": 3424,
"message": "Maximum Trials .................... 40 "
},
{
"id": 3425,
"message": "Quality Analysis .................. None "
},
{
"id": 3426,
"message": "Specific Gravity .................. 1.00 "
},
{
"id": 3427,
"message": "Relative Kinematic Viscosity ...... 1.00 "
},
{
"id": 3428,
"message": "Relative Chemical Diffusivity ..... 1.00 "
},
{
"id": 3429,
"message": "Demand Multiplier ................. 1.00 "
},
{
"id": 3430,
"message": "Total Duration .................... 20.00 hrs "
},
{
"id": 3431,
"message": "Reporting Criteria: "
},
{
"id": 3432,
"message": "All Nodes "
},
{
"id": 3433,
"message": "All Links "
},
{
"id": 3434,
"message": "Analysis begun Tue Jun 02 22:20:38 2020 "
},
{
"id": 3435,
"message": "Hydraulic Status: "
},
{
"id": 3436,
"message": "0:00:00: Balanced after 10 trials "
},
{
"id": 3437,
"message": "0:00:00: Reservoir 113766 is filling "
},
{
"id": 3438,
"message": "0:00:00: Reservoir 113952 is filling "
},
{
"id": 3439,
"message": "0:00:00: Reservoir 1101 is closed "
},
{
"id": 3440,
"message": "0:00:00: Reservoir 1097 is emptying "
},
{
"id": 3441,
"message": "0:00:00: Reservoir 111111 is emptying "
},
{
"id": 3442,
"message": "0:30:00: Balanced after 1 trials "
},
{
"id": 3443,
"message": "1:00:00: Balanced after 1 trials "
},
{
"id": 3444,
"message": "1:30:00: Balanced after 1 trials "
},
{
"id": 3445,
"message": "2:00:00: Balanced after 1 trials "
},
{
"id": 3446,
"message": "2:30:00: Balanced after 1 trials "
},
{
"id": 3447,
"message": "3:00:00: Balanced after 1 trials "
},
{
"id": 3448,
"message": "3:30:00: Balanced after 1 trials "
},
{
"id": 3449,
"message": "4:00:00: Balanced after 1 trials "
},
{
"id": 3450,
"message": ""
},
{
"id": 3451,
"message": "DETAILED USER INPUT OPTIONS"
},
{
"id": 3452,
"message": "----------------------------------------"
},
{
"id": 3453,
"message": "Quality tolerance: : 0.01"
},
{
"id": 3454,
"message": "Statistic: : NONE"
},
{
"id": 3455,
"message": "Accuracy: : 0.001"
},
{
"id": 3456,
"message": "Demand multiplier: : 1.00"
},
{
"id": 3457,
"message": "Max check: : 10.00"
},
{
"id": 3458,
"message": "Damp limit: : 0.00"
},
{
"id": 3459,
"message": "Status: : YES"
},
{
"id": 3460,
"message": "Specific gravity: : 1.00"
},
{
"id": 3461,
"message": "Demand type: : 1"
},
{
"id": 3462,
"message": "Nod2arc length: : 0.3"
},
{
"id": 3463,
"message": "Setting: : YES"
},
{
"id": 3464,
"message": "Pressure: : YES"
},
{
"id": 3465,
"message": "Quality: : YES"
},
{
"id": 3466,
"message": "Check frequency: : 2.00"
},
{
"id": 3467,
"message": "Relative diffusivity: : 1"
},
{
"id": 3468,
"message": "Emitter exponent: : 0.5"
},
{
"id": 3469,
"message": "Relative viscosity: : 1.00"
},
{
"id": 3470,
"message": "Network geometry generator: : 1"
},
{
"id": 3471,
"message": "Flow: : YES"
},
{
"id": 3472,
"message": "F Factor: : PRECISION 4"
},
{
"id": 3473,
"message": "Hydraulics: : NONE"
},
{
"id": 3474,
"message": "Length: : YES"
},
{
"id": 3475,
"message": "If unbalanced: : CONTINUE"
},
{
"id": 3476,
"message": "Pattern method: : 11"
},
{
"id": 3477,
"message": "Energy: : YES"
},
{
"id": 3478,
"message": "Valve mode: : 2"
},
{
"id": 3479,
"message": "Velocity: : YES"
},
{
"id": 3480,
"message": "Hydraulic timestemp: : 0:30"
},
{
"id": 3481,
"message": "Headloss formula: : D-W"
},
{
"id": 3482,
"message": "Duration: : 24"
},
{
"id": 3483,
"message": "Units: : LPS"
},
{
"id": 3484,
"message": "Summary: : YES"
},
{
"id": 3485,
"message": "Nodes: : ALL"
},
{
"id": 3486,
"message": "Demand scenario priority: : 1"
},
{
"id": 3487,
"message": "Additional trials: : 40.00"
},
{
"id": 3488,
"message": "Demand: : YES"
},
{
"id": 3489,
"message": "Maximum trials: : 40.00"
},
{
"id": 3490,
"message": "Quality mode: : NONE"
},
{
"id": 3491,
"message": "Diameter: : YES"
},
{
"id": 3492,
"message": "Links: : ALL"
},
{
"id": 3493,
"message": "Head: : YES"
},
{
"id": 3494,
"message": "Reaction: : YES"
},
{
"id": 3495,
"message": "Elevation: : YES"
}
]
},
"point": {
"geometryType": "Point",
"qmlPath": "",
"features": {}
},
"line": {
"geometryType": "Polygon",
"qmlPath": "",
"features": {}
},
"polygon": {}
}
}
}