Hot Spot Analysis (Getis-Ord Gi*) (Spatial Statistics)

Calculates the Getis-Ord Gi* statistic for hot spot analysis.

Learn more about how Hot Spot Analysis: Getis-Ord Gi* works


Hot Spot Analysis Illustration

Usage tips


HotSpots_stats (Input_Feature_Class, Input_Field, Output_Feature_Class, Conceptualization_of_Spatial_Relationships, Distance_Method, Standardization, Distance_Band_or_Threshold_Distance, Self_Potential_Field, Weights_Matrix_File)
Parameter Explanation Datatype
Input Feature Class (Required)

The feature class for which hot spot analysis will be performed.

Feature Layer
(Enter the dialog displayName for this parameter here.) (Required)

The numeric count field (number of victims, crimes, jobs, and so on) to be evaluated.

Output Feature Class (Required)

The output feature class to receive the Results field and Gi z score.

Feature Class
Conceptualization of Spatial Relationships (Required)

Specifies how spatial relationships between features are conceptualized.

  • Inverse Distance—The impact of one feature on another feature decreases with distance.
  • Inverse Distance Squared—Same as Inverse Distance, but the impact decreases more sharply over distance.
  • Fixed Distance Band—Everything within a specified critical distance is included in the analysis; everything outside the critical distance is excluded.
  • Zone of Indifference—A combination of Inverse Distance and Fixed Distance Band. Anything up to a critical distance has an impact on your analysis. Once that critical distance is exceeded, the level of impact quickly drops off.
  • Polygon Contiguity (First Order)—The neighbors of each feature are only those with which the feature shares a boundary. All other features have no influence on computations. Requires an ArcInfo license.
  • Get Spatial Weights From File—Spatial relationships are defined in a spatial weights file. The pathname to the spatial weights file is specified in the Weights Matrix File parameter.

Polygon contiguity is only available with an ArcInfo license.

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.

Standardization (Required)

The standardization of spatial weights provides more accurate results.

  • None—No standardization of spatial weights is applied. This is the default.
  • Row—Spatial weights are standardized by row. Each weight is divided by its row sum.

Distance Band or Threshold Distance (Required)

Specifies a cutoff distance for Inverse Distance and Fixed Distance options. Features outside the specified cutoff for a target feature are ignored in analyses for that feature. However, for Zone of Indifference, the influence of features outside the given distance is reduced with distance while those inside the distance threshold are equally considered. The value entered should match those of the Output Coordinate System.For the Inverse Distance conceptualizations of spatial relationships: A value of zero for this parameter indicates that no threshold distance is applied; when this parameter is left blank, a default threshold value will be computed and applied.This parameter has no effect when "Polygon Contiguity" or "Get Spatial Weights From File" spatial conceptualizations are selected.

Self Potential Field (Optional)

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

Weights Matrix File (Optional)

The pathname to a file containing spatial weights that define spatial relationships between features.

Data types for geoprocessing tool parameters

Script Example

# Analyze the spatial distribution of 911 calls in a metropolitan area
# using the Hot-Spot Analysis Tool (Local Gi*)
# Import system modules
import arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create(9.3)
gp.OverwriteOutput = 1
# Local variables...
workspace = "C:\Data\911Call"

# Set the current workspace (to avoid having to specify the full path to the feature classes each time)
    gp.workspace = workspace
    # Copy the input feature class and integrate the points to snap
    # together at 500 feet
    # Process: Copy Features and Integrate
    cf = gp.CopyFeatures("911Calls.shp", "911Copied.shp",
                         "#", 0, 0, 0)
    integrate = gp.Integrate("911Copied.shp #", "500 Feet")
    # Use Collect Events to count the number of calls at each location
    # Process: Collect Events
    ce = gp.CollectEvents("911Copied.shp", "911Count.shp", "Count", "#")
    # Add a unique ID field to the count feature class
    # Process: Add Field and Calculate Field
    af = gp.AddField("911Count.shp", "MyID", "LONG", "#", "#", "#", "#",
                     "NON_NULLABLE", "NON_REQUIRED", "#",

    cf = gp.CalculateField("911Count.shp", "MyID", "[FID]", "VB")
    # Create Spatial Weights Matrix for Calculations
    # Process: Generate Spatial Weights Matrix... 
    swm = gp.GenerateSpatialWeightsMatrix("911Count.shp", "MYID",
                        "#", "#", "#", 6,
    # Hot Spot Analysis of 911 Calls
    # Process: Hot Spot Analysis (Getis-Ord Gi*)
    hs = gp.HotSpots("911Count.shp", "ICOUNT", "911HotSpots.shp", 
                     "Get Spatial Weights From File",
                     "Euclidean Distance", "None",
                     "#", "#", "euclidean6Neighs.swm")
    # If an error occurred when running the tool, print out the error message.
    print gp.GetMessages()

See Also

  • Cluster and Outlier Analysis: Anselin Local Moran's I (Spatial Statistics)
  • Modeling spatial relationships
  • What is a Z score? What is a p-value?
  • Spatial Autocorrelation (Morans I) (Spatial Statistics)