## 2 Materials and Methods
### Phase 1: GIS Application  
In this study, WDN for the City of Sharjah, UAE, was used to demonstrate the applicability of the model. Sharjah Electricity and Water Authority (SEWA) manages the desalination plants and WDN in the City of Sharjah. The WDN consists of more than 4000 km of pipe networks. Figure 1 illustrates a map of SEWA's WDN that was used for the GIS-based model for the leak detection system. Most of the pipes were made of asbestos-cement pipes. The SEWA installed many sensors throughout the large WDN to monitor the hydraulic and water quality parameters to ensure enough water is available in good quality.  
SEWA installed sensors in the WDN capable of monitoring real-time hydraulic and general water quality parameters. Potential leaks can cause drops in parameters like pressure, flow, and water quality. In addition, the larger the number of joints along a pipe length, the more likely it is for there to be a leak. In large WDNs like Sharjah, it is difficult to differentiate leaks from other sources of parameter fluctuations. Therefore, spatial variability maps were generated in GIS for pressure, flow, and water quality parameters such as pH, conductivity, and chlorine residuals. The spatial variability maps were used to identify parts of the WDN where large drops of pressure, flow, and chlorine residuals occur. It is assumed that locations with high drops in pressure, flow, and chlorine residuals may indicate potential leakages. Three conditioning factors were represented as raster layers on the ArcGIS Pro 3.2 software: pressure, flow, and chlorine residual.  
The ArcGIS Pro software was used in this phase. The flow chart illustrated in Figure 2 shows the values of the three parameters--flow, pressure, and water quality--at a set of locations during any period. This data was provided by SEWA. The real-time data is continuous, and the software is expected to run analysis as data is provided. Initially, the flow and pressure parameters in different regions undergo overlay analysis. An overlay analysis carries through all the attributes of the features taking part in the overlay and creates a new polygon dataset. The data set provided ten locations (regions) in Sharjah and tabulated thirty readings for pressure and flow data for each location, and the average value was calculated for each of those data sets. Any individual value lower than the average of the data set is suspected of containing a leak. Each value indicating a drop in pressure or flow along the pipe was overlaid in the software, and this either created new overlaying regions or no regions at all. In the case where there are no overlaying regions among the two parameters, there is no need to analyze the water quality values, and the conclusion is that there are no leaks detected in the given set of locations at a particular time. In the second case, where there are one or more overlaying regions formed among pressure and flow drops, these overlaying regions are merged with locations that indicate drops in chlorine residual values. Afterwards, there is no new overlaying region, which indicates that there were no leaks in that location at a certain time or that new overlaying regions had formed. If one or more new overlaying regions are generated, then the conclusion is that those locations do have leaks. The proposed methodology uses ArcGIS Pro as well as a module builder based on Python code (Appendix A) to identify leakage locations.  
Figure 1: Water distribution network of Sharjah Electricity and Water Authority.