Perform valve isolation trace

View inWPFUWPFormsiOSAndroid
View on GitHub
Sample viewer app

Run a filtered trace to locate operable features that will isolate an area from the flow of network resources.

Image of a utility network with an isolation trace applied to it

Use case

Determine the set of operable features required to stop a network's resource, effectively isolating an area of the network. For example, you can choose to return only accessible and operable valves: ones that are not paved over or rusted shut.

How to use the sample

Create and set the configuration's filter barriers by selecting a category. Check or uncheck 'Include Isolated Features'. Click 'Trace' to run a subnetwork-based isolation trace.

How it works

  1. Create a MapView.
  2. Create and load a UtilityNetwork with a feature service URL.
  3. Create a Map that contains FeatureLayer(s) that are part of this utility network.
  4. Create a default starting location from a given asset type and global id.
  5. Add a GraphicsOverlay with a Graphic that represents this starting location.
  6. Populate the choice list for the 'Filter Barrier: Category exists' from UtilityNetworkDefinition.Categories.
  7. Get a default UtilityTraceConfiguration from a given tier in a domain network. Set it's Filter with a new UtilityTraceFilter.
  8. When 'Trace' is clicked,

    • Create a new UtilityCategoryComparison with the selected category and UtilityCategoryComparisonOperator.Exists.
    • Assign this condition to TraceFilter.Barriers from the default configuration from step 7. Update this configuration's IncludeIsolatedFeatures property.
    • Create a UtilityTraceParameters with UtilityTraceType.Isolation and default starting location from step 4.
    • Set its TraceConfiguration with this configuration and then, run a UtilityNetwork.TraceAsync.
  9. For every FeatureLayer in the map, select the features returned by GetFeaturesForElementsAsync from the elements matching their NetworkSource.Name with the layer's FeatureTable.Name.

Relevant API

  • UtilityCategory
  • UtilityCategoryComparison
  • UtilityCategoryComparisonOperator
  • UtilityDomainNetwork
  • UtilityElement
  • UtilityElementTraceResult
  • UtilityNetwork
  • UtilityNetworkDefinition
  • UtilityTier
  • UtilityTraceFilter
  • UtilityTraceParameters
  • UtilityTraceResult
  • UtilityTraceType

About the data

The Naperville gas network feature service, hosted on ArcGIS Online, contains a utility network used to run the isolation trace shown in this sample.

Additional information

Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS Enterprise member account licensed with the Utility Network user type extension. Please refer to the utility network services documentation.

Tags

category comparison, condition barriers, isolated features, network analysis, subnetwork trace, trace configuration, trace filter, utility network

Sample Code

PerformValveIsolationTrace.xamlPerformValveIsolationTrace.xaml.cs
                                            
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<UserControl x:Class="ArcGISRuntime.WPF.Samples.PerformValveIsolationTrace.PerformValveIsolationTrace"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <Grid>
        <esri:MapView x:Name="MyMapView" />
        <Border HorizontalAlignment="Right" VerticalAlignment="Top" Style="{StaticResource BorderStyle}">
            <Grid x:Name="FilterOptions">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBlock Margin="5" FontWeight="Bold" Text="Choose Category for Filter Barrier:" />
                <ComboBox x:Name="Categories" Grid.Row="1" Margin="5">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <CheckBox x:Name="IncludeIsolatedFeatures" Grid.Row="2" Margin="5" Content="Include Isolated Features" />
                <Button
                    Grid.Row="1"
                    Grid.Column="2"
                    Margin="5"
                    Click="OnTrace"
                    Content="Trace" />
            </Grid>
        </Border>
        <ProgressBar
            x:Name="LoadingBar"
            Width="200"
            Height="25"
            HorizontalContentAlignment="Center"
            VerticalContentAlignment="Center"
            IsIndeterminate="True"
            Visibility="Visible" />
    </Grid>
</UserControl>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.