| Label | Explanation | Data Type |
Input Network Dataset
| The network dataset from which the layer will be created. | Network Dataset Layer |
Output Layer
| The name of the network dataset layer that will 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 disk, run the Save To Layer File tool. | Network Dataset Layer |
Network Elements to Draw
(Optional) | This parameter is not yet supported in ArcGIS Pro. | String |
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 computationally intensive, as it contains 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 disk, run the Save To Layer File tool.
You can use network dataset layers created from this tool to import symbology from existing network dataset layer files using the Apply Symbology From Layer tool.
The options for the Network Elements to Draw parameter are determined by the network elements supported by the network dataset. For example, if a network dataset does not support traffic and turns, those options 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 in the service is run. 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.
Parameters
arcpy.na.MakeNetworkDatasetLayer(in_network_dataset, output_layer, {draw_elements})| Name | Explanation | Data Type |
in_network_dataset | The network dataset from which the layer will be created. | Network Dataset Layer |
output_layer | The name of the network dataset layer that will 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 disk, run the Save To Layer File tool. | Network Dataset Layer |
draw_elements [draw_elements,...] (Optional) | This parameter is not yet supported in ArcGIS Pro. | String |
Code sample
Run the MakeNetworkDatasetLayer function using only required parameters.
networkDataset = "C:/Data/SanFrancisco.gdb/Transportation/Streets_ND"
arcpy.na.MakeNetworkDatasetLayer(networkDataset, "StreetNetwork")Run the MakeNetworkDatasetLayer function using required and optional parameters.
networkDataset = "C:/Data/SanFrancisco.gdb/Transportation/Streets_ND"
arcpy.na.MakeNetworkDatasetLayer(networkDataset, draw_elements=["EDGES","TURNS"])Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes