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

This tool calculates the distance for all features in the input feature class to their nth neighbor (specified in the Neighbors parameter). Then it examines the distances and returns three values: the maximum distance, the minimum distance and the average distance. The Calculate Distance Band from Neighbor Count tool is contained in the Spatial Statistics Tools tool box.

Software restrictions: none

#### Illustration: #### Usage tips:

• This tool honors the environment output coordinate system; . Feature geometry; is projected to the output coordinate system prior to analysis.
• This tool calculates the distance for all features in the input feature class to their nth neighbor. Then it examines the distances and returns three values: the maximum distance, the minimum distance and the average distance.The maximum distance will be the distance between a feature and its nth neighbor for that feature which is furthest from its nth neighbor.The minimum distance will be the distance between a feature and its nth neighbor for that feature which is closest to its nth neighbor.The average distance is the average of the distances between all the features and their nth neighbor
• If 15 is specified in the neighbors parameter, the distances reported will be based on the distance from each feature to its 15th closest neighbor. The maximum distance will be the distance between a feature and its 15th neighbor for that feature which is furthest from its 15th neighbor. The minimum distance will be the distance between a feature and its 15th neighbor for that feature which is closest to its 15th neighbor. The average distance is the average of the distance between all the features and their 15th neighbor.
• The neighborhood of all features is ensured of at least n neighbors if the neighborhood size is greater than the maximum distance reported by the tool.
• The neighborhood of all features is ensured to have fewer than n neighbors if the neighborhood size is less than the minimum distance reported by the tool.
• The distances returned by the tool are in the units of the output coordinate system.
• This tool can be used to find distances for use with tools in the Spatial Statistics Toolbox such as Hot Spot Analysis (Getis-Ord Gi*); and Cluster and Outlier Analysis (Local Moran's I); tools. If the maximum distance reported by this tool is used, it ensures that every feature in the feature class will have the number of neighbors specified as input to the tool. This tool is only one way to find a distance for use with these tools. There are a number of other strategies for determining a good distance. One strategy is to use the distance at which spatial autocorrelation is highest. Both the Multi-Distance Spatial Clustering (Ripley's k-function); and Spatial Autocorrelation (Moran's I); tools are useful in finding distances at which spatial autocorrelation peaks.

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` - Feature Layer, the feature class or layer from which to calculate distance statistics.
`neighbors` - Long, 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 returned.
`distanceMethod` - String, specifies how distances are calculated when calculating neighbor distance.
Method Detail

### getInputFeatures

`public Object getInputFeatures()`
Returns the Input Features parameter of this tool . This parameter is Feature Layer, the feature class or layer from which 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 Feature Layer, the feature class or layer from which to calculate distance statistics. This is a required parameter.

Parameters:
`inputFeatures` - Feature Layer, the feature class or layer from which to calculate distance statistics.

### getNeighbors

`public int getNeighbors()`
Returns the Neighbors parameter of this tool . This parameter is Long, 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 returned. This is a required parameter.

Returns:
the Neighbors

### setNeighbors

`public void setNeighbors(int neighbors)`
Sets the Neighbors parameter of this tool . This parameter is Long, 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 returned. This is a required parameter.

Parameters:
`neighbors` - Long, 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 returned.

### getDistanceMethod

`public String getDistanceMethod()`
Returns the Distance Method parameter of this tool . This parameter is String, specifies how distances are calculated when calculating neighbor distance. 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 String, specifies how distances are calculated when calculating neighbor distance. This is a required parameter.

Parameters:
`distanceMethod` - String, specifies how distances are calculated when calculating neighbor distance.

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