Stage Utility Network (Utility Network Package)

Summary

Creates the required dataset and utility network in a geodatabase using a service territory feature class, and copies this layer into the dataset. Additionally, it adds the Global ID field and enables editor tracking.

Note:

The Create Utility Network tool can be used interchangeably with this tool to create a utility network but must be combined with other geoprocessing tools to add all the additional functionality noted above.

Usage

  • The names of the feature dataset, service territory, and utility network will be given a unique name if they already exist in the geodatabase.

  • If using an enterprise database, a specific version is required. Review the list of supported databases before running.

    License:

    The active portal account must be licensed with the Utility Network Service user type extension to create, publish, and work with a utility network.

Parameters

LabelExplanationData Type
Input Geodatabase

The input geodatabase where you want to create a utility network. This supports utility network in file and enterprise geodatabases. For enterprise geodatabases, the connected user will be the owner of the utility network and this user must not be in the DBO role.

Workspace
Service Territory Feature Class

The feature layer that will be used to create the utility network's geographical extent. The service territory feature class must have at least one feature. Utility network features cannot be created outside of this extent.

The feature class will be:

  • Copied into the new feature dataset as M- and Z-enabled.
  • Editor tracking will be enabled.
  • GlobalIDs will be added if they are not already present.

Feature Layer
Feature Dataset Name

The name for the feature dataset that will be created in which the utility network and schema will be created in.

String
Utility Network Name

The name for the utility network that will be created.

String

arcpy.pt.StageUtilityNetwork(enterprise_gdb, service_territory_feature_class, dataset_name, in_utility_network_name)
NameExplanationData Type
enterprise_gdb

The input geodatabase where you want to create a utility network. This supports utility network in file and enterprise geodatabases. For enterprise geodatabases, the connected user will be the owner of the utility network and this user must not be in the DBO role.

Workspace
service_territory_feature_class

The feature layer that will be used to create the utility network's geographical extent. The service territory feature class must have at least one feature. Utility network features cannot be created outside of this extent.

The feature class will be:

  • Copied into the new feature dataset as M- and Z-enabled.
  • Editor tracking will be enabled.
  • GlobalIDs will be added if they are not already present.

Feature Layer
dataset_name

The name for the feature dataset that will be created in which the utility network and schema will be created in.

String
in_utility_network_name

The name for the utility network that will be created.

String

Code sample

StageUtilityNetwork example (Python window)

The following Python window script demonstrates how to use the StageUtilityNetwork tool in immediate mode.

arcpy.pt.StageUtilityNetwork("C:/data/connection.sde", "C:/data/source_data.gdb/Service_Area", "SYSTEM", "WaterNetwork")
StageUtilityNetwork example (stand-alone script)

The following stand-alone script demonstrates how to use the StageUtilityNetwork tool.

# Name: Stage_UtilityNetwork.py
# Description: Creates a new utility network

# Import system modules
import arcpy

# Set local variables
sde = "C:/data/connection.sde"
service_territory = "C:/data/source_data/Service_Area"
dataset = "SYSTEM"
network_name = "WaterNetwork"

# When the target workspace is in an enterprise geodatabase, you need to sign in to Portal.
arcpy.SignInToPortal(portal_url=arcpy.GetActivePortalURL(), username='my_user', password='my_password')

# Create the new utility network
arcpy.pt.StageUtilityNetwork(sde, service_territory, dataset, network_name)
StageUtilityNetwork example for file geodatabase (stand-alone script)

The following stand-alone script demonstrates how to use the StageUtilityNetwork tool.

# Name: Stage_UtilityNetwork.py
# Description: Creates a new utility network
 
# Import system modules
import arcpy

# Set local variables
fgdb = "C:/data/database.gdb"
service_territory = "C:/data/source_data.gdb/Service_Area"
dataset = "SYSTEM"
network_name = "WaterNetwork"
 
# Create the new utility network
arcpy.pt.StageUtilityNetwork(fgdb, service_territory, dataset, network_name)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes