create

suspend fun create(utilityNetwork: UtilityNetwork, featureTable: FeatureTable, attributes: Map<String, Any?>): Result<SnapRules>

Analyzes an UtilityNetwork for the rules which allow or limit the snapping of a feature in the given featureTable with the given attributes, and returns a SnapRules which can be used to configure interactive snapping behavior in a GeometryEditor. To configure rule-based snapping, use this method to create a SnapRules that you can then pass to SnapSettings.syncSourceSettings. This method is ideal for creating SnapRules where you have a set of attributes, for example, if you are creating a new feature from a FeatureTemplate or by using a FeatureForm. Connectivity rules involving the UtilityAssetType of the feature are described by those attributes are included in the resulting rules.

Ensure that the feature tables underlying the given UtilityNetwork are the same used by operational layers in the map, so that the SnapRules are based on the same underlying data sets.

If your map view displays a web map, or is set from a MobileMapPackage, the ArcGISMap.utilityNetworks collection may already contain the relevant utility network object to use. Alternatively you may get the utility network from the same Geodatabase that backs your operational layers, or call UtilityNetwork.UtilityNetwork to create the network from a feature service URI and associate it with your ArcGISMap.

Return

A SnapRules appropriate for interactively editing the geometry of a feature in the given featureTable with the given attributes.

Since

200.7.0

Parameters

utilityNetwork

The UtilityNetwork object to analyze for its connectivity rules relating to a feature of the asset type described by the given featureTable and attributes.

featureTable

The feature table that will contain the feature whose geometry will be edited in the GeometryEditor using the returned SnapRules. Must be part of the given utilityNetwork.

attributes

The attributes for the feature whose geometry will be edited in the GeometryEditor using the returned SnapRules. The keys of this map will be treated as case insensitive.

See also

(SnapRules, SnapSourceEnablingBehavior)


suspend fun create(utilityNetwork: UtilityNetwork, assetType: UtilityAssetType): Result<SnapRules>

Analyzes an UtilityNetwork for the rules which allow or limit the snapping of the given UtilityAssetType to other features, and returns a SnapRules which can be used to configure interactive snapping behavior in a GeometryEditor. To configure rule-based snapping, use this method to create a SnapRules that you can then pass to SnapSettings.syncSourceSettings. This method is ideal for creating SnapRules when you have a reference to the UtilityAssetType, for example if you have identified an existing feature to be edited, you can call UtilityNetwork.createElement, then get UtilityElement.assetType to pass in.

Ensure that the feature tables underlying the given UtilityNetwork are the same used by operational layers in the map, so that the SnapRules are based on the same underlying data sets.

If your map view displays a web map, or is set from a MobileMapPackage, the ArcGISMap.utilityNetworks collection may already contain the relevant utility network object to use. Alternatively you may get the utility network from the same Geodatabase that backs your operational layers, or call UtilityNetwork.UtilityNetwork to create the network from a feature service URI and associate it with your ArcGISMap.

Ensure that the UtilityAssetType is from the given UtilityNetwork.

Return

A SnapRules appropriate for interactively editing the geometry of a feature of the given UtilityAssetType.

Since

200.7.0

Parameters

utilityNetwork

The UtilityNetwork object to analyze for its connectivity rules relating to the given assetType.

assetType

The asset type of the feature geometry that will be edited in the GeometryEditor. Connectivity rules involving this asset type are included in the returned SnapRules.

See also

(SnapRules, SnapSourceEnablingBehavior)