ArcGIS Blog

Developers

ArcGIS Utility Network

Offline Utility Networks in ArcGIS Maps SDKs for Native Apps: Part 4

By Rich Ruh

The ArcGIS Utility Network is Esri’s next generation network management technology, built to document and analyze networks for electric, gas, water, and wastewater utilities. Over time, we have been adding additional utility network capabilities to the ArcGIS Maps SDKs for Native Apps and documenting them in a series of blog posts. Today, we’re happy to announce full support for offline editing and tracing, along with the ability to synchronize edits back to ArcGIS Enterprise.

Offline tracing was documented in Part 1 of this blog series. Part 2 shared how we could take utility networks offline, while Part 3 announced some additional offline tracing capabilities. At the time these posts were published, users were forced to choose between editing and tracing while offline. That choice is no longer required- you can do both! You can now edit, trace, and sync using the same offline geodatabase. In addition, we’ve also added the ability to synchronize network changes from the server to a mobile client for users who want to trace but not edit.

In this part four, we’ll walk through how to support the following workflows using version 200.6 of the Native Maps SDK along with ArcGIS Enterprise 11.3:

  • Edit and trace offline
  • Trace offline (read-only)

Finally, we’ll also show how you determine the sync capabilities of a connected server.

For these examples, we’ll be providing code snippets written in C# using the ArcGIS Maps SDK for .NET, but the concepts apply to the Qt, Swift, and Kotlin Maps SDKs.

Edit and Trace Offline

Configuring a utility network’s offline capability has evolved since the process was explained in Part 2 of this series. With version 200.6 of the Native Maps SDKs, utility networks can now be edited offline in a mobile geodatabase and synchronized back to an ArcGIS Enterprise 11.3 feature service. Changes made on the client app can be uploaded to the feature service, and changes made on the feature service can be downloaded to the client app.

Setting up your server environment

As mentioned above, the offline workflows described in this blog post require ArcGIS Enterprise 11.3. In addition, it’s important that you install the ArcGIS Server 11.3 Offline Utility Network Patch 1.

Note that ArcGIS Enterprise 11.4 is not a supported Network Management release and does not contain some of the enhancements included in the offline patch. Future Network Management releases will also support all the workflows described in this post.

Creating a syncable utility network feature service

ArcGIS Utility Network users are already familiar with the process to create a feature service that contains a utility network. Doing so is a prerequisite for using enterprise data in the ArcGIS Pro desktop product. There are some special considerations when creating a feature service that can be taken offline.

  1. Make sure to include the service territory layer in the publishing map. This layer is not automatically added when you add a utility network to the map but is required for using sync.
  2. Before publishing, enable replica tracking on each layer in the publishing map. This can be accomplished by using the Enable Replica Tracing geoprocessing tool or right clicking the dataset in the Catalog pane in ArcGIS Pro, clicking Manage, and then clicking Replica Tracking.
  3. When configuring the Feature Properties during the publishing process, make sure to check the Enable Sync and Create a version for each downloaded map options, as shown in the screenshot below.

 

Screenshot of configuration settings in ArcGIS Pro to publish a syncable feature service
Configuration settings in ArcGIS Pro to publish a syncable feature service

Downloading your utility network with the Native Maps SDKs

The code to download the replica to your device is mostly the same as before. Using a web map that contains a utility network, you would use the OfflineMapTask as shown below:

var task = await OfflineMapTask.CreateAsync(map); 
var parameters = await task.CreateDefaultGenerateOfflineMapParametersAsync(areaOfInterest); 
var job = task.GenerateOfflineMap(parameters, downloadDirectoryPath); 
var result = await job.GetResultAsync(); 
mapView.Map = result.OfflineMap;

Similar code can be used with the GeodatabaseSyncTask.

Editing your utility network

Once your mobile geodatabase replica has been created, it can be edited as usual. If your map contains a dirty area layer, you’ll see dirty areas created by network edits. These dirty areas can be cleaned up using the same validate network topology routines that were described in the 2024 recap of utility network enhancements in the Native Maps SDKs blog. Attribute, feature, and even association edits are all supported.

At the time of publishing this blog, attribute rules are not included in offline mobile geodatabases, but this capability will be added with the forthcoming ArcGIS Enterprise 11.5.

Tracing your utility network

All the online tracing capabilities are supported while offline. Note that if a trace is impacted by a dirty area, and the ValidateConsistency trace configuration option is set to true, an error is returned. You can fix that error by removing the dirty areas by calling validate network topology– the same as users do in ArcGIS Pro.

Synchronizing your edits with the server

There are two things to be aware of when synchronizing data with the server.

First, your offline mobile geodatabase is connected to a dedicated branch version on the server. This version must be reconciled with the default version for changes posted to the default version to be downloaded to the client on the next sync. There’s two ways to do this:

  • Create a server-side process that reconciles from default to each replica version, perhaps as part of an overnight process that runs update subnetwork or other administration tasks.
  • Execute a reconcile automatically when doing a sync operation. This is accomplished by setting the ReconcileBranchVersion parameter.

The following code sample demonstrates how to synchronize a replica with a reconcile.

var task = await OfflineMapSyncTask.CreateAsync(map);
var parameters = await task.CreateDefaultOfflineMapSyncParametersAsync();
parameters.SyncDirection = SyncDirection.Bidirectional; // Upload orDownload 
parameters.ReconcileBranchVersion = true; 

var job = task.SyncOfflineMap(parameters); 
var result = await job.GetResultAsync(); 
if (result.HasErrors) { 
    // inspect Layer/Table results for errors 
}

The second thing to realize is that when server-side edits are brought down to your mobile geodatabase, these edits are replayed locally. As with any network edit, these will result in the creation of dirty areas. Depending on the type of user workflows you are supporting in your application, you may wish to validate network topology after a sync operation.

The ArcGIS Enterprise online documentation has more information about creating replicas and synchronizing with branch versioning.

How about working with offline maps created with Portal for ArcGIS?

Unfortunately, the capabilities described in this post are currently only supported with ad-hoc or on-demand workflows. Ahead-of-time workflows, where you create an offline map using Portal for ArcGIS, will be supported with ArcGIS Enterprise 11.5, shipping in mid-2025. Until then, this support remains as described in the 2024 utility network recap blog post.

Trace Offline (read-only)

The scenarios above work great for users who want to edit and trace utility network data. But not every mobile user needs to edit. Many utility field tasks require the ability to trace but not to edit network features.

Editing a utility network, which includes running validate network topology, requires the Advanced Editing extension, enabled through a portal user configured with the Advanced Editing User Type Extension (UTE) or a Runtime license string. Can read-only applications allow tracing without the need for this additional license? Yes!

The key is to set up a second read-only utility network feature service. Create this second service as follows:

  • Use the same publishing map as you use for your primary utility network service
  • Give the feature service a name that identifies it as non-editable (or download-only).
  • Use the same underlying enterprise geodatabase
  • Turn off the option in Feature Properties that enables editing, as shown in the screenshot below:
Screenshot showing how to create a read-only feature service using ArcGIS Pro
Creating a read-only feature service using ArcGIS Pro

Alternatively, you can publish the exact same way you usually do and turn off editing by using the Server Manager site for ArcGIS Server. Under Services > Site(root), stop the service intended for download-only sync by clicking the square icon to the far-right of the services, name, then click the name of the feature service to access its properties. Under Capabilities, click Feature Access (the words, not the checkbox). The Operations Allowed section will appear below, presenting six options. Uncheck all options related to feature editing: Create, Delete, and Update. This section should now match the following image:

Screenshot showing how to configure a read-only feature service using the Server Manager site in ArcGIS Server
Configuring a read-only feature service using the Server Manager site in ArcGIS Server

Your app can use this read-only feature service and keep the features and network up-to-date with a download-only sync. Notably, although the mobile geodatabase cannot be edited by the user, it will be updated with changes that are brought down by the server. In addition, after these edits are applied locally, the synchronize routine will automatically call validate network topology. This clears out the dirty areas and allows continued tracing. All without the extra Advanced Editing Extension.

The code to create a replica that uses download-only sync is almost identical to the synchronization sample above. The only difference is to change this line:

parameters.SyncDirection = SyncDirection.Bidirectional; // Upload or Download

to this

parameters.SyncDirection = SyncDirection.Download; // Download only

Sync Capabilities

There are now a few different ways that utility networks can be taken offline with the Native Maps SDK. Your software may need to work with different services that have different capabilities. We’ve extended the SyncCapabilities class to help you determine the capabilities of a connected server.

From an instance of ServiceGeodatabase, use the ServiceInfo property to obtain an ArcGISFeatureServiceInfo object. This object, in turn, contains a SyncCapabilites property that returns an object of type SyncCapabilities. There are four properties on this class that are useful for utility network applications, the latter three of which were added to 200.6 of the Native Maps SDKs.

Property Meaning
SupportsUtilityNetworkSystem Indicates whether the server can create a replica with partial utility network information. These replicas were covered in previous blog posts, and support editing but not tracing.
SupportsUtilityNetworkTopology Indicates whether the server can create a replica that supports tracing. The replica might not support editing or sync.
SupportsUtilityNetworkTopologySync Indicates whether the server can create a replica that supports tracing, editing, and sync.
SupportsUtilityNetworkTopologySyncDownloadOnly Indicates whether the server can create a read-only syncable replica.

Conclusion

Version 200.6 of the ArcGIS Maps SDKs for Native Apps provides significantly improved offline utility network capabilities. The ability to sync changes from ArcGIS Enterprise allows developers to build customized apps for mobile field workers to access the latest network data without requiring a full download. Being able to edit and see the impact of those edits by performing a trace allows workers to perform “what if” analysis out in the field. And of course, the ability to send edits back to the enterprise allows writing applications that support as-builting in the field or even full design.

We’d love to hear your feedback – join the discussion on the Esri Community forums or visit us at the upcoming Esri Developer & Technology Summit. Your feedback helps us improve and shape future releases, and we’d love to hear your thoughts, ideas and questions.

Share this article