ZScore Rendering (Spatial Statistics)

Summary

Applies a cold (blue) to hot (red) color rendering scheme for a field of z-scores.

Illustration

Z-score Rendering illustration

Usage

Syntax

ZRenderer_stats (Input_Feature_Class, Field_to_Render, Output_Layer_File)
ParameterExplanationData Type
Input_Feature_Class

The feature class containing a field with standardized z-scores.

Feature Layer
Field_to_Render

The name of the field containing the z-scores.

Field
Output_Layer_File

The new output layer file to store rendering information. You must include the .lyr extension as part of the file name.

Layer File

Code Sample

ZScore Rendering Example (Python Window)

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

import arcpy
arcpy.env.workspace = r"C:\data"
arcpy.ZRenderer_stats("hotspot_output.shp", "GiInvDst", "hotspot_output_rendered.lyr")
ZScore Rendering Example (stand-alone Python script)

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

# Perform Hot Spot Analysis for assault incidents
 
# Import system modules
import arcpy
 
# Local variables...
workspace = r"C:\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"
 
try:
    # Set the current workspace (to avoid having to specify the full path to the feature classes each time)
    arcpy.env.workspace = workspace
 
    # Convert assault incidents into weighted point data
    # Process: Collect Events...
    arcpy.CollectEvents_stats(input, collect_output)
 
    # Calculate Getis-Ord Gi* statistic
    # Process: Hot Spot Analysis (Getis-Ord Gi*)...
    arcpy.HotSpots_stats(collect_output, collect_count_field, hotspot_output, "INVERSE_DISTANCE", "EUCLIDEAN_DISTANCE", "NONE", "#", "#", "#")
 
    # Render hot spot analysis
    # Process: ZScore Rendering...
    arcpy.ZRenderer_stats(hotspot_output, z_score_field_name, hotspot_output_rendered)
 
except:
    # If an error occurred when running the tool, print out the error message.
    print arcpy.GetMessages(2)

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

3/7/2012