Central Feature (Spatial Statistics)

License Level:BasicStandardAdvanced

Summary

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

Learn more about how Central Feature works

Illustration

Central Feature tool illustration

Usage

Syntax

CentralFeature_stats (Input_Feature_Class, Output_Feature_Class, Distance_Method, {Weight_Field}, {Self_Potential_Weight_Field}, {Case_Field})
ParameterExplanationData Type
Input_Feature_Class

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

Feature Layer
Output_Feature_Class

The feature class that will contain the most centrally located feature in the Input Feature Class.

Feature Class
Distance_Method

Specifies how distances are calculated from each feature to neighboring features.

  • EUCLIDEAN_DISTANCEThe straight-line distance between two points (as the crow flies)
  • MANHATTAN_DISTANCEThe distance between two points measured along axes at right angles (city block); calculated by summing the (absolute) difference between the x- and y-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 integer, date, or string type.

Field

Code Sample

CentralFeature example 1 (Python window)

The following Python window script demonstrates how to use the CentralFeature tool.

import arcpy
arcpy.env.workspace = r"C:\data"
arcpy.CentralFeature_stats("coffee_shops.shp", "coffee_CENTRALFEATURE.shp", "EUCLIDEAN_DISTANCE", "NUM_EMP", "#", "#")
CentralFeature example 2 (stand-alone Python script)

The following stand-alone Python script demonstrates how to use the CentralFeature tool.

# Measure geographic distribution characteristics of coffee house locations weighted by the number of employees
 
# Import system modules
import arcpy
 
# Local variables...
workspace = "C:/data"
input_FC = "coffee_shops.shp"
CF_output = "coffee_CENTRALFEATURE.shp"
MEAN_output = "coffee_MEANCENTER.shp"
MED_output = "coffee_MEDIANCENTER.shp"
weight_field = "NUM_EMP"
 
try:
    # Set the workspace to avoid having to type out full path names
    arcpy.env.workspace = workspace
 
    # Process: Central Feature...
    arcpy.CentralFeature_stats(input_FC, CF_output, "EUCLIDEAN_DISTANCE", weight_field, "#", "#")
 
    # Process: Mean Center...
    arcpy.MeanCenter_stats(input_FC, MEAN_output, weight_field, "#", "#")

    # Process: Median Center...
    arcpy.MedianCenter_stats(input_FC, MED_output, weight_field, "#", "#")
 
except:
    # If an error occurred when running the tool, print out the error message.
    print arcpy.GetMessages()

Environments

Output Coordinate System

Feature geometry is projected to the Output Coordinate System prior to analysis.

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
8/26/2014