Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions lib/samples/create_load_report/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Create load report

Create a simple electric distribution report that displays the count of customers and total load per phase by tracing downstream from a given point.

![Image of create utility network load report](create_load_report.png)

## Use case

You can use a load report to display the customers per phase as well as the load per phase based on a chosen starting point in a utility network. Load reports are used for electric load restoration and balancing.

## How to use the sample

Select phases to be included in the report. Press the "Run Report" button to initiate a downstream trace on the network and create a load report. Pressing "Run Report" again will generate a new load report. Deselect all phases and press the "Reset" button to clear the report.

## How it works

1. Create a `ServiceGeodatabase` with a feature service URL.
2. Create and load a `UtilityNetwork` using the service geodatabase, then get an asset type, tier, network attributes, and category by their names.
3. Create a `UtilityElement` from the asset type to use as the starting location for the trace.
4. Create a `UtilityTraceConfiguration` from the utility tier.
5. Create a `UtilityCategoryComparison` where "ServicePoint" category exists.
6. Reset the `functions` property of the trace configuration with a new `UtilityTraceFunction` adding a "Service Load" network attribute where this category comparison applies. This will limit the function results.
7. Set `outputCondition` with the category comparison to limit the element results.
8. Get a base condition from the utility tier's default trace configuration.
9. Create `UtilityTraceParameters` passing in `downstream` utility trace type and the default starting location. Set its `traceConfiguration` property with the trace configuration above.
10. Populate a list of phases using the network attribute's `codedValues` property.
11. When the "Run Report" button is tapped, run a trace for every checked `CodedValue` in the phases list. Do this by creating a `UtilityTraceOrCondition` with the base condition and a `UtilityNetworkAttributeComparison` where the "Phases Current" network attribute does not include the coded value.
12. Display the count of "Total Customers" using the `elements` property of the result, and the result of "Total Load" using the first and only output in `functionOutputs` property.

## Relevant API

* UtilityAssetType
* UtilityCategoryComparison
* UtilityDomainNetwork
* UtilityElement
* UtilityElementTraceResult
* UtilityNetwork
* UtilityNetworkAttribute
* UtilityNetworkAttributeComparison
* UtilityNetworkDefinition
* UtilityNetworkSource
* UtilityTerminal
* UtilityTier
* UtilityTraceConfiguration
* UtilityTraceFunction
* UtilityTraceParameters
* UtilityTraceResult
* UtilityTraceType
* UtilityTraversability

## About the data

The [Naperville electrical](https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer) network feature service, hosted on ArcGIS Online (authentication required: this is handled within the sample code), contains a utility network used to run the subnetwork-based trace shown in this sample.

## Additional information

Using utility network on ArcGIS Enterprise 10.8 requires an ArcGIS 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). Please refer to the [utility network services documentation](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/utility-network-services.htm).

## Tags

condition barriers, downstream trace, network analysis, subnetwork trace, trace configuration, traversability, upstream trace, utility network, validate consistency
58 changes: 58 additions & 0 deletions lib/samples/create_load_report/README.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"category": "Utility Networks",
"description": "Create a simple electric distribution report that displays the count of customers and total load per phase by tracing downstream from a given point.",
"ignore": false,
"images": ["create_load_report.png"],
"keywords": [
"condition barriers",
"downstream trace",
"network analysis",
"subnetwork trace",
"trace configuration",
"traversability",
"upstream trace",
"utility network",
"validate consistency",
"UtilityAssetType",
"UtilityCategoryComparison",
"UtilityDomainNetwork",
"UtilityElement",
"UtilityElementTraceResult",
"UtilityNetwork",
"UtilityNetworkAttribute",
"UtilityNetworkAttributeComparison",
"UtilityNetworkDefinition",
"UtilityNetworkSource",
"UtilityTerminal",
"UtilityTier",
"UtilityTraceConfiguration",
"UtilityTraceFunction",
"UtilityTraceParameters",
"UtilityTraceResult",
"UtilityTraceType",
"UtilityTraversability"
],
"redirect_from": [],
"relevant_apis": [
"UtilityAssetType",
"UtilityCategoryComparison",
"UtilityDomainNetwork",
"UtilityElement",
"UtilityElementTraceResult",
"UtilityNetwork",
"UtilityNetworkAttribute",
"UtilityNetworkAttributeComparison",
"UtilityNetworkDefinition",
"UtilityNetworkSource",
"UtilityTerminal",
"UtilityTier",
"UtilityTraceConfiguration",
"UtilityTraceFunction",
"UtilityTraceParameters",
"UtilityTraceResult",
"UtilityTraceType",
"UtilityTraversability"
],
"snippets": ["create_load_report.dart"],
"title": "Create load report"
}
Loading
Loading