Skip to content

Commit 2e90bfb

Browse files
committed
Add initial files.
1 parent f9781c2 commit 2e90bfb

File tree

4 files changed

+150
-0
lines changed

4 files changed

+150
-0
lines changed

Samples.xcodeproj/project.pbxproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@
256256
D718A1E82B571C9100447087 /* OrbitCameraAroundObjectView.Model.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D718A1E62B570F7500447087 /* OrbitCameraAroundObjectView.Model.swift */; };
257257
D718A1ED2B575FD900447087 /* ManageBookmarksView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D718A1EA2B575FD900447087 /* ManageBookmarksView.swift */; };
258258
D718A1F02B57602000447087 /* ManageBookmarksView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D718A1EA2B575FD900447087 /* ManageBookmarksView.swift */; };
259+
D71A9DE22D8CC88D00CA03CB /* SnapGeometryEditsWithUtilityNetworkRulesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D71A9DE02D8CC88D00CA03CB /* SnapGeometryEditsWithUtilityNetworkRulesView.swift */; };
260+
D71A9DE52D8CC8B500CA03CB /* SnapGeometryEditsWithUtilityNetworkRulesView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D71A9DE02D8CC88D00CA03CB /* SnapGeometryEditsWithUtilityNetworkRulesView.swift */; };
259261
D71C5F642AAA7A88006599FD /* CreateSymbolStylesFromWebStylesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D71C5F632AAA7A88006599FD /* CreateSymbolStylesFromWebStylesView.swift */; };
260262
D71C5F652AAA83D2006599FD /* CreateSymbolStylesFromWebStylesView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D71C5F632AAA7A88006599FD /* CreateSymbolStylesFromWebStylesView.swift */; };
261263
D71C90A22C6C249B0018C63E /* StyleGeometryTypesWithSymbolsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D71C909C2C6C249B0018C63E /* StyleGeometryTypesWithSymbolsView.swift */; };
@@ -589,6 +591,7 @@
589591
dstPath = "";
590592
dstSubfolderSpec = 7;
591593
files = (
594+
D71A9DE52D8CC8B500CA03CB /* SnapGeometryEditsWithUtilityNetworkRulesView.swift in Copy Source Code Files */,
592595
D789AAAE2D66C737007A8E0E /* CreateKMLMultiTrackView.Model.swift in Copy Source Code Files */,
593596
D71563EA2D5AC2D500D2E948 /* CreateKMLMultiTrackView.swift in Copy Source Code Files */,
594597
D74F6C452D0CD54200D4FB15 /* ConfigureElectronicNavigationalChartsView.swift in Copy Source Code Files */,
@@ -962,6 +965,7 @@
962965
D71563E32D5AC2B600D2E948 /* CreateKMLMultiTrackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateKMLMultiTrackView.swift; sourceTree = "<group>"; };
963966
D718A1E62B570F7500447087 /* OrbitCameraAroundObjectView.Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrbitCameraAroundObjectView.Model.swift; sourceTree = "<group>"; };
964967
D718A1EA2B575FD900447087 /* ManageBookmarksView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManageBookmarksView.swift; sourceTree = "<group>"; };
968+
D71A9DE02D8CC88D00CA03CB /* SnapGeometryEditsWithUtilityNetworkRulesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnapGeometryEditsWithUtilityNetworkRulesView.swift; sourceTree = "<group>"; };
965969
D71C5F632AAA7A88006599FD /* CreateSymbolStylesFromWebStylesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateSymbolStylesFromWebStylesView.swift; sourceTree = "<group>"; };
966970
D71C909C2C6C249B0018C63E /* StyleGeometryTypesWithSymbolsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StyleGeometryTypesWithSymbolsView.swift; sourceTree = "<group>"; };
967971
D71C909D2C6C249B0018C63E /* StyleGeometryTypesWithSymbolsView.Views.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StyleGeometryTypesWithSymbolsView.Views.swift; sourceTree = "<group>"; };
@@ -1405,6 +1409,7 @@
14051409
0086F3FC28E3770900974721 /* Show viewshed from point in scene */,
14061410
95DEB9B72C127A97009BEC35 /* Show viewshed from point on map */,
14071411
00E7C15A2BBE1BF000B85D69 /* Snap geometry edits */,
1412+
D71A9DE12D8CC88D00CA03CB /* Snap geometry edits with utility network rules */,
14081413
D75B584D2AAFB2C20038B3B4 /* Style features with custom dictionary */,
14091414
D71C909E2C6C249B0018C63E /* Style geometry types with symbols */,
14101415
E066DD362860AB0B004D3D5B /* Style graphics with renderer */,
@@ -2137,6 +2142,14 @@
21372142
path = "Manage bookmarks";
21382143
sourceTree = "<group>";
21392144
};
2145+
D71A9DE12D8CC88D00CA03CB /* Snap geometry edits with utility network rules */ = {
2146+
isa = PBXGroup;
2147+
children = (
2148+
D71A9DE02D8CC88D00CA03CB /* SnapGeometryEditsWithUtilityNetworkRulesView.swift */,
2149+
);
2150+
path = "Snap geometry edits with utility network rules";
2151+
sourceTree = "<group>";
2152+
};
21402153
D71C5F602AAA7854006599FD /* Create symbol styles from web styles */ = {
21412154
isa = PBXGroup;
21422155
children = (
@@ -3629,6 +3642,7 @@
36293642
E066DD382860AB28004D3D5B /* StyleGraphicsWithRendererView.swift in Sources */,
36303643
108EC04129D25B2C000F35D0 /* QueryFeatureTableView.swift in Sources */,
36313644
D71D516E2B51D7B600B2A2BE /* SearchForWebMapView.Views.swift in Sources */,
3645+
D71A9DE22D8CC88D00CA03CB /* SnapGeometryEditsWithUtilityNetworkRulesView.swift in Sources */,
36323646
D7114A0D2BDC6A3300FA68CA /* EditWithBranchVersioningView.Model.swift in Sources */,
36333647
00B04FB5283EEBA80026C882 /* DisplayOverviewMapView.swift in Sources */,
36343648
D718A1E72B570F7500447087 /* OrbitCameraAroundObjectView.Model.swift in Sources */,
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Snap geometry edits with utility network rules
2+
3+
Use the Geometry Editor to edit geometries using utility network connectivity rules.
4+
5+
![Image of snapping](SnapGeometryEditsWithUtilityNetworkRules.jpg)
6+
7+
## Use case
8+
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+
11+
## How to use the sample
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.
14+
15+
Snap sources can be enabled and disabled. Snapping will not occur when `SnapRuleBehavior.RulesPreventSnapping` even when the source is enabled.
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.
22+
23+
## How it works
24+
25+
1. Create a map with `LoadSettings.FeatureTilingMode` set to `EnabledWithFullResolutionWhenSupported`.
26+
2. Create a `Geodatabase` using the mobile geodatabase file location.
27+
3. Display `Geodatabase.featureTables` on the map using subtype feature layers.
28+
4. Create a `GeometryEditor` and connect it to the map view.
29+
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`.
36+
37+
## Relevant API
38+
39+
* FeatureLayer
40+
* Geometry
41+
* GeometryEditor
42+
* GeometryEditorStyle
43+
* GraphicsOverlay
44+
* MapView
45+
* SnapRuleBehavior
46+
* SnapRules
47+
* SnapSettings
48+
* SnapSource
49+
* SnapSourceEnablingBehavior
50+
* SnapSourceSettings
51+
* UtilityNetwork
52+
53+
## About the data
54+
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.
56+
57+
## Tags
58+
59+
edit, feature, geometry editor, graphics, layers, map, snapping, utility network
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"category": "Utility Networks",
3+
"description": "Use the Geometry Editor to edit geometries using utility network connectivity rules.",
4+
"ignore": false,
5+
"images": [],
6+
"keywords": [
7+
"edit",
8+
"feature",
9+
"geometry editor",
10+
"graphics",
11+
"layers",
12+
"map",
13+
"snapping",
14+
"utility network",
15+
"FeatureLayer",
16+
"Geometry",
17+
"GeometryEditor",
18+
"GeometryEditorStyle",
19+
"GraphicsOverlay",
20+
"MapView",
21+
"SnapRuleBehavior",
22+
"SnapRules",
23+
"SnapSettings",
24+
"SnapSource",
25+
"SnapSourceEnablingBehavior",
26+
"SnapSourceSettings",
27+
"UtilityNetwork"
28+
],
29+
"redirect_from": [],
30+
"relevant_apis": [
31+
"FeatureLayer",
32+
"Geometry",
33+
"GeometryEditor",
34+
"GeometryEditorStyle",
35+
"GraphicsOverlay",
36+
"MapView",
37+
"SnapRuleBehavior",
38+
"SnapRules",
39+
"SnapSettings",
40+
"SnapSource",
41+
"SnapSourceEnablingBehavior",
42+
"SnapSourceSettings",
43+
"UtilityNetwork"
44+
],
45+
"snippets": [
46+
"SnapGeometryEditsWithUtilityNetworkRulesView.swift"
47+
],
48+
"title": "Snap geometry edits with utility network rules"
49+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2025 Esri
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import ArcGIS
16+
import SwiftUI
17+
18+
struct SnapGeometryEditsWithUtilityNetworkRulesView: View {
19+
@State private var map = Map(basemapStyle: .arcGISTopographic)
20+
21+
var body: some View {
22+
MapView(map: map)
23+
}
24+
}
25+
26+
#Preview {
27+
SnapGeometryEditsWithUtilityNetworkRulesView()
28+
}

0 commit comments

Comments
 (0)