Skip to content

Commit 770e65b

Browse files
committed
Update readme.
1 parent cd74dd1 commit 770e65b

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

Shared/Samples/Snap geometry edits with utility network rules/README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,31 @@
22

33
Use the Geometry Editor to edit geometries using utility network connectivity rules.
44

5-
![Image of snapping](SnapGeometryEditsWithUtilityNetworkRules.jpg)
5+
![Screenshot of Snap geometry edits with utility network rules sample](snap-geometry-edits-with-utility-network-rules.png)
66

77
## Use case
88

99
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.
1010

1111
## How to use the sample
1212

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.
1414

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.
1616

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.
2218

2319
## How it works
2420

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`.
2622
2. Create a `Geodatabase` using the mobile geodatabase file location.
2723
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`.
2925
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.
3630

3731
## Relevant API
3832

@@ -52,7 +46,7 @@ To save your edits, press the save button.
5246

5347
## About the data
5448

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.
5650

5751
## Tags
5852

Shared/Samples/Snap geometry edits with utility network rules/README.metadata.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"category": "Utility Networks",
33
"description": "Use the Geometry Editor to edit geometries using utility network connectivity rules.",
44
"ignore": false,
5-
"images": [],
5+
"images": [
6+
"snap-geometry-edits-with-utility-network-rules.png"
7+
],
68
"keywords": [
79
"edit",
810
"feature",
@@ -46,7 +48,8 @@
4648
"UtilityNetwork"
4749
],
4850
"snippets": [
49-
"SnapGeometryEditsWithUtilityNetworkRulesView.swift"
51+
"SnapGeometryEditsWithUtilityNetworkRulesView.swift",
52+
"SnapGeometryEditsWithUtilityNetworkRulesView.Model.swift"
5053
],
5154
"title": "Snap geometry edits with utility network rules"
5255
}
180 KB
Loading

0 commit comments

Comments
 (0)