Make Waste Collection Analysis Layer (Network Analyst)

Summary

Creates a waste collection network analysis layer and sets its analysis properties. A waste collection analysis layer is useful for optimizing a set of routes using a fleet of vehicles to pick up municipal waste. The layer can be created using a network dataset.

Usage

  • The analysis network used for a waste collection analysis must have at least one travel mode, one cost attribute with time units, and one cost attribute with distance units.

  • After creating the analysis layer with this tool, you can add network analysis objects to it using the Add Locations tool, solve the analysis using the Solve tool, and save the results on disk using the Save To Layer File tool.

  • When using this tool in geoprocessing models, if the model is run as a tool, the output network analysis layer must be made a model parameter; otherwise, the output layer is not added to the contents of the map.

  • Although this tool can be run in Python, a better way to automate waste collection workflows in Python is to use the WasteCollection solver object in the arcpy.nax Network Analyst module.

Parameters

LabelExplanationData Type
Network Data Source

The network dataset on which the network analysis will be performed.

The network must have at least one travel mode, one cost attribute with time units, and one cost attribute with distance units.

Network Dataset Layer;String
Layer Name
(Optional)

The name of the network analysis layer that will be created.

String
Travel Mode
(Optional)

The name of the travel mode that will be used in the analysis. The travel mode represents a collection of network settings, such as travel restrictions and U-turn policies, that determine how a pedestrian, car, truck, or other medium of transportation moves through the network. Travel modes are defined on your network data source.

An arcpy.na.TravelMode object and a string containing the valid JSON representation of a travel mode can also be used as input to this parameter.

The travel mode's impedance attribute must have units of time.

For waste collection analysis, U-turns must be allowed at dead ends. If the travel mode does not allow any U-turns, the solver will relax the travel mode's U-turn policy to allow U-turns at dead ends.

String
Time Units
(Optional)

Specifies the time units that will be used by the analysis layer's properties and the temporal fields of the analysis layer's sublayers and tables (network analysis classes). This value does not need to match the units of the time cost attribute.

  • MinutesThe time units will be minutes. This is the default.
  • SecondsThe time units will be seconds.
  • HoursThe time units will be hours.
  • DaysThe time units will be days.
String
Distance Units
(Optional)

Specifies the distance units that will be used by the analysis layer's properties and the distance fields of the analysis layer's sublayers and tables (network analysis classes). This value does not need to match the units of the optional distance cost attribute.

  • MilesThe distance units will be miles. This is the default.
  • KilometersThe distance units will be kilometers.
  • FeetThe distance units will be feet.
  • YardsThe distance units will be yards.
  • MetersThe distance units will be meters.
  • InchesThe distance units will be inches.
  • CentimetersThe distance units will be centimeters.
  • MillimetersThe distance units will be millimeters.
  • DecimetersThe distance units will be decimeters.
  • Nautical MilesThe distance units will be nautical miles.
String
Route Start Time
(Optional)

The default start time for routes. This time of day is used for all routes for which the StartTime field in the Routes sublayer is null. When no parameter value is specified, all rows in the Routes sublayer must specify a value in the StartTime field.

Although you can specify both a date and a time for this parameter, only the time is used.

Date
Max Route Total Time
(Optional)

The maximum allowed total time for each route. The value can be any positive number.

This value will be used for all routes for which the MaxTotalTime field in the Routes sublayer is null. When no value is specified, all rows in the Routes sublayer must specify a value in the MaxTotalTime field.

The value is interpreted in the units specified in the Time Units parameter.

Double
Stop Collection Mode
(Optional)

Specifies the default stop collection mode for each stop. This value can be one of the options listed below, or it can be left blank (the default).

This value will be used for all stops for which the CollectionMode field in the Stops sublayer is null. When no value is specified, all rows in the Stops sublayer must specify a value in the CollectionMode field.

  • One SideThe two sides of the street on which this stop is located will be collected separately with different passes down the street edge.
  • Both SidesBoth sides of the street on which this stop is located will be collected at once with a single pass down the street edge.
String

Derived Output

LabelExplanationData Type
Network Analyst Layer

The new network analysis layer.

Network Analyst Layer

arcpy.na.MakeWasteCollectionAnalysisLayer(network_data_source, {layer_name}, {travel_mode}, {time_units}, {distance_units}, {route_start_time}, {max_route_total_time}, {stop_collection_mode})
NameExplanationData Type
network_data_source

The network dataset on which the network analysis will be performed.

The network must have at least one travel mode, one cost attribute with time units, and one cost attribute with distance units.

Network Dataset Layer;String
layer_name
(Optional)

The name of the network analysis layer that will be created.

String
travel_mode
(Optional)

The name of the travel mode that will be used in the analysis. The travel mode represents a collection of network settings, such as travel restrictions and U-turn policies, that determine how a pedestrian, car, truck, or other medium of transportation moves through the network. Travel modes are defined on your network data source.

An arcpy.na.TravelMode object and a string containing the valid JSON representation of a travel mode can also be used as input to this parameter.

The travel mode's impedance attribute must have units of time.

For waste collection analysis, U-turns must be allowed at dead ends. If the travel mode does not allow any U-turns, the solver will relax the travel mode's U-turn policy to allow U-turns at dead ends.

String
time_units
(Optional)

Specifies the time units that will be used by the analysis layer's properties and the temporal fields of the analysis layer's sublayers and tables (network analysis classes). This value does not need to match the units of the time cost attribute.

  • MinutesThe time units will be minutes. This is the default.
  • SecondsThe time units will be seconds.
  • HoursThe time units will be hours.
  • DaysThe time units will be days.
String
distance_units
(Optional)

Specifies the distance units that will be used by the analysis layer's properties and the distance fields of the analysis layer's sublayers and tables (network analysis classes). This value does not need to match the units of the optional distance cost attribute.

  • MilesThe distance units will be miles. This is the default.
  • KilometersThe distance units will be kilometers.
  • FeetThe distance units will be feet.
  • YardsThe distance units will be yards.
  • MetersThe distance units will be meters.
  • InchesThe distance units will be inches.
  • CentimetersThe distance units will be centimeters.
  • MillimetersThe distance units will be millimeters.
  • DecimetersThe distance units will be decimeters.
  • NauticalMilesThe distance units will be nautical miles.
String
route_start_time
(Optional)

The default start time for routes. This time of day is used for all routes for which the StartTime field in the Routes sublayer is null. When no parameter value is specified, all rows in the Routes sublayer must specify a value in the StartTime field.

Specify this parameter value using a datetime.time object.

Date
max_route_total_time
(Optional)

The maximum allowed total time for each route. The value can be any positive number.

This value will be used for all routes for which the MaxTotalTime field in the Routes sublayer is null. When no value is specified, all rows in the Routes sublayer must specify a value in the MaxTotalTime field.

The value is interpreted in the units specified in the time_units parameter.

Double
stop_collection_mode
(Optional)

Specifies the default stop collection mode for each stop. This value can be one of the options listed below, or it can be left blank (the default).

This value will be used for all stops for which the CollectionMode field in the Stops sublayer is null. When no value is specified, all rows in the Stops sublayer must specify a value in the CollectionMode field.

  • ONE_SIDEThe two sides of the street on which this stop is located will be collected separately with different passes down the street edge.
  • BOTH_SIDESBoth sides of the street on which this stop is located will be collected at once with a single pass down the street edge.
String

Derived Output

NameExplanationData Type
out_network_analysis_layer

The new network analysis layer.

Network Analyst Layer

Code sample

MakeWasteCollectionAnalysisLayer example 1 (Python window)

Run the MakeWasteCollectionAnalysisLayer function specifying a subset of parameters.

import datetime

arcpy.na.MakeWasteCollectionAnalysisLayer(
    r"C:\Data\SanFrancisco.gdb\Transportation\Streets_ND",
    "Waste Collection Option B",
    "Garbage Truck Time",
    time_units="Hours",
    max_route_total_time=6.5,
    route_start_time=datetime.time(6, 30, 0),
)

Environments

Licensing information

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

Related topics