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

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

`public class DirectionalMeanextends AbstractGPTool`

Identifies the general (mean) direction for a set of lines. The Linear Directional Mean tool is contained in the Spatial Statistics Tools tool box.
Learn about how Linear Directional Mean works

Software restrictions: none

#### Usage tips:

• This tool honors the environment output coordinate system; . Feature geometry; is projected to the output coordinate system prior to analysis. All mathematical computations are based on the output coordinate system spatial reference;
• The input feature class must be a line or polyline feature class.
• If a case field is specified, the input features are grouped according to case field values, and a directional mean is calculated for each group.
• Attribute values for the output line feature(s) include "CompassA" for Compass Angle (clockwise from due North), "DirMean" for Directional Mean (counterclockwise from due East), "CirVar" for Circular Variance (an indication of how much line directions or orientations deviate from the directional mean), "AveX" and "AveY" for Mean Center X and Y Coordinates, and "AveLen" for Mean Length. When a case field is specified, a field with the case field name is also added to the output feature class.
• Analogous to a standard deviation measure, the circular variance tells how well the directional mean vector represents the set of input vectors. Circular variance ranges from 0 to 1. If all the input vectors have the exact same (or very similar) directions, the circular variance is small (near 0). When input vector directions span the entire compass, the circular variance is large (near 1).
• When measuring direction, the tool only considers the first and last points in a line. The tool does not consider all of the verticies along a line.
• Whenever using shapefiles keep in mind that they cannot store null values. Tools or other procedures that create shapefiles from non-shapefile inputs may store or interpret null values as zero. This can lead to unexpected results.
• Current map layers may be used to define the input feature class. When using layers, only the currently selected features are included in the analysis.
• When this tool runs in ArcMap, the output feature class is automatically added to the Table of Contents (TOC) with default rendering defined by a layer file in /ArcToolbox/Templates/Layers. You can reapply the default rendering, if needed, by importing; the template layer symbology.

Field Summary

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

Constructor Summary
`DirectionalMean()`
Creates the Linear Directional Mean tool with defaults.
```DirectionalMean(Object inputFeatureClass, Object outputFeatureClass, String orientationOnly)```
Creates the Linear Directional Mean tool with the required parameters.

Method Summary
` Object` `getCaseField()`
Returns the Case Field parameter of this tool .
` Object` `getInputFeatureClass()`
Returns the Input Feature Class parameter of this tool .
` String` `getOrientationOnly()`
Returns the Orientation Only parameter of this tool .
` Object` `getOutputFeatureClass()`
Returns the Output Feature Class 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` `setCaseField(Object caseField)`
Sets the Case Field parameter of this tool .
` void` `setInputFeatureClass(Object inputFeatureClass)`
Sets the Input Feature Class parameter of this tool .
` void` `setOrientationOnly(String orientationOnly)`
Sets the Orientation Only parameter of this tool .
` void` `setOutputFeatureClass(Object outputFeatureClass)`
Sets the Output Feature Class 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

### DirectionalMean

`public DirectionalMean()`
Creates the Linear Directional Mean tool with defaults.

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

### DirectionalMean

```public DirectionalMean(Object inputFeatureClass,
Object outputFeatureClass,
String orientationOnly)```
Creates the Linear Directional Mean 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:
`inputFeatureClass` - Feature Layer, the feature class containing vectors for which the mean direction will be calculated.
`outputFeatureClass` - Feature Class, a line feature class that will contain the features representing the mean directions of the input feature class.
`orientationOnly` - String, specifies whether to include direction (From and To nodes) information in the analysis.
Method Detail

### getInputFeatureClass

`public Object getInputFeatureClass()`
Returns the Input Feature Class parameter of this tool . This parameter is Feature Layer, the feature class containing vectors for which the mean direction will be calculated. This is a required parameter.

Returns:
the Input Feature Class

### setInputFeatureClass

`public void setInputFeatureClass(Object inputFeatureClass)`
Sets the Input Feature Class parameter of this tool . This parameter is Feature Layer, the feature class containing vectors for which the mean direction will be calculated. This is a required parameter.

Parameters:
`inputFeatureClass` - Feature Layer, the feature class containing vectors for which the mean direction will be calculated.

### getOutputFeatureClass

`public Object getOutputFeatureClass()`
Returns the Output Feature Class parameter of this tool . This parameter is Feature Class, a line feature class that will contain the features representing the mean directions of the input feature class. This is a required parameter.

Returns:
the Output Feature Class

### setOutputFeatureClass

`public void setOutputFeatureClass(Object outputFeatureClass)`
Sets the Output Feature Class parameter of this tool . This parameter is Feature Class, a line feature class that will contain the features representing the mean directions of the input feature class. This is a required parameter.

Parameters:
`outputFeatureClass` - Feature Class, a line feature class that will contain the features representing the mean directions of the input feature class.

### getOrientationOnly

`public String getOrientationOnly()`
Returns the Orientation Only parameter of this tool . This parameter is String, specifies whether to include direction (From and To nodes) information in the analysis. This is a required parameter.

Returns:
the Orientation Only

### setOrientationOnly

`public void setOrientationOnly(String orientationOnly)`
Sets the Orientation Only parameter of this tool . This parameter is String, specifies whether to include direction (From and To nodes) information in the analysis. This is a required parameter.

Parameters:
`orientationOnly` - String, specifies whether to include direction (From and To nodes) information in the analysis.

### getCaseField

`public Object getCaseField()`
Returns the Case Field parameter of this tool . This parameter is Field, field used to group features for separate directional mean calculations. The case field can be of numeric, date, or string type. This is an optional parameter.

Returns:
the Case Field

### setCaseField

`public void setCaseField(Object caseField)`
Sets the Case Field parameter of this tool . This parameter is Field, field used to group features for separate directional mean calculations. The case field can be of numeric, date, or string type. This is an optional parameter.

Parameters:
`caseField` - Field, field used to group features for separate directional mean calculations. The case field can be of numeric, date, or string type.

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