You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Shared/Samples/Snap geometry edits with utility network rules/README.md
+11-17Lines changed: 11 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,37 +2,31 @@
2
2
3
3
Use the Geometry Editor to edit geometries using utility network connectivity rules.
4
4
5
-

5
+

6
6
7
7
## Use case
8
8
9
9
A field worker can create new features in a utility network by editing and snapping the vertices of a geometry to existing features on a map. In a gas utility network, gas pipeline features can be represented with the polyline geometry type. Utility networks use geometric coincident-based connectivity to provide pathways for resources. Rule-based snapping uses utility network connectivity rules when editing features based on their asset type and asset group to help maintain network connectivity.
10
10
11
11
## How to use the sample
12
12
13
-
To edit a geometry, tap a point geometry to be edited in the map to select it. Then edit the geometry by clicking the button to start the geometry editor.
13
+
To edit a geometry, tap a feature on the map to select it and press the edit button to start the geometry editor.
14
14
15
-
Snap sources can be enabled and disabled. Snapping will not occur when `SnapRuleBehavior.RulesPreventSnapping` even when the source is enabled.
15
+
Tap the "Snap Sources" button to view and enable/disable the snap sources. To interactively snap a vertex to a feature or graphic, ensure that snapping is enabled for the relevant snap source, then drag a vertex to nearby an existing feature or graphic. If the existing feature or graphic has valid utility network connectivity rules for the asset type that is being created or edited, the edit position will be adjusted to coincide with (or snap to) edges and vertices of its geometry. Tap to place the vertex at the snapped location. Snapping will not occur when `SnapRuleBehavior.rulesPreventSnapping` even when the source is enabled.
16
16
17
-
To interactively snap a vertex to a feature or graphic, ensure that snapping is enabled for the relevant snap source, then move the mouse pointer or drag a vertex to nearby an existing feature or graphic. If the existing feature or graphic has valid utility network connectivity rules for the asset type that is being created or edited, the edit position will be adjusted to coincide with (or snap to) edges and vertices of its geometry. Click or release the touch pointer to place the vertex at the snapped location.
18
-
19
-
To discard changes and stop the geometry editor, press the discard button.
20
-
21
-
To save your edits, press the save button.
17
+
To discard changes and stop the geometry editor, press the cancel button. To save your edits, press the save button.
22
18
23
19
## How it works
24
20
25
-
1. Create a map with `LoadSettings.FeatureTilingMode`set to `EnabledWithFullResolutionWhenSupported`.
21
+
1. Create a map and use its `loadSettings` to set `featureTilingMode`to `enabledWithFullResolutionWhenSupported`.
26
22
2. Create a `Geodatabase` using the mobile geodatabase file location.
27
23
3. Display `Geodatabase.featureTables` on the map using subtype feature layers.
28
-
4. Create a `GeometryEditor` and connect it to the map view.
24
+
4. Create a `GeometryEditor` and connect it to a `MapView`.
29
25
5. When editing a feature:
30
-
31
-
a. Call `SnapRules.CreateAsync(UtilityNetwork, UtilityAssetType)` to get the snap rules associated with a given `UtilityAssetType`.
32
-
33
-
b. Use `SyncSourceSettings(SnapRules, SnapSourceEnablingBehavior.setFromRules)` to populate the `SnapSettings.SourceSettings` with `SnapSourceSettings` enabling the sources with rules.
34
-
35
-
6. Start the geometry editor with an existing geometry or `GeometryType.Point`.
26
+
1. Create a `UtilityAssetType` for the feature with `UtilityNetwork.makeElement(arcGISFeature:terminal:)` using the utility network from the geodatabase.
27
+
2. Call `SnapRules.rules(for:assetType:)` to get the snap rules associated with the utility asset type.
28
+
3. Use `SnapSettings.syncSourceSettings(rules:sourceEnablingBehavior:)` passing in the snap rules and `SnapSourceEnablingBehavior.setFromRules` to populate the `SnapSettings.sourceSettings` with `SnapSourceSettings`.
29
+
6. Start the geometry editor with the feature's geometry or a `Point` geometry type.
36
30
37
31
## Relevant API
38
32
@@ -52,7 +46,7 @@ To save your edits, press the save button.
52
46
53
47
## About the data
54
48
55
-
The [Naperville gas network](https://www.arcgis.com/home/item.html?id=0fd3a39660d54c12b05d5f81f207dffd) mobile geodatabase contains a utility network with a set of connectivity rules that can be used to perform geometry edits with rules based snapping.
49
+
This sample downloads the [NapervilleGasUtilities](https://www.arcgis.com/home/item.html?id=0fd3a39660d54c12b05d5f81f207dffd)item from *ArcGIS Online* automatically. The Naperville gas utilities mobile geodatabase contains a utility network with a set of connectivity rules that can be used to perform geometry edits with rule-based snapping.
0 commit comments