Delete Network Analysis Layer (Network Analyst)

Summary

Deletes a network analysis layer and its analysis data.

Usage

  • The tool deletes the input network analysis layer's analysis data (the feature classes and tables referenced by the network analysis layer's sublayers and subtables). The layer's network data source is not deleted.

  • This tool is useful in a model in which a network analysis layer is created as an intermediate step. If such a model is run repeatedly, unwanted sublayer data may accumulate in the project geodatabase. This tool can be used to clean up the network analysis layer's analysis data in the model workflow.

    Learn how to use this tool in a model

  • If the network analysis layer is in a map, the layer will be removed from the map.

Parameters

LabelExplanationData Type
Input Network Analysis Layers

The network analysis layer or layers to delete.

Network Analyst Layer

Derived Output

LabelExplanationData Type
Delete Succeeded

Indicates whether the deletion succeeded.

Boolean

arcpy.na.DeleteNetworkAnalysisLayer(in_network_analysis_layers)
NameExplanationData Type
in_network_analysis_layers
[in_network_analysis_layers,...]

The network analysis layer or layers to delete.

Network Analyst Layer

Derived Output

NameExplanationData Type
delete_succeeded

Indicates whether the deletion succeeded.

Boolean

Code sample

DeleteNetworkAnalysisLayer example 1 (Python window)

In this code snippet, the DeleteNetworkAnalysisLayer function is used to delete a Vehicle Routing Problem layer and its analysis data after completing a workflow.

import arcpy
layer = arcpy.na.MakeVehicleRoutingProblemAnalysisLayer(network, "VRP").getOutput(0)

# Additional workflow steps

arcpy.na.DeleteNetworkAnalysisLayer(layer)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics