com.esri.arcgis.geoprocessing.tools.networkanalysttools
Class AddLocations

java.lang.Object
  extended by com.esri.arcgis.geoprocessing.AbstractGPTool
      extended by com.esri.arcgis.geoprocessing.tools.networkanalysttools.AddLocations
All Implemented Interfaces:
GPTool

public class AddLocations
extends AbstractGPTool

Adds network analysis objects to a network analysis layer. The objects are added to specific sublayers such as Stops and Barriers. Objects are input as features or records. The Add Locations tool is contained in the Network Analyst Tools tool box.

Usage tips:


Field Summary
 
Fields inherited from class com.esri.arcgis.geoprocessing.AbstractGPTool
vals
 
Constructor Summary
AddLocations()
          Creates the Add Locations tool with defaults.
AddLocations(Object inNetworkAnalysisLayer, String subLayer, Object inTable, Object fieldMappings, Object searchTolerance)
          Creates the Add Locations tool with the required parameters.
 
Method Summary
 String getAppend()
          Returns the Append to existing locations parameter of this tool .
 String getExcludeRestrictedElements()
          Returns the Exclude restricted portions of the network parameter of this tool .
 Object getFieldMappings()
          Returns the Field mappings parameter of this tool .
 Object getInNetworkAnalysisLayer()
          Returns the Input network analysis layer parameter of this tool .
 Object getInTable()
          Returns the Input locations parameter of this tool .
 String getMatchType()
          Returns the Find closest among all classes parameter of this tool .
 Object getOutputLayer()
          Returns the Network Analyst Layer parameter of this tool (Read only).
 Object getSearchCriteria()
          Returns the Search criteria parameter of this tool .
 Object getSearchQuery()
          Returns the Search query parameter of this tool .
 Object getSearchTolerance()
          Returns the Search tolerance parameter of this tool .
 Object getSnapOffset()
          Returns the Snap Offset parameter of this tool .
 String getSnapToPositionAlongNetwork()
          Returns the Snap to Network parameter of this tool .
 Object getSortField()
          Returns the Sort field parameter of this tool .
 String getSubLayer()
          Returns the Sub layer parameter of this tool .
 String getToolboxAlias()
          Returns the alias of the tool box containing this tool.
 String getToolboxName()
          Returns the name of the tool box containing this tool.
 String getToolName()
          Returns the name of this tool.
 void setAppend(String append)
          Sets the Append to existing locations parameter of this tool .
 void setExcludeRestrictedElements(String excludeRestrictedElements)
          Sets the Exclude restricted portions of the network parameter of this tool .
 void setFieldMappings(Object fieldMappings)
          Sets the Field mappings parameter of this tool .
 void setInNetworkAnalysisLayer(Object inNetworkAnalysisLayer)
          Sets the Input network analysis layer parameter of this tool .
 void setInTable(Object inTable)
          Sets the Input locations parameter of this tool .
 void setMatchType(String matchType)
          Sets the Find closest among all classes parameter of this tool .
 void setSearchCriteria(Object searchCriteria)
          Sets the Search criteria parameter of this tool .
 void setSearchQuery(Object searchQuery)
          Sets the Search query parameter of this tool .
 void setSearchTolerance(Object searchTolerance)
          Sets the Search tolerance parameter of this tool .
 void setSnapOffset(Object snapOffset)
          Sets the Snap Offset parameter of this tool .
 void setSnapToPositionAlongNetwork(String snapToPositionAlongNetwork)
          Sets the Snap to Network parameter of this tool .
 void setSortField(Object sortField)
          Sets the Sort field parameter of this tool .
 void setSubLayer(String subLayer)
          Sets the Sub layer parameter of this tool .
 
Methods inherited from class com.esri.arcgis.geoprocessing.AbstractGPTool
getParameterValues, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddLocations

public AddLocations()
Creates the Add Locations tool with defaults.

Initializes the array of tool parameters with the default values specified when the tool was created.


AddLocations

public AddLocations(Object inNetworkAnalysisLayer,
                    String subLayer,
                    Object inTable,
                    Object fieldMappings,
                    Object searchTolerance)
Creates the Add Locations tool with the required parameters.

Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.

Parameters:
inNetworkAnalysisLayer - network analysis layer to which the network analysis objects will be added.
subLayer - the sublayer of the network analysis layer to which the network analysis objects will be added.
inTable - the feature class or the table that is the source for the new network analysis objects.
fieldMappings - sets the values for the properties of the network analysis objects. Properties can be set to a constant or mapped to a field from the input feature class or table. the parameter value is specified as a semicolon-separated list of three values made up of the property name, the field name, and the default value. You should specify either the field name or the default value for a property. For example, the parameter value "Name Address #; Attr_Minutes # 2", specifies that the Name property is mapped from the Address field and the Attr_Minutes property should have a constant value of 2 when adding your input features. if a particular property is not mapped to a field or has a default value or is not included in the parameter value, it will have the default mapping. If you want to use the default mappings for all the properties, use # for the parameter value. if both the Field and the Default Value are not specified for a property, the resulting network analysis objects will have null values for that property. if the data you are loading contains network locations or location ranges based on the network dataset used for the analysis, map the network location fields from your input features to the network location properties. For point locations such as Stops or Incidents, map the SourceID, SourceOID, PosAlong and SideOfEdge properties and for line or polygon locations such as Polygon Barriers, map the Locations property. Adding the network analysis objects using the network location fields is much faster than loading them by geometry. Specifying the network location fields in the field mappings is similar to using the Use Network Location fields instead of geometry parameter from the tool dialog . if you specify the field mapping for any of the network location properties, you need to specify the field mappings for the remaining network location properties to avoid a tool execution error.
searchTolerance - the search tolerance for locating the input features on the network. Features that are outside the search tolerance are left unlocated. The parameter includes a value and units for the tolerance. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value.
Method Detail

getInNetworkAnalysisLayer

public Object getInNetworkAnalysisLayer()
Returns the Input network analysis layer parameter of this tool . This parameter is network analysis layer to which the network analysis objects will be added. This is a required parameter.

Returns:
the Input network analysis layer

setInNetworkAnalysisLayer

public void setInNetworkAnalysisLayer(Object inNetworkAnalysisLayer)
Sets the Input network analysis layer parameter of this tool . This parameter is network analysis layer to which the network analysis objects will be added. This is a required parameter.

Parameters:
inNetworkAnalysisLayer - network analysis layer to which the network analysis objects will be added.

getSubLayer

public String getSubLayer()
Returns the Sub layer parameter of this tool . This parameter is the sublayer of the network analysis layer to which the network analysis objects will be added. This is a required parameter.

Returns:
the Sub layer

setSubLayer

public void setSubLayer(String subLayer)
Sets the Sub layer parameter of this tool . This parameter is the sublayer of the network analysis layer to which the network analysis objects will be added. This is a required parameter.

Parameters:
subLayer - the sublayer of the network analysis layer to which the network analysis objects will be added.

getInTable

public Object getInTable()
Returns the Input locations parameter of this tool . This parameter is the feature class or the table that is the source for the new network analysis objects. This is a required parameter.

Returns:
the Input locations

setInTable

public void setInTable(Object inTable)
Sets the Input locations parameter of this tool . This parameter is the feature class or the table that is the source for the new network analysis objects. This is a required parameter.

Parameters:
inTable - the feature class or the table that is the source for the new network analysis objects.

getFieldMappings

public Object getFieldMappings()
Returns the Field mappings parameter of this tool . This parameter is sets the values for the properties of the network analysis objects. Properties can be set to a constant or mapped to a field from the input feature class or table. the parameter value is specified as a semicolon-separated list of three values made up of the property name, the field name, and the default value. You should specify either the field name or the default value for a property. For example, the parameter value "Name Address #; Attr_Minutes # 2", specifies that the Name property is mapped from the Address field and the Attr_Minutes property should have a constant value of 2 when adding your input features. if a particular property is not mapped to a field or has a default value or is not included in the parameter value, it will have the default mapping. If you want to use the default mappings for all the properties, use # for the parameter value. if both the Field and the Default Value are not specified for a property, the resulting network analysis objects will have null values for that property. if the data you are loading contains network locations or location ranges based on the network dataset used for the analysis, map the network location fields from your input features to the network location properties. For point locations such as Stops or Incidents, map the SourceID, SourceOID, PosAlong and SideOfEdge properties and for line or polygon locations such as Polygon Barriers, map the Locations property. Adding the network analysis objects using the network location fields is much faster than loading them by geometry. Specifying the network location fields in the field mappings is similar to using the Use Network Location fields instead of geometry parameter from the tool dialog . if you specify the field mapping for any of the network location properties, you need to specify the field mappings for the remaining network location properties to avoid a tool execution error. This is a required parameter.

Returns:
the Field mappings

setFieldMappings

public void setFieldMappings(Object fieldMappings)
Sets the Field mappings parameter of this tool . This parameter is sets the values for the properties of the network analysis objects. Properties can be set to a constant or mapped to a field from the input feature class or table. the parameter value is specified as a semicolon-separated list of three values made up of the property name, the field name, and the default value. You should specify either the field name or the default value for a property. For example, the parameter value "Name Address #; Attr_Minutes # 2", specifies that the Name property is mapped from the Address field and the Attr_Minutes property should have a constant value of 2 when adding your input features. if a particular property is not mapped to a field or has a default value or is not included in the parameter value, it will have the default mapping. If you want to use the default mappings for all the properties, use # for the parameter value. if both the Field and the Default Value are not specified for a property, the resulting network analysis objects will have null values for that property. if the data you are loading contains network locations or location ranges based on the network dataset used for the analysis, map the network location fields from your input features to the network location properties. For point locations such as Stops or Incidents, map the SourceID, SourceOID, PosAlong and SideOfEdge properties and for line or polygon locations such as Polygon Barriers, map the Locations property. Adding the network analysis objects using the network location fields is much faster than loading them by geometry. Specifying the network location fields in the field mappings is similar to using the Use Network Location fields instead of geometry parameter from the tool dialog . if you specify the field mapping for any of the network location properties, you need to specify the field mappings for the remaining network location properties to avoid a tool execution error. This is a required parameter.

Parameters:
fieldMappings - sets the values for the properties of the network analysis objects. Properties can be set to a constant or mapped to a field from the input feature class or table. the parameter value is specified as a semicolon-separated list of three values made up of the property name, the field name, and the default value. You should specify either the field name or the default value for a property. For example, the parameter value "Name Address #; Attr_Minutes # 2", specifies that the Name property is mapped from the Address field and the Attr_Minutes property should have a constant value of 2 when adding your input features. if a particular property is not mapped to a field or has a default value or is not included in the parameter value, it will have the default mapping. If you want to use the default mappings for all the properties, use # for the parameter value. if both the Field and the Default Value are not specified for a property, the resulting network analysis objects will have null values for that property. if the data you are loading contains network locations or location ranges based on the network dataset used for the analysis, map the network location fields from your input features to the network location properties. For point locations such as Stops or Incidents, map the SourceID, SourceOID, PosAlong and SideOfEdge properties and for line or polygon locations such as Polygon Barriers, map the Locations property. Adding the network analysis objects using the network location fields is much faster than loading them by geometry. Specifying the network location fields in the field mappings is similar to using the Use Network Location fields instead of geometry parameter from the tool dialog . if you specify the field mapping for any of the network location properties, you need to specify the field mappings for the remaining network location properties to avoid a tool execution error.

getSearchTolerance

public Object getSearchTolerance()
Returns the Search tolerance parameter of this tool . This parameter is the search tolerance for locating the input features on the network. Features that are outside the search tolerance are left unlocated. The parameter includes a value and units for the tolerance. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value. This is a required parameter.

Returns:
the Search tolerance

setSearchTolerance

public void setSearchTolerance(Object searchTolerance)
Sets the Search tolerance parameter of this tool . This parameter is the search tolerance for locating the input features on the network. Features that are outside the search tolerance are left unlocated. The parameter includes a value and units for the tolerance. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value. This is a required parameter.

Parameters:
searchTolerance - the search tolerance for locating the input features on the network. Features that are outside the search tolerance are left unlocated. The parameter includes a value and units for the tolerance. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value.

getSortField

public Object getSortField()
Returns the Sort field parameter of this tool . This parameter is a field on which the network analysis objects are sorted as they are added to the network analysis layer. The default is the ObjectID field on the input feature class or the table. This is an optional parameter.

Returns:
the Sort field

setSortField

public void setSortField(Object sortField)
Sets the Sort field parameter of this tool . This parameter is a field on which the network analysis objects are sorted as they are added to the network analysis layer. The default is the ObjectID field on the input feature class or the table. This is an optional parameter.

Parameters:
sortField - a field on which the network analysis objects are sorted as they are added to the network analysis layer. The default is the ObjectID field on the input feature class or the table.

getSearchCriteria

public Object getSearchCriteria()
Returns the Search criteria parameter of this tool . This parameter is specifies which sources in the network dataset will be searched when finding locations and what portions of geometry (also known as snap types) will be used. the parameter value is specified as a list with nested lists. The nested list is made up of two values indicating the name and the snap type for each network source. The snap type is specified using the "SHAPE", "MIDDLE", "END" ,or "NONE" keywords. For example, when finding locations, the parameter value [["Streets","SHAPE"],["Streets_ND_Junctions","NONE"]] specifies that the search can locate on the shape of the Streets source but not on the Streets_ND_Junctions source. to specify multiple snap types for a single network source, use the combination of the snap type keywords separate by an underscore. For example, MIDDLE_END specifies that the locations can be snapped to the middle or end of the network source. when adding line or polygon network locations, only the Shape snap type is used even if other snap types are specified. This is an optional parameter.

Returns:
the Search criteria

setSearchCriteria

public void setSearchCriteria(Object searchCriteria)
Sets the Search criteria parameter of this tool . This parameter is specifies which sources in the network dataset will be searched when finding locations and what portions of geometry (also known as snap types) will be used. the parameter value is specified as a list with nested lists. The nested list is made up of two values indicating the name and the snap type for each network source. The snap type is specified using the "SHAPE", "MIDDLE", "END" ,or "NONE" keywords. For example, when finding locations, the parameter value [["Streets","SHAPE"],["Streets_ND_Junctions","NONE"]] specifies that the search can locate on the shape of the Streets source but not on the Streets_ND_Junctions source. to specify multiple snap types for a single network source, use the combination of the snap type keywords separate by an underscore. For example, MIDDLE_END specifies that the locations can be snapped to the middle or end of the network source. when adding line or polygon network locations, only the Shape snap type is used even if other snap types are specified. This is an optional parameter.

Parameters:
searchCriteria - specifies which sources in the network dataset will be searched when finding locations and what portions of geometry (also known as snap types) will be used. the parameter value is specified as a list with nested lists. The nested list is made up of two values indicating the name and the snap type for each network source. The snap type is specified using the "SHAPE", "MIDDLE", "END" ,or "NONE" keywords. For example, when finding locations, the parameter value [["Streets","SHAPE"],["Streets_ND_Junctions","NONE"]] specifies that the search can locate on the shape of the Streets source but not on the Streets_ND_Junctions source. to specify multiple snap types for a single network source, use the combination of the snap type keywords separate by an underscore. For example, MIDDLE_END specifies that the locations can be snapped to the middle or end of the network source. when adding line or polygon network locations, only the Shape snap type is used even if other snap types are specified.

getMatchType

public String getMatchType()
Returns the Find closest among all classes parameter of this tool . This parameter is the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Find closest among all classes

setMatchType

public void setMatchType(String matchType)
Sets the Find closest among all classes parameter of this tool . This parameter is the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
matchType - the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value.

getAppend

public String getAppend()
Returns the Append to existing locations parameter of this tool . This parameter is specifies whether or not to append new network analysis objects to existing objects. This is an optional parameter.

Returns:
the Append to existing locations

setAppend

public void setAppend(String append)
Sets the Append to existing locations parameter of this tool . This parameter is specifies whether or not to append new network analysis objects to existing objects. This is an optional parameter.

Parameters:
append - specifies whether or not to append new network analysis objects to existing objects.

getSnapToPositionAlongNetwork

public String getSnapToPositionAlongNetwork()
Returns the Snap to Network parameter of this tool . This parameter is specifies that you want to snap the network locations along the network dataset or at some specified offset from the network dataset. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Snap to Network

setSnapToPositionAlongNetwork

public void setSnapToPositionAlongNetwork(String snapToPositionAlongNetwork)
Sets the Snap to Network parameter of this tool . This parameter is specifies that you want to snap the network locations along the network dataset or at some specified offset from the network dataset. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
snapToPositionAlongNetwork - specifies that you want to snap the network locations along the network dataset or at some specified offset from the network dataset. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value.

getSnapOffset

public Object getSnapOffset()
Returns the Snap Offset parameter of this tool . This parameter is 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. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Snap Offset

setSnapOffset

public void setSnapOffset(Object snapOffset)
Sets the Snap Offset parameter of this tool . This parameter is 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. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
snapOffset - 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. the parameter is not used when adding locations to the Line Barriers or Polygon Barriers sublayers. In such cases, use "#" as the parameter value.

getExcludeRestrictedElements

public String getExcludeRestrictedElements()
Returns the Exclude restricted portions of the network parameter of this tool . This is an optional parameter.

Returns:
the Exclude restricted portions of the network

setExcludeRestrictedElements

public void setExcludeRestrictedElements(String excludeRestrictedElements)
Sets the Exclude restricted portions of the network parameter of this tool . This is an optional parameter.

Parameters:
excludeRestrictedElements - null

getSearchQuery

public Object getSearchQuery()
Returns the Search query parameter of this tool . This parameter is specifies a query to restrict the search to a subset of the features within a source feature class. This is useful if you don't want to find features that may be unsuited for a network location. For example, if you are loading centroids of polygons and don't want to locate on local roads, you can define a query that searches for major roads only. the parameter value is specified as a list with nested lists. The nested list is made up of two values indicating the name and the SQL expression for all of the network sources. The syntax for the SQL expression differs slightly depending on the type of the network source feature class. For example, if you're querying source feature classes stored in file or ArcSDE geodatabases, shapefiles, or SDC, enclose field names in double quotes: "CFCC". If you're querying source feature classes stored in personal geodatabases, enclose fields in square brackets: [CFCC]. if you don't want to specify a query for a particular source, use "#" as the value for the SQL expression or exclude the source name and the SQL expression from the parameter value. If you don't want to specify a query for all of the network sources, use "#" as the parameter value. for example, the parameter value [["Streets","\"CFCC\" = 'A15'"], ["Streets_ND_Junctions",""]] specifies a SQL expression for the Streets source feature class and no expression for Streets_ND_Junctions source feature class. Note that the double quotes used to enclose the field name CFCC are escaped using back slash characters to avoid a parsing error from the Python interpreter. This is an optional parameter.

Returns:
the Search query

setSearchQuery

public void setSearchQuery(Object searchQuery)
Sets the Search query parameter of this tool . This parameter is specifies a query to restrict the search to a subset of the features within a source feature class. This is useful if you don't want to find features that may be unsuited for a network location. For example, if you are loading centroids of polygons and don't want to locate on local roads, you can define a query that searches for major roads only. the parameter value is specified as a list with nested lists. The nested list is made up of two values indicating the name and the SQL expression for all of the network sources. The syntax for the SQL expression differs slightly depending on the type of the network source feature class. For example, if you're querying source feature classes stored in file or ArcSDE geodatabases, shapefiles, or SDC, enclose field names in double quotes: "CFCC". If you're querying source feature classes stored in personal geodatabases, enclose fields in square brackets: [CFCC]. if you don't want to specify a query for a particular source, use "#" as the value for the SQL expression or exclude the source name and the SQL expression from the parameter value. If you don't want to specify a query for all of the network sources, use "#" as the parameter value. for example, the parameter value [["Streets","\"CFCC\" = 'A15'"], ["Streets_ND_Junctions",""]] specifies a SQL expression for the Streets source feature class and no expression for Streets_ND_Junctions source feature class. Note that the double quotes used to enclose the field name CFCC are escaped using back slash characters to avoid a parsing error from the Python interpreter. This is an optional parameter.

Parameters:
searchQuery - specifies a query to restrict the search to a subset of the features within a source feature class. This is useful if you don't want to find features that may be unsuited for a network location. For example, if you are loading centroids of polygons and don't want to locate on local roads, you can define a query that searches for major roads only. the parameter value is specified as a list with nested lists. The nested list is made up of two values indicating the name and the SQL expression for all of the network sources. The syntax for the SQL expression differs slightly depending on the type of the network source feature class. For example, if you're querying source feature classes stored in file or ArcSDE geodatabases, shapefiles, or SDC, enclose field names in double quotes: "CFCC". If you're querying source feature classes stored in personal geodatabases, enclose fields in square brackets: [CFCC]. if you don't want to specify a query for a particular source, use "#" as the value for the SQL expression or exclude the source name and the SQL expression from the parameter value. If you don't want to specify a query for all of the network sources, use "#" as the parameter value. for example, the parameter value [["Streets","\"CFCC\" = 'A15'"], ["Streets_ND_Junctions",""]] specifies a SQL expression for the Streets source feature class and no expression for Streets_ND_Junctions source feature class. Note that the double quotes used to enclose the field name CFCC are escaped using back slash characters to avoid a parsing error from the Python interpreter.

getOutputLayer

public Object getOutputLayer()
Returns the Network Analyst Layer parameter of this tool (Read only). This is an derived parameter.

Returns:
the Network Analyst Layer

getToolName

public String getToolName()
Returns the name of this tool.

Returns:
the tool name

getToolboxName

public String getToolboxName()
Returns the name of the tool box containing this tool.

Returns:
the tool box name

getToolboxAlias

public String getToolboxAlias()
Returns the alias of the tool box containing this tool.

Returns:
the tool box alias