Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Network Analyst toolbox > Analysis toolset > Tools

Add Locations (Network Analyst)

Release 9.3
Last modified December 23, 2008
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Adds network locations to a network analysis layer


Usage tips

Command line syntax
An overview of the Command Line window
AddLocations_na <in_network_analysis_layer> <sub_layer> <in_table> <field_mappings> <search_tolerance> {sort_field} {source {snap type};source {snap type}...} {MATCH_TO_CLOSEST|PRIORITY} {APPEND|CLEAR} <NO_SNAP | SNAP> {snap_offset}

Parameter Explanation Data Type
<in_network_analysis_layer>

Network analysis layer to which network locations will be added.

Network Analyst Layer
<sub_layer>

Adds network locations to the selected sublayer of the input network analysis layer.

String
<in_table>

The feature class or layer that is the source for the new network locations.

Table View
<field_mappings>

Sets the values for the properties of the network locations. Properties can be set to a constant or mapped to a field on the input feature class.

Network Analyst Field Map
<search_tolerance>

The search tolerance for locating the input features on the network. The parameter includes a value and units for the tolerance.

Linear Unit
{sort_field}

A field in which to sort the locations as they are added to the network analysis layer.

Field
{source {snap type};source {snap type}...}

Allows you to specify which sources in your network dataset will be searched when finding locations, as well as specifying what portions of geometry will be used.

String
{MATCH_TO_CLOSEST|PRIORITY}

Specifies whether or not to match new network locations to the closest element of any class in the network analysis layer.

  • MATCH_TO_CLOSEST — Matches the locations to the closest element of any class in the network analysis layer
  • PRIORITY — Matches the location to classes in priority order

Boolean
{APPEND|CLEAR}

Specifies whether or not to append new network locations to existing locations.

  • APPEND — Adds the new network locations to the existing set of locations in the selected sublayer
  • CLEAR — Deletes the existing locations and replaces them with the new network locations

Boolean
<NO_SNAP | SNAP>

Specifies whether or not the new network locations should snap to positions on the network source features where they are located.

  • NO_SNAP — The geometries of the network locations are based on the geometries of the input features. If the input layer is not a point layer and this is unchecked, the resulting network locations will have empty geometries. This is the default.
  • SNAP — The geometries of the network locations are based on where they are located on the network dataset rather than using the geometries of the input features. It is possible to additionally specify a snap offset if it is important that the network locations are not positioned directly on the network source features. This is useful in cases where the network locations use the curb approach, which requires that the network locations know which side of the edge they are on.

Boolean
{snap_offset}

When snapping a point to the network, you can apply an offset distance. An offset distance of zero means the point will be coincident with the network feature (typically a line). To offset the point from the network feature, enter an offset distance. The offset is in relation to the original point location. That is, if the original point was on the left side, its new location will be offset to the left. If it was originally on the right side, its new location will be offset to the right.

Long
Data types for geoprocessing tool parameters


Command line example

AddLocations MyRouteLayer Stops d:\mydata\mystops.shp # "500 Meters"

Scripting syntax
About getting started with writing geoprocessing scripts
AddLocations_na (in_network_analysis_layer, sub_layer, in_table, field_mappings, search_tolerance, sort_field, search_criteria, match_type, append, snap_to_position_along_network, snap_offset)

Parameter Explanation Data Type
in_network_analysis_layer (Required)

Network analysis layer to which network locations will be added.

Network Analyst Layer
sub_layer (Required)

Adds network locations to the selected sublayer of the input network analysis layer.

String
in_table (Required)

The feature class or layer that is the source for the new network locations.

Table View
field_mappings (Required)

Sets the values for the properties of the network locations. Properties can be set to a constant or mapped to a field on the input feature class.

Network Analyst Field Map
search_tolerance (Required)

The search tolerance for locating the input features on the network. The parameter includes a value and units for the tolerance.

Linear Unit
sort_field (Optional)

A field in which to sort the locations as they are added to the network analysis layer.

Field
search_criteria (Optional)

Allows you to specify which sources in your network dataset will be searched when finding locations, as well as specifying what portions of geometry will be used.

String
match_type (Optional)

Specifies whether or not to match new network locations to the closest element of any class in the network analysis layer.

  • MATCH_TO_CLOSEST — Matches the locations to the closest element of any class in the network analysis layer
  • PRIORITY — Matches the location to classes in priority order

Boolean
append (Optional)

Specifies whether or not to append new network locations to existing locations.

  • APPEND — Adds the new network locations to the existing set of locations in the selected sublayer
  • CLEAR — Deletes the existing locations and replaces them with the new network locations

Boolean
snap_to_position_along_network (Required)

Specifies whether or not the new network locations should snap to positions on the network source features where they are located.

  • NO_SNAP — The geometries of the network locations are based on the geometries of the input features. If the input layer is not a point layer and this is unchecked, the resulting network locations will have empty geometries. This is the default.
  • SNAP — The geometries of the network locations are based on where they are located on the network dataset rather than using the geometries of the input features. It is possible to additionally specify a snap offset if it is important that the network locations are not positioned directly on the network source features. This is useful in cases where the network locations use the curb approach, which requires that the network locations know which side of the edge they are on.

Boolean
snap_offset (Optional)

When snapping a point to the network, you can apply an offset distance. An offset distance of zero means the point will be coincident with the network feature (typically a line). To offset the point from the network feature, enter an offset distance. The offset is in relation to the original point location. That is, if the original point was on the left side, its new location will be offset to the left. If it was originally on the right side, its new location will be offset to the right.

Long

Data types for geoprocessing tool parameters


Script example

import arcgisscripting
gp = arcgisscripting.create()
#Set the Name from a field called Address and the default curb approach to be 'right side of vehicle'
Field_map = "Name Address #;CurbApproach # 1"
gp.AddLocations_na(MyRouteLayer, "Stops", "d:\\mydata\\mystops.shp", Field_map, "500 Meters")

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.