## com.esri.arcgis.geoprocessing.tools.spatialstatisticstools Class CalculateDistanceBand

```java.lang.Object com.esri.arcgis.geoprocessing.AbstractGPTool com.esri.arcgis.geoprocessing.tools.spatialstatisticstools.CalculateDistanceBand
```
All Implemented Interfaces:
GPTool

`public class CalculateDistanceBandextends AbstractGPTool`

Returns the minimum, the maximum, and the average distance to the specified Nth nearest neighbor (N is an input parameter) for a set of features. Results are accessible from the Results window. The Calculate Distance Band from Neighbor Count tool is contained in the Spatial Statistics Tools tool box.

#### Usage tips:

• Given a set of features, this tool returns three numbers: the minimum, the maximum, and the average distance to a specified number of neighbors (N). Example: if you specify 8 for the Neighbors parameter, this tool creates a list of distances between every feature and its 8th nearest neighbor; from this list of distances it then calculates the minimum, maximum, and average distance.
• The maximum value is the distance you would have to travel away from each feature to ensure every feature has at least N neighbors.
• The minimum value is the distance you would travel away from each feature to ensure that at least one feature has N neighbors.
• The average value is the average distance you would travel away from each feature to find its N nearest neighbors.
• The output from this tool is written as messages to the . Right-click on theentry and selectto see results in a.If you execute this tool in the , output will also be displayed in the.
• Some tools, such as and , allow you to specify a neighborhood Distance Band or Threshold Distance value. By using the Maximum Distance output value from this tool for the Distance Band or Threshold Distance parameter, you ensure every feature in the input feature class has at least N neighbors.
• This tool provides one strategy for determining a Distance Band or Threshold Distance value to use with tools in the Spatial Statistics Toolbox such as or . See for additional strategies.
• The distances returned by this tool are in the units of the geoprocessing environment .
• Calculations based on either Euclidean or Manhattan distance require to accurately measure distances.
• For line and polygon features, feature centroids are used in distance computations. For multipoints, polylines, or polygons with multiple parts, the centroid is computed using the weighted mean center of all feature parts. The weighting for point features is 1, for line features is length, and for polygon features is area.

Field Summary

Fields inherited from class com.esri.arcgis.geoprocessing.AbstractGPTool
`vals`

Constructor Summary
`CalculateDistanceBand()`
Creates the Calculate Distance Band from Neighbor Count tool with defaults.
```CalculateDistanceBand(Object inputFeatures, int neighbors, String distanceMethod)```
Creates the Calculate Distance Band from Neighbor Count tool with the required parameters.

Method Summary
` double` `getAverageDistance()`
Returns the Average Distance parameter of this tool (Read only).
` String` `getDistanceMethod()`
Returns the Distance Method parameter of this tool .
` Object` `getInputFeatures()`
Returns the Input Features parameter of this tool .
` double` `getMaximumDistance()`
Returns the Maximum Distance parameter of this tool (Read only).
` double` `getMinimumDistance()`
Returns the Minimum Distance parameter of this tool (Read only).
` int` `getNeighbors()`
Returns the Neighbors 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` `setDistanceMethod(String distanceMethod)`
Sets the Distance Method parameter of this tool .
` void` `setInputFeatures(Object inputFeatures)`
Sets the Input Features parameter of this tool .
` void` `setNeighbors(int neighbors)`
Sets the Neighbors 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

### CalculateDistanceBand

`public CalculateDistanceBand()`
Creates the Calculate Distance Band from Neighbor Count tool with defaults.

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

### CalculateDistanceBand

```public CalculateDistanceBand(Object inputFeatures,
int neighbors,
String distanceMethod)```
Creates the Calculate Distance Band from Neighbor Count 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:
`inputFeatures` - the feature class or layer used to calculate distance statistics.
`neighbors` - the number of neighbors (N) to consider for each feature. This number should be any integer between one and the total number of features in the feature class. A list of distances between each feature and its Nth neighbor is compiled, and the maximum, minimum, and average distances are output to the Results window.
`distanceMethod` - specifies how distances are calculated from each feature to neighboring features.
Method Detail

### getInputFeatures

`public Object getInputFeatures()`
Returns the Input Features parameter of this tool . This parameter is the feature class or layer used to calculate distance statistics. This is a required parameter.

Returns:
the Input Features

### setInputFeatures

`public void setInputFeatures(Object inputFeatures)`
Sets the Input Features parameter of this tool . This parameter is the feature class or layer used to calculate distance statistics. This is a required parameter.

Parameters:
`inputFeatures` - the feature class or layer used to calculate distance statistics.

### getNeighbors

`public int getNeighbors()`
Returns the Neighbors parameter of this tool . This parameter is the number of neighbors (N) to consider for each feature. This number should be any integer between one and the total number of features in the feature class. A list of distances between each feature and its Nth neighbor is compiled, and the maximum, minimum, and average distances are output to the Results window. This is a required parameter.

Returns:
the Neighbors

### setNeighbors

`public void setNeighbors(int neighbors)`
Sets the Neighbors parameter of this tool . This parameter is the number of neighbors (N) to consider for each feature. This number should be any integer between one and the total number of features in the feature class. A list of distances between each feature and its Nth neighbor is compiled, and the maximum, minimum, and average distances are output to the Results window. This is a required parameter.

Parameters:
`neighbors` - the number of neighbors (N) to consider for each feature. This number should be any integer between one and the total number of features in the feature class. A list of distances between each feature and its Nth neighbor is compiled, and the maximum, minimum, and average distances are output to the Results window.

### getDistanceMethod

`public String getDistanceMethod()`
Returns the Distance Method parameter of this tool . This parameter is specifies how distances are calculated from each feature to neighboring features. This is a required parameter.

Returns:
the Distance Method

### setDistanceMethod

`public void setDistanceMethod(String distanceMethod)`
Sets the Distance Method parameter of this tool . This parameter is specifies how distances are calculated from each feature to neighboring features. This is a required parameter.

Parameters:
`distanceMethod` - specifies how distances are calculated from each feature to neighboring features.

### getMinimumDistance

`public double getMinimumDistance()`
Returns the Minimum Distance parameter of this tool (Read only). This is an derived parameter.

Returns:
the Minimum Distance

### getAverageDistance

`public double getAverageDistance()`
Returns the Average Distance parameter of this tool (Read only). This is an derived parameter.

Returns:
the Average Distance

### getMaximumDistance

`public double getMaximumDistance()`
Returns the Maximum Distance parameter of this tool (Read only). This is an derived parameter.

Returns:
the Maximum Distance

### 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