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

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

public class CalculateLocations
extends AbstractGPTool

Adds fields to the input features that contain the network location of the features. The tool is used to store the network location information as feature attributes to quickly load the features as inputs for a network analysis layer. The Calculate 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
CalculateLocations()
          Creates the Calculate Locations tool with defaults.
CalculateLocations(Object inPointFeatures, Object inNetworkDataset, Object searchTolerance, Object searchCriteria)
          Creates the Calculate Locations tool with the required parameters.
 
Method Summary
 Object getDistanceField()
          Returns the Distance from feature field parameter of this tool .
 String getExcludeRestrictedElements()
          Returns the Exclude restricted portions of the network parameter of this tool .
 Object getInNetworkDataset()
          Returns the Input analysis network parameter of this tool .
 Object getInPointFeatures()
          Returns the Input features parameter of this tool .
 Object getLocationField()
          Returns the Location ranges field parameter of this tool .
 String getMatchType()
          Returns the Find closest among all classes parameter of this tool .
 Object getOutPointFeatureClass()
          Returns the Output derived feature class parameter of this tool (Read only).
 Object getPositionField()
          Returns the Percent along field parameter of this tool .
 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 getSideField()
          Returns the Side of edge field parameter of this tool .
 Object getSnapXField()
          Returns the Located X-coordinate field parameter of this tool .
 Object getSnapYField()
          Returns the Located Y-coordinate field parameter of this tool .
 Object getSnapZField()
          Returns the Located Z-coordinate field parameter of this tool .
 Object getSourceIDField()
          Returns the Source ID field parameter of this tool .
 Object getSourceOIDField()
          Returns the Source OID field 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 setDistanceField(Object distanceField)
          Sets the Distance from feature field parameter of this tool .
 void setExcludeRestrictedElements(String excludeRestrictedElements)
          Sets the Exclude restricted portions of the network parameter of this tool .
 void setInNetworkDataset(Object inNetworkDataset)
          Sets the Input analysis network parameter of this tool .
 void setInPointFeatures(Object inPointFeatures)
          Sets the Input features parameter of this tool .
 void setLocationField(Object locationField)
          Sets the Location ranges field parameter of this tool .
 void setMatchType(String matchType)
          Sets the Find closest among all classes parameter of this tool .
 void setPositionField(Object positionField)
          Sets the Percent along field 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 setSideField(Object sideField)
          Sets the Side of edge field parameter of this tool .
 void setSnapXField(Object snapXField)
          Sets the Located X-coordinate field parameter of this tool .
 void setSnapYField(Object snapYField)
          Sets the Located Y-coordinate field parameter of this tool .
 void setSnapZField(Object snapZField)
          Sets the Located Z-coordinate field parameter of this tool .
 void setSourceIDField(Object sourceIDField)
          Sets the Source ID field parameter of this tool .
 void setSourceOIDField(Object sourceOIDField)
          Sets the Source OID field 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

CalculateLocations

public CalculateLocations()
Creates the Calculate Locations tool with defaults.

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


CalculateLocations

public CalculateLocations(Object inPointFeatures,
                          Object inNetworkDataset,
                          Object searchTolerance,
                          Object searchCriteria)
Creates the Calculate 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:
inPointFeatures - the input features for which the network locations will be calculated. for line and polygon features, since the network location information is stored in a blob field (specified in the Location ranges field parameter), only geodatabase feature classes are supported.
inNetworkDataset - the network dataset used to calculate the locations. if a sublayer of a network analysis layer is used as input features, the parameter must be set to the network dataset referenced by the network analysis layer.
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 calculating locations for line or polygon features. In such cases, use "#" as the parameter value.
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. for geodatabase network datasets, the snap types can be specified for each subtype of the network source. when calculating locations for line or polygon features, only the Shape snap type is used even if other snap types are specified.
Method Detail

getInPointFeatures

public Object getInPointFeatures()
Returns the Input features parameter of this tool . This parameter is the input features for which the network locations will be calculated. for line and polygon features, since the network location information is stored in a blob field (specified in the Location ranges field parameter), only geodatabase feature classes are supported. This is a required parameter.

Returns:
the Input features

setInPointFeatures

public void setInPointFeatures(Object inPointFeatures)
Sets the Input features parameter of this tool . This parameter is the input features for which the network locations will be calculated. for line and polygon features, since the network location information is stored in a blob field (specified in the Location ranges field parameter), only geodatabase feature classes are supported. This is a required parameter.

Parameters:
inPointFeatures - the input features for which the network locations will be calculated. for line and polygon features, since the network location information is stored in a blob field (specified in the Location ranges field parameter), only geodatabase feature classes are supported.

getInNetworkDataset

public Object getInNetworkDataset()
Returns the Input analysis network parameter of this tool . This parameter is the network dataset used to calculate the locations. if a sublayer of a network analysis layer is used as input features, the parameter must be set to the network dataset referenced by the network analysis layer. This is a required parameter.

Returns:
the Input analysis network

setInNetworkDataset

public void setInNetworkDataset(Object inNetworkDataset)
Sets the Input analysis network parameter of this tool . This parameter is the network dataset used to calculate the locations. if a sublayer of a network analysis layer is used as input features, the parameter must be set to the network dataset referenced by the network analysis layer. This is a required parameter.

Parameters:
inNetworkDataset - the network dataset used to calculate the locations. if a sublayer of a network analysis layer is used as input features, the parameter must be set to the network dataset referenced by the network analysis layer.

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 calculating locations for line or polygon features. 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 calculating locations for line or polygon features. 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 calculating locations for line or polygon features. In such cases, use "#" as the parameter value.

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. for geodatabase network datasets, the snap types can be specified for each subtype of the network source. when calculating locations for line or polygon features, only the Shape snap type is used even if other snap types are specified. This is a required 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. for geodatabase network datasets, the snap types can be specified for each subtype of the network source. when calculating locations for line or polygon features, only the Shape snap type is used even if other snap types are specified. This is a required 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. for geodatabase network datasets, the snap types can be specified for each subtype of the network source. when calculating locations for line or polygon features, 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 calculating locations for line or polygon features. 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 calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
matchType - the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value.

getSourceIDField

public Object getSourceIDField()
Returns the Source ID field parameter of this tool . This parameter is name of the field to be created or updated with the source ID of the computed network location. A field called "SourceID" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Source ID field

setSourceIDField

public void setSourceIDField(Object sourceIDField)
Sets the Source ID field parameter of this tool . This parameter is name of the field to be created or updated with the source ID of the computed network location. A field called "SourceID" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
sourceIDField - name of the field to be created or updated with the source ID of the computed network location. A field called "SourceID" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value.

getSourceOIDField

public Object getSourceOIDField()
Returns the Source OID field parameter of this tool . This parameter is name of the field to be created or updated with the source OID of the computed network location. A field called "SourceOID" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Source OID field

setSourceOIDField

public void setSourceOIDField(Object sourceOIDField)
Sets the Source OID field parameter of this tool . This parameter is name of the field to be created or updated with the source OID of the computed network location. A field called "SourceOID" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
sourceOIDField - name of the field to be created or updated with the source OID of the computed network location. A field called "SourceOID" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value.

getPositionField

public Object getPositionField()
Returns the Percent along field parameter of this tool . This parameter is name of the field to be created or updated with the percent along of the computed network location. A field called "PosAlong" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Percent along field

setPositionField

public void setPositionField(Object positionField)
Sets the Percent along field parameter of this tool . This parameter is name of the field to be created or updated with the percent along of the computed network location. A field called "PosAlong" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
positionField - name of the field to be created or updated with the percent along of the computed network location. A field called "PosAlong" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value.

getSideField

public Object getSideField()
Returns the Side of edge field parameter of this tool . This parameter is name of the field to be created or updated with the side of edge on which the point feature is located on the computed network location. A field called "SideOfEdge" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Side of edge field

setSideField

public void setSideField(Object sideField)
Sets the Side of edge field parameter of this tool . This parameter is name of the field to be created or updated with the side of edge on which the point feature is located on the computed network location. A field called "SideOfEdge" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
sideField - name of the field to be created or updated with the side of edge on which the point feature is located on the computed network location. A field called "SideOfEdge" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value.

getSnapXField

public Object getSnapXField()
Returns the Located X-coordinate field parameter of this tool . This is an optional parameter.

Returns:
the Located X-coordinate field

setSnapXField

public void setSnapXField(Object snapXField)
Sets the Located X-coordinate field parameter of this tool . This is an optional parameter.

Parameters:
snapXField - null

getSnapYField

public Object getSnapYField()
Returns the Located Y-coordinate field parameter of this tool . This is an optional parameter.

Returns:
the Located Y-coordinate field

setSnapYField

public void setSnapYField(Object snapYField)
Sets the Located Y-coordinate field parameter of this tool . This is an optional parameter.

Parameters:
snapYField - null

getDistanceField

public Object getDistanceField()
Returns the Distance from feature field parameter of this tool . This parameter is name of the field to be created or updated with the distance of the point feature from the computed network location. A field called "Distance" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Distance from feature field

setDistanceField

public void setDistanceField(Object distanceField)
Sets the Distance from feature field parameter of this tool . This parameter is name of the field to be created or updated with the distance of the point feature from the computed network location. A field called "Distance" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
distanceField - name of the field to be created or updated with the distance of the point feature from the computed network location. A field called "Distance" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value.

getSnapZField

public Object getSnapZField()
Returns the Located Z-coordinate field parameter of this tool . This parameter is name of the field to be created or updated with the z-coordinate of the computed network location. A field called "SnapZ" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. when calculating locations for point features, the parameter is used only when the input network dataset supports connectivity based on z-coordinate values of the network sources. In all other cases, use "#" as the parameter value. This is an optional parameter.

Returns:
the Located Z-coordinate field

setSnapZField

public void setSnapZField(Object snapZField)
Sets the Located Z-coordinate field parameter of this tool . This parameter is name of the field to be created or updated with the z-coordinate of the computed network location. A field called "SnapZ" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. when calculating locations for point features, the parameter is used only when the input network dataset supports connectivity based on z-coordinate values of the network sources. In all other cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
snapZField - name of the field to be created or updated with the z-coordinate of the computed network location. A field called "SnapZ" is created or updated by default. the parameter is not used when calculating locations for line or polygon features. In such cases, use "#" as the parameter value. when calculating locations for point features, the parameter is used only when the input network dataset supports connectivity based on z-coordinate values of the network sources. In all other cases, use "#" as the parameter value.

getLocationField

public Object getLocationField()
Returns the Location ranges field parameter of this tool . This parameter is name of the field to be created or updated with the location ranges of the computed network locations for the line or polygon features. A field called "Locations" is created or updated by default. the parameter is used only when the calculating locations for line or polygon features. For input point features, use "#" as the parameter value. This is an optional parameter.

Returns:
the Location ranges field

setLocationField

public void setLocationField(Object locationField)
Sets the Location ranges field parameter of this tool . This parameter is name of the field to be created or updated with the location ranges of the computed network locations for the line or polygon features. A field called "Locations" is created or updated by default. the parameter is used only when the calculating locations for line or polygon features. For input point features, use "#" as the parameter value. This is an optional parameter.

Parameters:
locationField - name of the field to be created or updated with the location ranges of the computed network locations for the line or polygon features. A field called "Locations" is created or updated by default. the parameter is used only when the calculating locations for line or polygon features. For input point features, use "#" as the parameter value.

getExcludeRestrictedElements

public String getExcludeRestrictedElements()
Returns the Exclude restricted portions of the network parameter of this tool . This parameter is this parameter is applicable only when the input features are from the sub layer of a network analysis layer and are not barrier objects. In all other cases, use "#" as the parameter value. 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 parameter is this parameter is applicable only when the input features are from the sub layer of a network analysis layer and are not barrier objects. In all other cases, use "#" as the parameter value. This is an optional parameter.

Parameters:
excludeRestrictedElements - this parameter is applicable only when the input features are from the sub layer of a network analysis layer and are not barrier objects. In all other cases, use "#" as the parameter value.

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.

getOutPointFeatureClass

public Object getOutPointFeatureClass()
Returns the Output derived feature class parameter of this tool (Read only). This is an derived parameter.

Returns:
the Output derived feature class

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