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.
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.
Syntax
arcpy.NOALIAS.StageUtilityNetwork(enterprise_gdb, service_territory_feature_class, dataset_name, in_utility_network_name)
Name | Explanation | Data 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 |
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:
| Feature Layer |
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:
| 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 |
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 |
in_utility_network_name | The name for the utility network that will be created. | String |
Utility Network Name
| The name for the utility network that will be created. | String |
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