Skip to content

Commit c3c6b47

Browse files
authored
Analyze network with subnetwork trace sample (#413)
1 parent c41a059 commit c3c6b47

File tree

4 files changed

+782
-0
lines changed

4 files changed

+782
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Analyze network with subnetwork trace
2+
3+
Get a server-defined trace configuration for a given tier and modify its traversability scope, add new condition barriers, and control what is included in the subnetwork trace result.
4+
5+
![Analyze network with subnetwork trace](analyze_network_with_subnetwork_trace.png)
6+
7+
## Use case
8+
9+
While some traces are built from an ad-hoc group of parameters, many are based on a variation of the trace configuration taken from the subnetwork definition. For example, an electrical trace will be based on the trace configuration of the subnetwork, but may add additional clauses to constrain the trace along a single phase. Similarly, a trace in a gas or electric design application may include features with a status of "In Design" that are normally excluded from trace results.
10+
11+
## How to use the sample
12+
13+
1. The sample loads with the default trace configuration for a chosen tier.
14+
2. Toggle inclusions (containers, barriers, associations, etc.).
15+
3. Define a conditional network attribute comparison with the 'Attributes' and 'Comparison' dropdowns.
16+
4. Tap "Add condition" to append the condition to the barrier expression.
17+
5. Tap "Trace" to run a subnetwork trace from the predefined starting location using the modified configuration.
18+
6. Tap "Reset" to restore the original server-provided barrier expression.
19+
20+
Example barrier conditions for the default dataset:
21+
22+
* `Transformer Load` Equal `15`
23+
* `Phases Current` DoesNotIncludeTheValues `A`
24+
* `Generation KW` LessThan `50`
25+
26+
## How it works
27+
28+
1. Instantiate a `ServiceGeodatabase` from the feature service URL.
29+
2. Create and load a `UtilityNetwork` from the service geodatabase; look up the required `UtilityAssetType` and `UtilityTier` by name.
30+
3. Populate the comparison source list with non-system `definition.networkAttributes`, and the operator list from `UtilityAttributeComparisonOperator` enum values.
31+
4. Build a default starting `UtilityElement` from the selected asset type.
32+
5. Initialize UI options and the barrier expression from the tier's `TraceConfiguration`.
33+
6. When a network attribute is chosen, if its `Domain` is a `CodedValueDomain`, populate the value list from its coded values; otherwise present a free-form input.
34+
7. On "Add condition", create a `UtilityNetworkAttributeComparison` (source, operator, value), coercing the value to the source attribute's `UtilityNetworkAttribute.dataType`.
35+
8. If existing `UtilityTraversability.barriers` are present, combine them and the new comparison in a `UtilityTraceOrCondition`.
36+
9. On "Trace", create `UtilityTraceParameters` (`UtilityTraceType.subnetwork`, starting element), apply modified options and expression in its `TraceConfiguration`, then execute `UtilityNetwork.trace`.
37+
10. On "Reset", restore the original barrier expression.
38+
11. Present the count of returned `UtilityElementTraceResult` list.
39+
40+
## Relevant API
41+
42+
* CodedValueDomain
43+
* UtilityAssetType
44+
* UtilityCategory
45+
* UtilityCategoryComparison
46+
* UtilityCategoryComparisonOperator
47+
* UtilityDomainNetwork
48+
* UtilityElement
49+
* UtilityElementTraceResult
50+
* UtilityNetwork
51+
* UtilityNetworkAttribute
52+
* UtilityNetworkAttributeComparison
53+
* UtilityNetworkAttributeComparison.withValue
54+
* UtilityNetworkDefinition
55+
* UtilityTerminal
56+
* UtilityTier
57+
* UtilityTraceAndCondition
58+
* UtilityTraceConfiguration
59+
* UtilityTraceOrCondition
60+
* UtilityTraceParameters
61+
* UtilityTraceResult
62+
* UtilityTraceType
63+
* UtilityTraversability
64+
65+
## About the data
66+
67+
The [Naperville Electric](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) utility network feature service (authentication required; handled in code) provides the subnetwork and tier definitions used for this trace.
68+
69+
## Additional information
70+
71+
Using a utility network on ArcGIS Enterprise 10.8 requires an Enterprise member account licensed with the [Utility Network user type extension](https://enterprise.arcgis.com/en/portal/latest/administer/windows/license-user-type-extensions.htm#ESRI_SECTION1_41D78AD9691B42E0A8C227C113C0C0BF). See the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm) for publishing and configuration details.
72+
73+
## Tags
74+
75+
category comparison, condition barriers, network analysis, network attribute comparison, subnetwork trace, trace configuration, traversability, utility network, validate consistency
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"category": "Utility Networks",
3+
"description": "Get a server-defined trace configuration for a given tier and modify its traversability scope, add new condition barriers, and control what is included in the subnetwork trace result.",
4+
"ignore": false,
5+
"images": [
6+
"analyze_network_with_subnetwork_trace.png"
7+
],
8+
"keywords": [
9+
"category comparison",
10+
"condition barriers",
11+
"network analysis",
12+
"network attribute comparison",
13+
"subnetwork trace",
14+
"trace configuration",
15+
"traversability",
16+
"utility network",
17+
"validate consistency",
18+
"CodedValueDomain",
19+
"UtilityAssetType",
20+
"UtilityCategory",
21+
"UtilityCategoryComparison",
22+
"UtilityCategoryComparisonOperator",
23+
"UtilityDomainNetwork",
24+
"UtilityElement",
25+
"UtilityElementTraceResult",
26+
"UtilityNetwork",
27+
"UtilityNetworkAttribute",
28+
"UtilityNetworkAttributeComparison",
29+
"UtilityNetworkAttributeComparison.withValue",
30+
"UtilityNetworkDefinition",
31+
"UtilityTerminal",
32+
"UtilityTier",
33+
"UtilityTraceAndCondition",
34+
"UtilityTraceConfiguration",
35+
"UtilityTraceOrCondition",
36+
"UtilityTraceParameters",
37+
"UtilityTraceResult",
38+
"UtilityTraceType",
39+
"UtilityTraversability"
40+
],
41+
"redirect_from": [],
42+
"relevant_apis": [
43+
"CodedValueDomain",
44+
"UtilityAssetType",
45+
"UtilityCategory",
46+
"UtilityCategoryComparison",
47+
"UtilityCategoryComparisonOperator",
48+
"UtilityDomainNetwork",
49+
"UtilityElement",
50+
"UtilityElementTraceResult",
51+
"UtilityNetwork",
52+
"UtilityNetworkAttribute",
53+
"UtilityNetworkAttributeComparison",
54+
"UtilityNetworkAttributeComparison.withValue",
55+
"UtilityNetworkDefinition",
56+
"UtilityTerminal",
57+
"UtilityTier",
58+
"UtilityTraceAndCondition",
59+
"UtilityTraceConfiguration",
60+
"UtilityTraceOrCondition",
61+
"UtilityTraceParameters",
62+
"UtilityTraceResult",
63+
"UtilityTraceType",
64+
"UtilityTraversability"
65+
],
66+
"snippets": [
67+
"analyze_network_with_subnetwork_trace.dart"
68+
],
69+
"title": "Analyze network with subnetwork trace"
70+
}

0 commit comments

Comments
 (0)