You are on page 1of 8

City of Welland Unidirectional Water Main Flushing

Shannon Graup
Steven House
Page



City of Welland Unidirectional
Water Main Flushing: Query
and Script Methodology
Shannon Graup & Steven House


City of Welland Unidirectional Water Main Flushing
Shannon Graup
Steven House
Page i
Table of Contents
List of Figures .............................................................................................................................. i
1.0 Introduction .......................................................................................................................... 1
2.0 Query Methodology .............................................................................................................. 1
2.1 Snap Points to Nearest Line Query ................................................................................... 2
2.2 Select Hydrant Query ....................................................................................................... 3
2.3 Sum of Gallons Query ...................................................................................................... 3
2.4 Minimum Flush Time Queries ........................................................................................... 3
2.5 Layout Buffer Query ......................................................................................................... 4
3.0 Script Methodology .............................................................................................................. 4
3.1 Optimal Route Script ........................................................................................................ 5
3.2 Unidirectional Flushing Form Script .................................................................................. 6

List of Figures
Figure 1 - Snap to Points Query ................................................................................................. 2
Figure 2 - Select Hydrant Query ................................................................................................. 3
Figure 3 - Sum of Gallons Query ................................................................................................ 3
Figure 4 - Minimum Flush Time for 10 PSI Query ...................................................................... 4
Figure 5 - Minimum Flush Time for 20 PSI Query ...................................................................... 4
Figure 6 - Layout Buffer Query ................................................................................................... 4
Figure 7 - Optimal Route Script .................................................................................................. 5
Figure 8 - Unidirectional Flushing Form Script ........................................................................... 6


City of Welland Unidirectional Water Main Flushing
Shannon Graup
Steven House
Page 1
1.0 Introduction
The automation for the production of an optimal flush route map and unidirectional flushing form
(UDF form) for each flushing sequence comprises the bulk of the unidirectional flushing project
for the City of Welland. To be able to automate the working GIS tool within Manifold, numerous
queries and scripts are created and utilized in order to achieve this goal.
In simple terms, queries are components that contain statements written in SQL, the database
language. Queries are executed by clicking the run button and the results are displayed. Scripts
on the other hand, are Manifold programs written in the Visual Basic.NET programming
language to execute certain tasks and functions.
For the Unidirectional Water Main Flushing project, six queries were created and are as follows:
Snap Points to Nearest Line Query
Select Hydrant Query
Sum of Gallons Query
Minimum Flushtime for 10 PSI Query
Minimum Flushtime for 20 PSI Query
Layout Buffer Query
Additionally, two scripts were written in order to execute the automated GIS tool and are as
follows:
Optimal Route Script
Unidirectional Flushing Form Script
2.0 Query Methodology
The following section outlines the queries that were created and utilized for the automation of
the working GIS tool within Manifold for the unidirectional water main flushing project.







City of Welland Unidirectional Water Main Flushing
Shannon Graup
Steven House
Page 2
2.1 Snap Points to Nearest Line Query
When analyzing the points within the drawings, they appear to be located and connected to the
line for which the point overlays. The points in question, refer to the hydrants and valves located
in the Active_Water_Mains drawing. Upon closer inspection of the points, they are in fact not
connected to these lines. In order to snap the points to the nearest line, a query is created in
order to achieve this function. The query, entitled Snap Points to Nearest Line, snaps each point
(hydrants and valves) in their respective drawings to the nearest location on the nearest line in
the Active_Water_Mains drawing. By doing this, these points can then be utilized when scripting
to automate the GIS tool. The Snap Points Query can be seen in Figure 1 below. For the full
query, check the qry_SnapPoints file, located in the Query folder within Manifold 8.0.

Figure 1 - Snap to Points Query


City of Welland Unidirectional Water Main Flushing
Shannon Graup
Steven House
Page 3
2.2 Select Hydrant Query
For pipe segments to be flushed, a hydrant needs to be identified as the finish point within the
flush sequence. Therefore, the hydrant ID must be identified and added to the unidirectional
flushing (UDF) form. The Select Hydrant Query, seen in Figure 2 below, selects the hydrant ID
from the Active_Water_Mains drawing for each pipe segment to be flushed.

Figure 2 - Select Hydrant Query
2.3 Sum of Gallons Query
For each flush sequence, the sum of gallons to flush must be calculated and added to the
unidirectional flushing (UDF) form. In order to determine the sum of gallons to flush for each
flush sequence, the total gallons of water needed to flush each individual pipe segment within
the study area must be calculated and added to the Active_Water_Mains attribute table in a
column entitled VolumeGallons. The Sum of Gallons Query, seen in Figure 3 below, selects
the total gallons from the Active_Water_Mains drawing and sums the total volume in gallons for
multiple pipes to be flushed for each pipe flush sequence.

Figure 3 - Sum of Gallons Query
2.4 Minimum Flush Time Queries
For each pipe flush sequence, the minimum flush times for two different host speeds need to be
calculated. These two different speeds are 10 psi and 20 psi. These minimum flush times
represent the amount of time that it will take to fully flush each flush sequence within the study
area. The Minimum Flush Time for 10 PSI & 20 PSI Queries can be seen in Figure 4 and Figure
5 on the following page and they calculate the minimum flush time for each pipe flush at 10 psi
and 20 psi respectively.
City of Welland Unidirectional Water Main Flushing
Shannon Graup
Steven House
Page 4

Figure 4 - Minimum Flush Time for 10 PSI Query

Figure 5 - Minimum Flush Time for 20 PSI Query
2.5 Layout Buffer Query
For each flush sequence map layout, an appropriate scale needs to be added in order to view
all the necessary data. This includes the flush sequence route, the hydrant ID to be flushed, and
all the associated valves that need to be opened or closed during and after the flush sequence.
The Layout Buffer Query, seen in Figure 6 below, sets a buffer bounding box around the route
in the route drawing to be flushed so it can be viewed at an appropriate map scale.

Figure 6 - Layout Buffer Query
3.0 Script Methodology
The following section outlines the scripts that were created and utilized for the automation of the
working GIS tool within Manifold for the unidirectional water main flushing project.

City of Welland Unidirectional Water Main Flushing
Shannon Graup
Steven House
Page 5
3.1 Optimal Route Script
The optimal route script is utilized in order to create a map layout of the user selected pipe flush
sequence. This script will produce the map layout of the optimal flush route at an appropriate
viewing scale and will include the necessary components such as the hydrant ID to be flushed
and the open and close valves associated with each pipe flush. The optimal route script, seen in
Figure 7 below, analyzes the optimal route on a line network between a start and end point. The
route line itself is copied and added into a drawing called Route. For the full script, check the
Optimal_Route Script file located in the Scripts folder within Manifold 8.0.

Figure 7 - Optimal Route Script


City of Welland Unidirectional Water Main Flushing
Shannon Graup
Steven House
Page 6
3.2 Unidirectional Flushing Form Script
This piece of script is utilized after the optimal route script has been run. After the optimal route
script has been run and the user selected pipe flush sequence has been displayed on the map
layout, the necessary data values will need to be added to the unidirectional flushing (UDF)
form. By running the unidirectional flushing form script, the necessary data values such as the
flush hydrant ID, the total gallons to flush, and the minimum flush times for 10 psi and 20 psi are
identified and added to the UDF form. The Unidirectional Flushing Form Script can be seen in
Figure 8 below. For the full script, check the Unidirectional Flushing Form Script in the Scripts
folder within Manifold 8.0.

Figure 8 - Unidirectional Flushing Form Script

You might also like