# Linear Directional Mean (Spatial Statistics)

Release 9.2

Identifies the general (mean) direction for a set of lines.

Illustration

Usage tips

• 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 new line features include Compass Angle (clockwise from due North), Directional Mean (counterclockwise from due East), Circular Variance (an indication of how much directions or orientations deviate from directional mean), Mean Center X and Y Coordinates, and Mean Length.

• 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).

• Calculations are based on either Euclidean or Manhattan distance and require projected data to accurately measure distances.

• 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.

• Current map layers may be used to define the input feature class. When using layers, only the currently selected features are used in the Linear Directional Mean operation.

• The following environment settings affect this tool: Cluster Tolerance, Extent, M Domain, Configuration Keyword, Coordinate System, Output has M Values, Output Spatial Grid, Output has Z Values, Default Z Value, Output XY Domain, and Output Z Domain.

Command line syntax
An overview of the Command Line window
DirectionalMean_stats <Input_Feature_Class> <Output_Feature_Class> <Orientation_Only> {Case_Field}

 Parameter Explanation Data Type The feature class containing vectors for which the mean direction will be calculated. Feature Layer A line feature class that will contain the features representing the mean directions of the input feature class. Feature Class Specifies whether to include direction (From and To nodes) information in the analysis. True — The From and To node information is ignored. False — The From and To nodes are utilized in calculating the mean. Boolean {Case_Field} Field used to group features for separate directional mean calculations. The case field can be of numeric, date, or string type. Field
Data types for geoprocessing tool parameters

### Command line example

workspace c:\data\yosemite.mdbDirectionalMean water\streams c:\temp\streams_dm.shp false NAME

Scripting syntax
About getting started with writing geoprocessing scripts
DirectionalMean_stats (Input_Feature_Class, Output_Feature_Class, Orientation_Only, Case_Field)

 Parameter Explanation Data Type Input_Feature_Class (Required) The feature class containing vectors for which the mean direction will be calculated. Feature Layer Output_Feature_Class (Required) A line feature class that will contain the features representing the mean directions of the input feature class. Feature Class Orientation_Only (Required) Specifies whether to include direction (From and To nodes) information in the analysis. True — The From and To node information is ignored. False — The From and To nodes are utilized in calculating the mean. Boolean Case_Field (Optional) Field used to group features for separate directional mean calculations. The case field can be of numeric, date, or string type. Field

Data types for geoprocessing tool parameters

### Script example

```# Measure the geographic distribution of auto thefts
# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

# Local variables...
workspace = "c:/data"
auto_theft_locations = "AutoTheft.shp"
auto_theft_sd = "auto_theft_SD.shp"
auto_theft_se = "auto_theft_SE.shp"
auto_theft_ldm = "auto_theft_LDM.shp"

try:
# Set the workspace (to avoid having to type in the full path to the data every time)
gp.Workspace = workspace

# Process: Standard Distance of auto theft locations...
gp.StandardDistance_stats(auto_theft_locations, auto_theft_sd, "1 Standard Deviation", "#", "#")

# Process: Directional Distribution (Standard Deviational Ellipse) of auto theft locations...
gp.DirectionalDistribution_stats(auto_theft_locations, auto_theft_se, "1 Standard Deviation", "#", "#")

# Process: Linear Directional Mean of auto thefts...