Utility network

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.

You can use display filters to show and hide features inside containers, replicating the functionality available in ArcGIS Pro to show or hide containment association content. You can also use display filters to ensure that critical network features are returned in a trace result even if they are removed from view to simplify the display. For more information, see display filters in feature layers.

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.

Expand
Use dark colors for code blocksCopy
                                                                                       
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
            //instantiate the offline map task with the web map
            self.offlineMapTask = AGSOfflineMapTask(onlineMap: (self.map)!)

            //retrieve the default offline map parameters for an area of interest
            self.offlineMapTask.defaultGenerateOfflineMapParameters(withAreaOfInterest: areaOfInterest) { [weak self] (parameters: AGSGenerateOfflineMapParameters?, error: Error?) in
                guard let parameters = parameters, let self = self else {return}
                if let error = error {
                    print(error.localizedDescription)
                    return
                }

                parameters.includeBasemap = false

                //create the offline map job
                self.offlineMapJob = self.offlineMapTask.generateOfflineMapJob(with: parameters, downloadDirectory: self.downloadDirecory)

                //start the offline map job
                self.offlineMapJob.start(statusHandler: nil) { [weak self] (result, error) in
                    guard let _ = self else {return}
                    if let error = error {
                        print(error.localizedDescription)
                        return
                    }

                    if let result = result {
                        //access the first utility network in the offline map
                        if let utilitynetwork = result.offlineMap.utilityNetworks.firstObject as? AGSUtilityNetwork {
                                utilitynetwork.load(completion: { error in
                                    print(utilitynetwork.name)
Expand

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.

Expand
Use dark colors for code blocksCopy
                                                                                    
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
            //instantiate the geodatbase sync task with a feature service hosted on ArcGIS Enterprise 10.9 or later.
            self.geodatabaseSyncTask = AGSGeodatabaseSyncTask(url: self.featureServiceURL)

            //retrieve the default parameters for the geodatabase sync task for an area of interest
            self.geodatabaseSyncTask.defaultGenerateGeodatabaseParameters(withExtent: areaOfInterest) { [weak self] (parameters: AGSGenerateGeodatabaseParameters?, error: Error?) in
                if let error = error {
                    print(error.localizedDescription)
                    return
                }
                guard let self = self else {return}
                if let parameters = parameters {
                    parameters.utilityNetworkSyncMode = .syncSystemTables

                    //create the generate geodatabase job
                    self.generateGeodatabaseJob = self.geodatabaseSyncTask.generateJob(with: parameters, downloadFileURL: self.downloadFileURL)

                    //start the generate geodatabase job
                    self.generateGeodatabaseJob.start(statusHandler: nil, completion: { [weak self] (geodatabase, error) in
                        guard let self = self else {return}
                        if let error = error {
                            print(error.localizedDescription)
                            return
                        }
                        self.offlineGeodatabase = geodatabase

                        //load the geodatabase and access its first utility network
                        self.offlineGeodatabase.load { error in
                            guard let utilityNetwork = self.offlineGeodatabase.utilityNetworks.first else { return }
                            print(utilityNetwork.name)
Expand

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