You are here:
Geoprocessing tool reference > Spatial Statistics toolbox > Measuring Geographic Distributions toolset > Tools

# Mean Center (Spatial Statistics)

Release 9.2

Print all topics in : "Tools"

Identifies the geographic center (or the center of concentration) for a set of features.

Illustration

Usage tips

• The mean center is a point constructed from the average x and y values for the input feature centroids.

• If a case field is specified, the input features are grouped according to case field values, and a mean center is calculated from the average x and y values for the centroids in each group.

• The x and y values for the center features are feature attributes of the output feature class. The values are stored in the fields XCOORD and YCOORD.

• For line and polygon features, geometric centroids are calculated before the central feature is identified. The geometric centroid of a feature may be located outside a feature's boundary. If centroids must be within feature boundaries, use the Features to Points (Inside option) to create centroids before performing the Mean Center operation.

• Current map layers may be used to define the input feature class. When using layers, only the currently selected features are used in the Mean Center 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
MeanCenter_stats <Input_Feature_Class> <Output_Feature_Class> {Weight_Field} {Case_Field} {Dimension_Field}

 Parameter Explanation Data Type A feature class for which the mean center will be calculated. Feature Layer A point feature class that will contain the features representing the mean centers of the input feature class. Feature Class {Weight_Field} The numeric field used to create a weighted mean center. Field {Case_Field} Field used to group features for separate mean center calculations. The case field can be of numeric, date, or string type. Field {Dimension_Field} A numeric field containing attribute values from which an average value will be calculated. Field
Data types for geoprocessing tool parameters

### Command line example

```workspace e:\project93\data
MeanCenter schools.shp schoolcen.shp Teachers Group```

Scripting syntax
About getting started with writing geoprocessing scripts
MeanCenter_stats (Input_Feature_Class, Output_Feature_Class, Weight_Field, Case_Field, Dimension_Field)

 Parameter Explanation Data Type Input_Feature_Class (Required) A feature class for which the mean center will be calculated. Feature Layer Output_Feature_Class (Required) A point feature class that will contain the features representing the mean centers of the input feature class. Feature Class Weight_Field (Optional) The numeric field used to create a weighted mean center. Field Case_Field (Optional) Field used to group features for separate mean center calculations. The case field can be of numeric, date, or string type. Field Dimension_Field (Optional) A numeric field containing attribute values from which an average value will be calculated. 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 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()```

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.