ArcGIS Utility Network

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

Code example for this blog is written in C# using ArcGIS Maps SDK for .NET but all the concepts apply to Java, Kotlin, Qt, and Swift.

The capabilities of the ArcGIS Utility Network in mobile and offline applications continues to grow with every release, and the ArcGIS Maps SDKs for Native Apps (formerly known as ArcGIS Runtime SDKs) have always been the best way for developers to access these capabilities on native devices across multiple platforms.

In part 1 of this series, we announced the availability of offline tracing in the Native Maps SDKs with stand-alone mobile geodatabases which can be sideloaded onto the device for use within native apps. Here, in part 2, we will cover how the 200.1 release of the Native Maps SDKs and ArcGIS Enterprise 11.1 enables your application to download a utility network and trace offline. That’s right, you can now generate a read-only mobile geodatabase with a utility network that is traceable using the same offline tracing functionality available in stand-alone mobile geodatabases.

This article covers the following topics:

Check out the third part of this blog series, where we cover how the 200.1 release of the Native Maps SDKs has grown in offline tracing functionalities for utility networks in mobile geodatabases.

What’s new with service-based utility networks

Offline tracing capabilities have been available with stand-alone mobile geodatabases since ArcGIS Pro 2.7. While this was a great first step, many customers have been waiting for the ability to use these capabilities in offline workflows with ArcGIS Enterprise. Two new patches for ArcGIS Enterprise 11.1 enable tracing capabilities on utility networks in a sync-enabled mobile geodatabase for developers using Native Maps SDKs who wish to build their own custom applications:

With these patches applied, the web map portal item’s advanced offline capabilities are displayed. The three options in the screenshot below determine the sync mode for the utility network.

The web map portal item’s advanced offline capabilities with trace utility network features option selected.

You can choose one of the following options that best fits your application needs. In this section, we will review the different ways you can take your utility network data offline from a connected environment and how this affects the utility network capabilities of your app while working in a disconnected environment.

Simple Features (UtilityNetworkSyncMode.None)

For basic data collection applications without access to utility network functionality, such as pole inspections, your best option is to remove the utility network from your map before taking the map offline or change the sync mode to UtilityNetworkSyncMode.None. The Only include simple features option ensures that only simple features are synced to your application. While these features don’t support advanced capabilities like query associations or tracing, the resulting applications can do simple edits and synchronize edits back to ArcGIS Enterprise.

Editable Utility Network (UtilityNetworkSyncMode.SystemTables)

What if you are creating a basic data collection application, but you need to know which transformers are mounted on a pole or contained in a substation? In this case, you would want to change the sync mode to the UtilityNetworkSyncMode.SystemTables option. The Edit utility network features option creates a sync-enabled mobile geodatabase that is editable. It has the capability to view and query utility network associations but does not allow any tracing.

Traceable Utility Network (UtilityNetworkSyncMode. SyncSystemAndTopologyTables)

What do you do if you want to have an application that needs to trace while offline? With the new Trace utility network features option, you can generate a read-only mobile geodatabase with a utility network that is traceable with the same offline tracing functionality available in stand-alone mobile geodatabases using both ad-hoc approaches and named trace configurations. This option also allows you to view and query utility network associations but does not allow editing.

How to configure the utility network’s offline capability

As you can see, the functionality and capabilities needed for your offline utility network not only dictates how you build your application, but also how you configure the services and maps for your application. In this section we will review the general process when preparing to create an offline-capable application.

To see and configure offline capabilities for the utility network under the web maps portal item’s settings, you need to complete the following:

  1. Install or update to ArcGIS Enterprise 11.1.
  2. Install the following ArcGIS Server 11.1 patches:
  3. Enable Replica Tracking on the feature dataset containing the utility network
  4. Update the config.js file to enable the utility network offline options on your ArcGIS Enterprise Portal.
    1. Find the Home App config.js file in your Portal installation directory.
    2. This can typically be found at the following location: C:\Program Files\ArcGIS\Portal\framework\webapps\arcgis#home\js\arcgisonline.
    3. Using a standard text editor, find the line that reads utilNetworkOfflineOptionsEnabledand change its value from false to true.
    4. Restart Portal for ArcGIS Enterprise.
  5. Publish an ArcGIS Enterprise 11.1 feature service with a Utility Network
  6. Create and share a web map with ArcGIS Pro or Map Viewer
    • When using ArcGIS Pro, adding the feature service to the map view will enable the Utility Network tab. This confirms that your map contains a utility network.
    • When using Map Viewer, adding the feature service to the map view makes the utility network available for adding to your map. You then need to go to Map properties, expand the Utility networks menu and click the button with a plus (+) icon to add this utility network to your map.
  7. On the ArcGIS Enterprise portal, go to the Settings tab of the map’s item page
    • Click the Offline tab, toggle to enable offline mode
    • Click Advanced Options button and scroll down to Offline Capabilities for Utility Network section.

Utility network in a web map

With this web map, you can use an OfflineMapTask to take your utility network data offline. The offline capability option selected above will determine whether a utility network is created and whether it is editable or traceable. With the Trace utility network features option selected above the UtilityNetworkSyncMode is set to SyncSystemAndTopologyTables.

For web maps with area of interest that can be specified on-demand, you can learn how to download an offline map (on-demand) with the Native Maps SDKs and explore generate offline map and generate offline map (overrides) samples.

For web maps with the area of interest that is already defined ahead-of-time, you can learn how to download an offline map (ahead of time) with the Native Maps SDKs and explore download preplanned map area. A web map with a traceable utility network only supports download and replace. You can use the web map portal item’s modified date to determine whether a newer version of the data is available so you can download a fresh copy of the mobile geodatabase.

You can read more about ahead-of-time vs on-demand web maps in our developer documentation. Ahead-of-time approach have the advantage of faster download and greater scalability on the server since map areas have been generated already. Keep in mind that like any item setting, a change in utility network offline capability is picked-up only when the map area is re-created. “Trace utility network features” option will download and replace your map. Scheduled updates are not supported at this time. See Create and manage offline map areas prepared ahead of time for more information.

Utility network in a feature service

When working directly with an ArcGIS Enterprise 11.1 feature service that contains a utility network, you can use a GeodatabaseSyncTask. By default, feature services that are taken offline generate a sync-enabled mobile geodatabase with simple features (UtilityNetworkSyncMode.None). This means that the utility network in your feature service will not be included. You can set this property to UtilityNetworkSyncMode.SyncSystemAndTopologyTables to get a traceable utility network or UtilityNetworkSyncMode.SyncSystemTables to get an editable utility network.

When requesting a traceable utility network, you need to also set SyncModel to None because synchronizing a replica mobile geodatabase with this property is not yet supported. Support for syncing will come in future releases of ArcGIS Enterprise and the Native Maps SDKs.

You need to make sure that the area of interest you select for GeodatabaseSyncTask, OfflineMapTask, or preplanned map area completely contains all the features within the subnetworks you want to trace offline; otherwise, you may get unexpected subnetwork trace results. In addition, consider using a basemap that matches the spatial reference of your utility network so that function results are in the same units of measurement as your data.

What’s Next

The evolution of using offline utility networks with the ArcGIS Maps SDKs for Native Apps continues. Future versions of ArcGIS Enterprise and the Native SDKs will support editing, as well as both download-only and bidirectional sync while also allowing you to have access to the full capabilities of the ArcGIS Utility Network.

We remain committed to bringing full support for utility networks to your apps so that this can be leveraged when working in a fully disconnected environment. We encourage you to visit the utility network section in our developers guide where you will find that displaying a utility network, performing analysis and tracing require no distinction – whether online or offline – once a utility network is created.

Don’t forget to check out part 3 of this series, where we share the new tracing workflows that are now available for utility networks in mobile geodatabases!

You can find more code examples and additional documentation in the developer guides for the ArcGIS Maps SDK for Native Apps pages:

You can also learn more about using the ArcGIS Maps SDK for Native Apps with the ArcGIS Utility Network by watching these sessions from the 2023 Esri Developer’s Summit:

About the author

Jennifer Nery is a senior API Developer for the ArcGIS Maps SDK for .NET with over 14 years of experience in designing and developing APIs, toolkits, samples, and applications for desktop and mobile. Jennifer actively participates in the full development of utility networks, enhancement of feature layers, expanding support for branch versioning and session management, and is passionate about seeing these awesome features come to life for developers in ArcGIS Maps SDK for Native Apps!

Notify of
Inline Feedbacks
View all comments

Next Article

New version of the ArcGIS Pro Performance Assessment Tool (PAT) is now available!

Read this article