# Central Feature (Spatial Statistics)

Identifies the most centrally located feature in a point, line, or polygon feature class.

## Usage tips

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

• The feature associated with the smallest accumulated distance to all other features is the most centrally located feature; this feature is selected and copied to the newly created output feature class.

• For line and polygon features, feature true geometric centroids are used in the computations.

• The case field is used to group features for separate central feature computations. The case field can be of numeric, date, or string type.

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

• Self-potential is the distance or weight between a feature and itself. Often this weight is zero, but in some cases you may want to specify another fixed value or a different value for every feature (perhaps based on polygon size, for example).

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

## Syntax

CentralFeature_stats (Input_Feature_Class, Output_Feature_Class, Distance_Method, Weight_Field, Self_Potential_Weight_Field, Case_Field)
Parameter Explanation Datatype
Input Feature Class (Required)

The feature class containing a distribution of features from which to identify the most centrally located feature.

Feature Layer
Output Feature Class (Required)

The feature class that will contain the most centrally located feature in the input feature class.

Feature Class
Distance Method (Required)

Specifies how distances are calculated when measuring concentrations.

• Euclidean (as the crow flies)—The straight-line distance between two points.
• Manhattan (city block)—The distance between two points measured along axes at right angles. Calculated by summing the (absolute) differences between point coordinates.

String
Weight Field (Optional)

The numeric field used to weight distances in the origin-destination distance matrix.

Field
Self Potential Weight Field (Optional)

The field representing self-potential—The distance or weight between a feature and itself.

Field
Case Field (Optional)

Field used to group features for separate central feature computations. The case field can be of numeric, date, or string type.

Field
Data types for geoprocessing tool parameters

Script Example

```# Measure geographic distribution characteristics of coffee house locations weighted by the number of employees

# Import system modules
import arcgisscripting

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

# Local variables...
workspace = "C:/data"
input_FC = "coffee_shops.shp"
CF_output = "coffee_CF.shp"
MC_output = "coffee_MC.shp"
weight_field = "NUM_EMP"

try:
# Set the workspace to avoid having to type out full path names
gp.workspace = workspace

# Process: Central Feature...
gp.CentralFeature_stats(input_FC, CF_output, "Euclidean Distance", weight_field, "#", "#")

# Process: Mean Center...
gp.MeanCenter_stats(input_FC, MC_output, weight_field, "#", "#")

except:
# If an error occurred when running the tool, print out the error message.
print gp.GetMessages()

```