Collect Events (Spatial Statistics)

Converts event data, such as crimes or disease incidents, to weighted point data


Collect Events illustration

Usage tips


CollectEvents_stats (Input_Incident_Features, Output_Weighted_Point_Feature_Class)
Parameter Explanation Datatype
Input Incident Features (Required)

The features representing event or incident data.

Feature Class
Output Weighted Point Feature Class (Required)

The output feature class to contain the weighted point data.

Feature Class
Data types for geoprocessing tool parameters

Script Example

# Perform Hot Spot Analysis for assault incidents

# Import system modules
import arcgisscripting

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

# Local variables...
workspace = "C:/project93/data"
input = "assaults.shp"
collect_output = "collect_output.shp"
collect_count_field = "Count"
hotspot_output = "hotspot_output.shp"
hotspot_output_rendered = "hotspot_output_rendered.lyr"
z_score_field_name = "GiInvDst"

    # Set the current workspace (to avoid having to specify the full path to the feature classes each time)
    gp.workspace = workspace

    # Convert assault incidents into weighted point data
    # Process: Collect Events...
    gp.CollectEvents_stats(input, collect_output)

    # Calculate Getis-Ord Gi* statistic
    # Process: Hot Spot Analysis (Getis-Ord Gi*)...
    gp.HotSpots_stats(collect_output, collect_count_field, hotspot_output, "Inverse Distance", "Euclidean Distance", "None", "#", "#", "#")

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

See Also

  • Hot Spot Analysis (Getis-Ord Gi*) (Spatial Statistics)
  • Cluster and Outlier Analysis: Anselin Local Moran's I (Spatial Statistics)
  • Spatial Autocorrelation (Morans I) (Spatial Statistics)
  • High/Low Clustering (Getis-Ord General G) (Spatial Statistics)