Utility networks

With ArcGIS Runtime you can add the following utility network capabilities to your app:

  • Display a utility network (section below)—Visualize assets on a map and see how assets are connected.
  • Trace how resources (gas, water, electricity, and so on) flow through a utility system network. For details, see the Trace a utility network topic. To perform traces, your app must be licensed with a Utility Network extension license.
  • Get associated utility elements. Associations let you model connectivity between points that are not coincident, the structural support of assets, and features encased within other features. For details, see the Get associated utility elements section in the Trace a utility network topic.

To create, edit, manage, and configure a utility network, use ArcGIS Pro. Create it within an enterprise geodatabase, configure it, and publish it as a feature service so that it can be used in your ArcGIS Runtime app. For more information on creating utility networks, see in the utility network creation and configuration in the ArcGIS Pro documentation.

Every utility network contains at least one domain network and may contain tiers, subnetworks, and subnetwork controllers. The properties of these components define the characteristics of the subnetworks and drive tracing operations. In your ArcGIS Runtime app, you can access schema information about these components from a utility network definition object.

For more information about utility networks, see What is a utility network? in ArcGIS Pro's help.

For information about the logical structure of a utility network, see Structure of a utility network in ArcGIS Pro's help. Note that feature classes in ArcGIS Pro are similar to feature tables in ArcGIS Runtime.

Display a utility network

You can display and share a complete utility network using a web map. You should include at most one feature layer for every feature table in the utility network.

As an alternative to using a web map, you can create your own map programmatically, making use of subtype feature layers (known as subtype group layers in ArcGIS Pro and in the web map). Subtype feature layers allow symbology and other layer properties to be set on a per-subtype basis. Utility networks make extensive use of subtypes (referred to as asset groups within a utility network). For example, a device feature table from an electric utility network would include subtypes for fuses, switches, transformers, and other kinds of equipment.

Take a utility network offline

Starting with version 100.11.0, you can take certain utility network information offline. Associations, which are used to describe containment, structural attachment, and connection between features with non-coincident geometry, can be queried and displayed with offline data. Simple edits can also be made to utility network features while offline, and synchronized back to ArcGIS Enterprise.

The following code takes a web map offline that contains a utility network. The utility network tables are automatically synced with a map when a utility network is detected inside.

                                                       
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
45
46
47
48
49
50
51
52
53
54
55
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Tasks.Offline;
using System;
using System.IO;
using System.Threading.Tasks;
using System.Windows;

namespace OfflineUtilityNetwork
{
    public class TakeUtilityNetworkOffline
    {
        public async Task OfflineMapWithUtilityNetwork()
        {
            try
            {
                // This URL must be to a web map hosted on ArcGIS Enterprise 10.9 or later.
                var map = new Map(new Uri("https://my109-server.com/portal/home/item.html?id=43fa9adcc6c645d35f006cf279146604"));
                await map.LoadAsync();


                var extentJSON = "{\"xmin\":476658.0241,\"ymin\":3628705.5344,\"xmax\":478225.3088," +
                    "\"ymax\":3630175.9971,\"spatialReference\":{\"wkid\":26911,\"latestWkid\":26911}}";
                var extent = Geometry.FromJson(extentJSON) as Envelope;

                var downloadPath = Path.Combine("Data",
                    "OfflineMapWithUtilityNetwork",
                    Path.GetRandomFileName());
                Directory.CreateDirectory(downloadPath);

                var task = await OfflineMapTask.CreateAsync(map);
                var parameters = await task.CreateDefaultGenerateOfflineMapParametersAsync(extent);
                parameters.IncludeBasemap = false;

                var job = task.GenerateOfflineMap(parameters, downloadPath);

                if (job != null)
                {
                    var result = await job.GetResultAsync();

                    if (result.OfflineMap.UtilityNetworks.Count > 0)
                    {
                        var utilityNetwork = result.OfflineMap.UtilityNetworks[0];
                        await utilityNetwork.LoadAsync();
                    }
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.GetType().Name, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
}

The following code takes a utility network offline using a service geodatabase. The utility network tables only get synced when the sync mode in the generate geodatabase parameters is set to sync system tables.

                                                       
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
45
46
47
48
49
50
51
52
53
54
55
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Tasks.Offline;
using System;
using System.IO;
using System.Threading.Tasks;
using System.Windows;

namespace OfflineUtilityNetwork
{
    public class TakeUtilityNetworkOffline
    {
        public async Task OfflineGenerateGeodatabase()
        {
            try
            {
                // This URL must be to a feature service hosted on ArcGIS Enterprise 10.9 or later.
                var featureServerUrl = new Uri("https://my109-server.com/server/rest/services/TestNetwork/FeatureServer");

                var extentJSON = "{\"xmin\":473240.8686,\"ymin\":3592680.1705,\"xmax\":529008.38287," +
                    "\"ymax\":3644892.1697,\"spatialReference\":{\"wkid\":26911,\"latestWkid\":26911}}";
                var extent = Envelope.FromJson(extentJSON) as Envelope;

                var downloadPath = Path.Combine(Path.GetTempPath(),
                    "TakingUtilityNetworkOffline",
                    Path.GetRandomFileName());
                Directory.CreateDirectory(downloadPath);
                var pathToGeodatabase = Path.Combine(downloadPath, "offline_utility_network.geodatabase");

                var task = await GeodatabaseSyncTask.CreateAsync(featureServerUrl);
                var parameters = await task.CreateDefaultGenerateGeodatabaseParametersAsync(extent);
                parameters.UtilityNetworkSyncMode = UtilityNetworkSyncMode.SyncSystemTables;

                var job = task.GenerateGeodatabase(parameters, pathToGeodatabase);

                if (job != null)
                {
                    var geodatabase = await job.GetResultAsync();

                    if (geodatabase.UtilityNetworks.Count > 0)
                    {
                        var utilityNetwork = geodatabase.UtilityNetworks[0];
                        await utilityNetwork.LoadAsync();
                    }
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.GetType().Name, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
    }
}

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