Create graphics for utility associations in a utility network.
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.
Pan and zoom around the map. Observe graphics that show utility associations between junctions.
- Create and load a
UtilityNetwork
with a feature service URL. - Add a
FeatureLayer
to the map for everyUtilityNetworkSource
of typeEdge
orJunction
. - Create a
GraphicsOverlay
for the utility associations. - Add an event handler for the
ViewpointChanged
event of theMapView
. - When the sample starts and every time the viewpoint changes, do the following steps.
- Get the geometry of the mapview's extent using
GetCurrentViewpoint(ViewpointType.BoundingGeometry)?.TargetGeometry?.Extent
. - Get the associations that are within the current extent using
GetAssociationsAsync(extent)
. - Get the
UtilityAssociationType
for each association. - Create a
Graphic
using theGeometry
property of the association and a preferred symbol. - Add the graphic to the graphics overlay.
- GraphicsOverlay
- UtilityAssociation
- UtilityAssociationType
- UtilityNetwork
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.
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.
associating, association, attachment, connectivity, containment, relationships