Create Network Dataset (Network Analyst)

Summary

Creates a network dataset in an existing feature dataset. The network dataset can be used to perform network analysis on the data in the feature dataset.

Usage

Syntax

CreateNetworkDataset(feature_dataset, out_name, source_feature_class_names, elevation_model)
ParameterExplanationData Type
feature_dataset

The feature dataset where the network dataset will be created. The feature dataset should contain the source feature classes that will participate in the network dataset.

If the feature dataset is in an enterprise geodatabase, the feature dataset and all source feature classes cannot be versioned.

Feature Dataset
out_name

The name of the network dataset to be created. The Target Feature Dataset and its parent geodatabase must not already contain a network dataset with this name.

String
source_feature_class_names
[source_feature_class_names,...]

The names of the feature classes to be included in the network dataset as network source features. Specify this parameter as a list of strings.

You must choose at least one line feature class that is not a turn feature class. This line feature class will act as an edge source in the network dataset. You can optionally choose point feature classes to act as junction sources in the network dataset and turn feature classes to act as turn sources.

Learn more about network dataset source feature classes

All source feature classes must reside in the Target Feature Dataset and must not already participate in a geometric network, a utility network, or another network dataset.

String
elevation_model

Specifies the model to be used to control vertical connectivity in the network dataset.

Learn more about vertical connectivity

  • ELEVATION_FIELDS Coincident endpoints with the same elevation field values are considered connected in the network dataset. This is the default.
  • Z_COORDINATESThe z-coordinate values in the line feature geometry determine vertical connectivity. Coincident points are considered connected only if they have matching z-coordinate values.
  • NO_ELEVATION Network dataset connectivity is determined only by horizontal coincidence.
String

Derived Output

NameExplanationData Type
out_network_dataset

The new network dataset.

Network Dataset

Code sample

CreateNetworkDataset example 1 (Python window)

Create a network dataset in a feature dataset.

import arcpy
arcpy.CheckOutExtension("network")

arcpy.na.CreateNetworkDataset(r"C:\Data\Network.gdb\Transportation", 
                              "Streets_ND", ["Streets", "Turns"], 
                              "ELEVATION_FIELDS")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Requires Network Analyst
  • Standard: Requires Network Analyst
  • Advanced: Requires Network Analyst