SQL Example - Critical Pipes
This example shows how you can use information from your network, combined with data from GIS layers, to identify critical pipes in the network. A series of SQL statements refines a selection until we have identified the pipes that meet all the criteria. We then use SQL to set values in the selected pipes.
The example is taken from the Innovyze product InfoAsset Manager but the basic principles are relevant to whichever Innovyze product you are using.
The network and GIS data
In this example we are looking for large damaged pipes in difficult ground. Specifically we are going to select any such pipes near a hospital, as a failure in such a pipe could be a major problem.
Figure 1 shows the area of interest.
- Soil types are contained in a GIS Layer and shown in different shades of grey.
- Roads, river channels, and buildings are contained in a different GIS Layer and show up using various colours
- The underlying pipe network is not easy to see in this example, but this doesn't matter
The various roads and buildings of interest are described in the stages below.
|
The first SQL object selects a number of pipes based on the following criteria:
After an SQL object is applied to the network, any network objects that meet the criteria in the SQL statements are selected. |
|
The second SQL object refines the selection made by the first SQL object. Note that Apply Filter to Current Selection is checked. This limits the network objects to which the SQL is applied to those already selected. This is a powerful feature.
|
|
Next, we test our selected pipes to see if any of them is near a hospital. A pipe collapse near a hospital that blocked access or released wastewater in the area would probably be a major problem, and therefore repairing damaged pipes in this sort of situation will be more critical than elsewhere.
|
|
SQL Queries can be grouped together and executed automatically to make the process even more efficient. Here, the three queries described above have been placed in the same Stored Query Group. If you drag this group onto a network, all the queries it contains will be executed in alphabetical order. So, with a little care when naming the individual queries, you can create powerful, multi-step queries. |