Mean Center (Spatial Statistics) - ArcMap - Documentation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

11/22/21, 8:21 AM Mean Center (Spatial Statistics)—ArcMap | Documentation

Mean Center
ArcMap 10.8
|
Other versions

10.8

10.7

10.6

 |  Help archive

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

Learn more about how Mean Center works

Illustration

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

This tool requires projected data to accurately measure distances.

The x and y values for the mean center point features are attributes in the Output Feature Class. The values are stored in the fields
XCOORD and YCOORD.

The Case Field is used to group features for separate mean center computations. When a Case Field is specified, the input features
are first grouped according to case field values, and then a mean center is calculated for each group. The case field can be of
integer, date, or string type. Records with NULL values for the Case Field will be excluded from analysis.

The Dimension Field is any numeric field in the input feature class. The Mean Center tool will compute the average for all values in
that field and include the result in the output feature class.

For line and polygon features, feature centroids are used in distance computations. For multipoints, polylines, or polygons with
multiple parts, the centroid is computed using the weighted mean center of all feature parts. The weighting for point features is 1,
for line features is length, and for polygon features is area.

Map layers can be used to define the Input Feature Class. When using a layer with a selection, only the selected features are
included in the analysis.

Caution:
When using shapefiles, keep in mind that they cannot store null values. Tools or other procedures that create shapefiles
from nonshapefile inputs may store or interpret null values as zero. In some cases, nulls are stored as very large negative
values in shapefiles. This can lead to unexpected results. See Geoprocessing considerations for shapefile output for more
information.

Syntax
https://desktop.arcgis.com/en/arcmap/latest/tools/spatial-statistics-toolbox/mean-center.htm#I_ESRI_TOOLILLUSTRATION_8599C0EA64E34965… 1/3
11/22/21, 8:21 AM Mean Center (Spatial Statistics)—ArcMap | Documentation
MeanCenter(Input_Feature_Class, Output_Feature_Class, {Weight_Field}, {Case_Field}, {Dimension_Field})

Parameter Explanation Data Type

Feature
Input_Feature_Class A feature class for which the mean center will be calculated.
Layer

A point feature class that will contain the features representing the mean centers of the input Feature
Output_Feature_Class
feature class. Class

Weight_Field
The numeric field used to create a weighted mean center. Field
(Optional)

Case_Field Field used to group features for separate mean center calculations. The case field can be of
Field
(Optional) integer, date, or string type.

Dimension_Field
A numeric field containing attribute values from which an average value will be calculated. Field
(Optional)

Code sample
MeanCenter Example (Python Window)

The following Python Window script demonstrates how to use the MeanCenter tool.

import arcpy

arcpy.env.workspace = r"C:\data"

arcpy.MeanCenter_stats("coffee_shops.shp", "coffee_MEANCENTER.shp", "NUM_EMP", "#", "#")

MeanCenter Example (Stand-alone Python script)

The following stand-alone Python script demonstrates how to use the MeanCenter 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

https://desktop.arcgis.com/en/arcmap/latest/tools/spatial-statistics-toolbox/mean-center.htm#I_ESRI_TOOLILLUSTRATION_8599C0EA64E34965… 2/3
11/22/21, 8:21 AM Mean Center (Spatial Statistics)—ArcMap | Documentation

Note:
Feature geometry is projected to the Output Coordinate System prior to analysis. All mathematical computations are
based on the Output Coordinate System spatial reference.

Geographic Transformations
Current Workspace
Scratch Workspace
Qualified Field Names
Output has M values
M Resolution
M Tolerance
Output has Z values
Default Output Z Value
Z Resolution
Z Tolerance
XY Resolution
XY Tolerance

Licensing information
Basic: Yes
Standard: Yes
Advanced: Yes

Related topics
An overview of the Measuring Geographic Distributions toolset
Using weights
Central Feature
Median Center
Directional Distribution (Standard Deviational Ellipse)
Standard Distance

https://desktop.arcgis.com/en/arcmap/latest/tools/spatial-statistics-toolbox/mean-center.htm#I_ESRI_TOOLILLUSTRATION_8599C0EA64E34965… 3/3

You might also like