Skip to content

Latest commit

 

History

History

Display utility associations

Create graphics for utility associations in a utility network.

Image of display utility associations

Use case

Visualizing utility associations can help you to better understand trace results and the topology of your utility network. For example, connectivity associations allow you to model connectivity between two junctions that don't have geometric coincidence (are not in the same location); structural attachment associations allow you to model equipment that may be attached to structures; and containment associations allow you to model features contained within other features.

How to use the sample

Pan and zoom around the map. Observe graphics that show utility associations between junctions.

How it works

  1. Create and load a UtilityNetwork with a feature service URL.
  2. Add a FeatureLayer to the map for every UtilityNetworkSource of type Edge or Junction.
  3. Create a GraphicsOverlay for the utility associations.
  4. Add an event handler for the ViewpointChanged event of the MapView.
  5. When the sample starts and every time the viewpoint changes, do the following steps.
  6. Get the geometry of the mapview's extent using GetCurrentViewpoint(ViewpointType.BoundingGeometry)?.TargetGeometry?.Extent.
  7. Get the associations that are within the current extent using GetAssociationsAsync(extent).
  8. Get the UtilityAssociationType for each association.
  9. Create a Graphic using the Geometry property of the association and a preferred symbol.
  10. Add the graphic to the graphics overlay.

Relevant API

  • GraphicsOverlay
  • UtilityAssociation
  • UtilityAssociationType
  • UtilityNetwork

About the data

The feature service in this sample represents an electric network in Naperville, Illinois, which contains a utility network used to run the subnetwork-based trace.

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

associating, association, attachment, connectivity, containment, relationships