com.esri.arcgis.geoprocessing.tools.spatialstatisticstools
Class ClustersOutliers
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.spatialstatisticstools.ClustersOutliers
- All Implemented Interfaces:
- GPTool
public class ClustersOutliers
- extends AbstractGPTool
Given a set of weighted features, identifies statistically significant hot spots, cold spots, and spatial outliers using the Anselin Local Moran's I statistic.
The Cluster and Outlier Analysis (Anselin Local Morans I) tool is contained in the Spatial Statistics Tools tool box.
Usage tips:
- This tool creates a new Output Feature Class with the following attributes for each feature in the Input Feature Class: Local Moran's I index, z-score, p-value, and cluster/outlier type (COType). The field names of these attributes are also derived tool output values for potential use in custom models and scripts.
- The z-scores and p-values are measures of statistical significance which tell you whether or not to reject the null hypothesis, feature by feature. In effect, they indicate whether the apparent similarity (a spatial clustering of either high or low values) or dissimilarity (a spatial outlier) is more pronounced than one would expect in a random distribution.
- A high positive z-score for a feature indicates that the surrounding features have similar values (either high values or low values). The COType field in the Output Feature Class will be HH for a statistically significant (0.05 level) cluster of high values and LL for a statistically significant (0.05 level) cluster of low values.
- A low negative z-score (e.g., < -1.96) for a feature indicates a statistically significant (0.05 level) spatial outlier. The COType field in the Output Feature Class will indicate if the feature has a high value and is surrounded by features with low values (HL) or if the feature has a low value and is surrounded by features with high values (LH).
- The z-score is based on the randomization null hypothesis computation. For more information on z-scores, see
- Calculations based on either Euclidean or Manhattan distance require to accurately measure distances.
- 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.
- The Input Field should contain a variety of values. The math for this statistic requires some variation in the variable being analyzed; it cannot solve if all input values are 1, for example. If you want to use this tool to analyze the spatial pattern of incident data, consider .
- Your choice for the Conceptualization of Spatial Relationships parameter should reflect inherent relationships among the features you are analyzing. The more realistically you can model how features interact with each other in space, the more accurate your results are. . Here are some additional tips:
- FIXED_DISTANCE_BAND
- INVERSE_DISTANCE or INVERSE_DISTANCE_SQUARED
- Additional options for the Conceptualization of Spatial Relationships parameter are available using the or tools. To take advantage of these additional options, use one of these tools to construct the prior to analysis; select GET_SPATIAL_WEIGHTS_FROM_FILE for the Conceptualization of Spatial Relationships parameter; and, for the Weights Matrix File parameter, specify the path to the spatial weights file you created.
- 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.
- If you provide a Weights Matrix File with a .SWM or .swm extension, this tool is expecting a spatial weights matrix file created using either the or tools. Otherwise this tool is expecting an . In some cases, behavior is different depending on which type of spatial weights matrix file you use:
- ASCII formatted spatial weights matrix files:Weights are used "as is". Missing feature-to-feature relationships are treated as zeros.If the weights are row standardized, results will likely be incorrect for analyses on selection sets. If you need to run your analysis on a selection set, convert the ASCII spatial weights file to a .swm file by reading the ASCII data into a table, then using the CONVERT_TABLE option with the tool.
- .SWM formatted spatial weights matrix fileIf the weights are row standardized, they will be restandardized for selection sets. Otherwise weights are used "as is".
- Running your analysis with an is memory intensive. For analyses on more than about 5000 features, consider converting your ASCII formatted spatial weights matrix file into a . First put your ASCII weights into a table (using Excel, for example). Next run the tool using CONVERT_TABLE for the Conceptualization of Spatial Relationships parameter. The output will be a .swm formatted spatial weights matrix file.
- When this tool runs in ArcMap, the Output Feature Class is automatically added to the Table of Contents (TOC) with default rendering applied to the COType field. The rendering applied is defined by a layer file in /ArcToolbox/Templates/Layers. You can reapply the default rendering, if needed, by the template layer symbology.
- The help topic provides additional information about this tool's parameters.
- When using shapefiles, keep in mind that they cannot store null values. Tools or other procedures that create shapefiles from non-shapefile inputs may store or interpret null values as zero. This can lead to unexpected results. See also .
Constructor Summary |
ClustersOutliers()
Creates the Cluster and Outlier Analysis (Anselin Local Morans I) tool with defaults. |
ClustersOutliers(Object inputFeatureClass,
Object inputField,
Object outputFeatureClass,
String conceptualizationOfSpatialRelationships,
String distanceMethod,
String standardization)
Creates the Cluster and Outlier Analysis (Anselin Local Morans I) tool with the required parameters. |
ClustersOutliers
public ClustersOutliers()
- Creates the Cluster and Outlier Analysis (Anselin Local Morans I) tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
ClustersOutliers
public ClustersOutliers(Object inputFeatureClass,
Object inputField,
Object outputFeatureClass,
String conceptualizationOfSpatialRelationships,
String distanceMethod,
String standardization)
- Creates the Cluster and Outlier Analysis (Anselin Local Morans I) tool with the required parameters.
Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.
- Parameters:
inputFeatureClass
- the feature class for which cluster/outlier analysis will be performed.inputField
- the numeric field to be evaluated.outputFeatureClass
- the output feature class to receive the results fields.conceptualizationOfSpatialRelationships
- specifies how spatial relationships among features are conceptualized.distanceMethod
- specifies how distances are calculated from each feature to neighboring features.standardization
- row standardization is recommended whenever the distribution of your features is potentially biased due to sampling design or an imposed aggregation scheme.
getInputFeatureClass
public Object getInputFeatureClass()
- Returns the Input Feature Class parameter of this tool .
This parameter is the feature class for which cluster/outlier analysis will be performed.
This is a required parameter.
- Returns:
- the Input Feature Class
setInputFeatureClass
public void setInputFeatureClass(Object inputFeatureClass)
- Sets the Input Feature Class parameter of this tool .
This parameter is the feature class for which cluster/outlier analysis will be performed.
This is a required parameter.
- Parameters:
inputFeatureClass
- the feature class for which cluster/outlier analysis will be performed.
getInputField
public Object getInputField()
- Returns the Input Field parameter of this tool .
This parameter is the numeric field to be evaluated.
This is a required parameter.
- Returns:
- the Input Field
setInputField
public void setInputField(Object inputField)
- Sets the Input Field parameter of this tool .
This parameter is the numeric field to be evaluated.
This is a required parameter.
- Parameters:
inputField
- the numeric field to be evaluated.
getOutputFeatureClass
public Object getOutputFeatureClass()
- Returns the Output Feature Class parameter of this tool .
This parameter is the output feature class to receive the results fields.
This is a required parameter.
- Returns:
- the Output Feature Class
setOutputFeatureClass
public void setOutputFeatureClass(Object outputFeatureClass)
- Sets the Output Feature Class parameter of this tool .
This parameter is the output feature class to receive the results fields.
This is a required parameter.
- Parameters:
outputFeatureClass
- the output feature class to receive the results fields.
getConceptualizationOfSpatialRelationships
public String getConceptualizationOfSpatialRelationships()
- Returns the Conceptualization of Spatial Relationships parameter of this tool .
This parameter is specifies how spatial relationships among features are conceptualized.
This is a required parameter.
- Returns:
- the Conceptualization of Spatial Relationships
setConceptualizationOfSpatialRelationships
public void setConceptualizationOfSpatialRelationships(String conceptualizationOfSpatialRelationships)
- Sets the Conceptualization of Spatial Relationships parameter of this tool .
This parameter is specifies how spatial relationships among features are conceptualized.
This is a required parameter.
- Parameters:
conceptualizationOfSpatialRelationships
- specifies how spatial relationships among features are conceptualized.
getDistanceMethod
public String getDistanceMethod()
- Returns the Distance Method parameter of this tool .
This parameter is specifies how distances are calculated from each feature to neighboring features.
This is a required parameter.
- Returns:
- the Distance Method
setDistanceMethod
public void setDistanceMethod(String distanceMethod)
- Sets the Distance Method parameter of this tool .
This parameter is specifies how distances are calculated from each feature to neighboring features.
This is a required parameter.
- Parameters:
distanceMethod
- specifies how distances are calculated from each feature to neighboring features.
getStandardization
public String getStandardization()
- Returns the Standardization parameter of this tool .
This parameter is row standardization is recommended whenever the distribution of your features is potentially biased due to sampling design or an imposed aggregation scheme.
This is a required parameter.
- Returns:
- the Standardization
setStandardization
public void setStandardization(String standardization)
- Sets the Standardization parameter of this tool .
This parameter is row standardization is recommended whenever the distribution of your features is potentially biased due to sampling design or an imposed aggregation scheme.
This is a required parameter.
- Parameters:
standardization
- row standardization is recommended whenever the distribution of your features is potentially biased due to sampling design or an imposed aggregation scheme.
getDistanceBandOrThresholdDistance
public double getDistanceBandOrThresholdDistance()
- Returns the Distance Band or Threshold Distance parameter of this tool .
This parameter is 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 that of the output coordinate system. for the Inverse Distance conceptualizations of spatial relationships, a value of 0 indicates that no threshold distance is applied; when this parameter is left blank, a default threshold value is computed and applied. This default value is the Euclidean distance that ensures every feature has at least one neighbor. this parameter has no effect when Polygon Contiguity or Get Spatial Weights From File spatial conceptualizations are selected.
This is an optional parameter.
- Returns:
- the Distance Band or Threshold Distance
setDistanceBandOrThresholdDistance
public void setDistanceBandOrThresholdDistance(double distanceBandOrThresholdDistance)
- Sets the Distance Band or Threshold Distance parameter of this tool .
This parameter is 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 that of the output coordinate system. for the Inverse Distance conceptualizations of spatial relationships, a value of 0 indicates that no threshold distance is applied; when this parameter is left blank, a default threshold value is computed and applied. This default value is the Euclidean distance that ensures every feature has at least one neighbor. this parameter has no effect when Polygon Contiguity or Get Spatial Weights From File spatial conceptualizations are selected.
This is an optional parameter.
- Parameters:
distanceBandOrThresholdDistance
- 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 that of the output coordinate system. for the Inverse Distance conceptualizations of spatial relationships, a value of 0 indicates that no threshold distance is applied; when this parameter is left blank, a default threshold value is computed and applied. This default value is the Euclidean distance that ensures every feature has at least one neighbor. this parameter has no effect when Polygon Contiguity or Get Spatial Weights From File spatial conceptualizations are selected.
getWeightsMatrixFile
public Object getWeightsMatrixFile()
- Returns the Weights Matrix File parameter of this tool .
This parameter is the path to a file containing spatial weights that define spatial relationships among features.
This is an optional parameter.
- Returns:
- the Weights Matrix File
setWeightsMatrixFile
public void setWeightsMatrixFile(Object weightsMatrixFile)
- Sets the Weights Matrix File parameter of this tool .
This parameter is the path to a file containing spatial weights that define spatial relationships among features.
This is an optional parameter.
- Parameters:
weightsMatrixFile
- the path to a file containing spatial weights that define spatial relationships among features.
getIndexFieldName
public Object getIndexFieldName()
- Returns the Index Field Name parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the Index Field Name
getZScoreFieldName
public Object getZScoreFieldName()
- Returns the ZScore Field Name parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the ZScore Field Name
getProbabilityField
public Object getProbabilityField()
- Returns the Probability Field parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the Probability Field
getClusterOutlierType
public Object getClusterOutlierType()
- Returns the Cluster-Outlier Type parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the Cluster-Outlier Type
getToolName
public String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias