ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Make Network Dataset Layer

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates a network dataset layer from a network dataset.

A network dataset is opened each time the network dataset is used as input to a geoprocessing tool. Opening a network dataset is expensive, as they contain advanced data structures and tables that are read and cached. A network dataset layer, which opens the dataset only a single time, will perform better in subsequent tools than reusing the network dataset.

Usage

  • A network dataset layer can be used in any workflow that uses a network dataset as input.

  • The network dataset layer created by the tool is temporary and does not persist after the session ends, unless it is saved. To save the layer to the disk, run the Save To Layer File tool.

  • Network dataset layers created from this tool can import symbology from existing network dataset layer files using the Apply Symbology From Layer tool.

  • The available choices for the Network Elements to Draw parameter are based on the network elements supported by the network dataset. For example, if a network dataset does not support traffic and turns, those choices will not be available.

  • When performing network analysis within a loop in a Python script, create the network dataset layer outside the loop and perform the analysis within the loop to improve performance.

  • When performing network analysis using geoprocessing services, if the network dataset is referenced by a catalog path, it is opened each time a geoprocessing tool within the service executes. By using a network dataset layer instead of referencing it by a catalog path, there is a performance advantage, as when the geoprocessing service is published, the dataset is opened once when the service starts, and its connection properties are cached.

Syntax

arcpy.na.MakeNetworkDatasetLayer(in_network_dataset, output_layer, {draw_elements})
ParameterExplanationData Type
in_network_dataset

The network dataset from which to make the new layer.

Network Dataset Layer
output_layer

The name of the network dataset layer to be created.

The layer can be used as an input to any geoprocessing tool that accepts a network dataset layer as input.

Note:

The output layer created is temporary and will not persist after the session ends. To save the layer to the disk, run the Save To Layer File tool.

Network Dataset Layer
draw_elements
[draw_elements,...]
(Optional)

The type of network elements to be drawn by the output layer. The available options depend on the network elements supported by the input network dataset. If the network dataset supports traffic, the default will be TRAFFIC; otherwise, it will be EDGES.

This parameter only enables or disables the types of network elements to draw with the network dataset layer. The enabled elements are drawn using default symbology. To draw the elements using a specific symbology, first define the symbology for the network elements using the Layer Properties dialog box in ArcMap, and save the network dataset layer as a layer file that can be subsequently used to import the symbology on new layers.

When an existing network dataset layer is specified as the input network dataset, this parameter inherits the network elements to draw from those that are defined on the input layer.

String

Code sample

MakeNetworkDatasetLayer example 1 (Python window)

Execute the tool using only required parameters.

networkDataset = "C:/Data/SanFrancisco.gdb/Transportation/Streets_ND"
arcpy.na.MakeNetworkDatasetLayer(networkDataset, "StreetNetwork")
MakeNetworkDatasetLayer example 2 (Python window)

Execute the tool using required and optional parameters.

networkDataset = "C:/Data/SanFrancisco.gdb/Transportation/Streets_ND"
arcpy.na.MakeNetworkDatasetLayer(networkDataset, draw_elements=["EDGES","TURNS"])

Environments

  • Current Workspace

Licensing information

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

Related topics

  • Creating a network dataset
  • An overview of the Network Dataset toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal