com.esri.arcgis.geoprocessing.tools.spatialstatisticstools
Class SpatialAutocorrelation
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.spatialstatisticstools.SpatialAutocorrelation
- All Implemented Interfaces:
- GPTool
public class SpatialAutocorrelation
- extends AbstractGPTool
Measures spatial autocorrelation based on feature locations and attribute values using the Global Moran's I statistic. Results are accessible from the Results window.
The Spatial Autocorrelation (Morans I) tool is contained in the Spatial Statistics Tools tool box.
Usage tips:
- The Spatial Autocorrelation tool returns five values: the Moran's I Index, Expected Index, Variance, z-score, and p-value. These values are accessible from the and are also passed as derived output values for potential use in models or scripts. Optionally, this tool will create an HTML file with a graphical summary of results. Double-clicking on the HTML file in the Results window will open the HTML file in the default Internet browser. Right-clicking on the in the Results window and selectingwill display the results in a. If you execute this tool in the , output values will also be displayed in the.
- Given a set of features and an associated attribute, the Spatial Autocorrelation tool evaluates whether the pattern expressed is clustered, dispersed, or random. When the z-score or p-value indicates statistical significance, a positive Moran's I index value indicates tendency toward clustering while a negative Moran's I index value indicates tendency toward dispersion.
- The Global Moran's I tool calculates a z-score and p-value to indicate whether or not you can reject the null hypothesis. In this case, the null hypothesis states that feature values are randomly distributed across the study area.
- The z-score is based on the randomization null hypothesis computation. For more information on z-scores, see
- 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 .
- Calculations based on either Euclidean or Manhattan distance require to accurately measure distances.
- In ArcGIS 10, optional graphical output is no longer displayed automatically. Instead, an HTML file summarizing results is created. To view results, double-click on the HTML file in the . Custom scripts or model tools created prior to ArcGIS 10 that use this tool may need to be rebuilt. To rebuild these custom tools, open them, remove theparameter, then re-save.
- 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.
- 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.
- For polygon features, you will almostwant to choosefor the Standardization parameter. mitigates bias when the number of neighbors each feature has is a function of the aggregation scheme or sampling process, rather than reflecting the actual spatial distribution of the variable you are analyzing.
- 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 .
SpatialAutocorrelation
public SpatialAutocorrelation()
- Creates the Spatial Autocorrelation (Morans I) tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
SpatialAutocorrelation
public SpatialAutocorrelation(Object inputFeatureClass,
Object inputField,
String conceptualizationOfSpatialRelationships,
String distanceMethod,
String standardization)
- Creates the Spatial Autocorrelation (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 spatial autocorrelation will be calculated.inputField
- the numeric field used in assessing spatial autocorrelation.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 spatial autocorrelation will be calculated.
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 spatial autocorrelation will be calculated.
This is a required parameter.
- Parameters:
inputFeatureClass
- the feature class for which spatial autocorrelation will be calculated.
getInputField
public Object getInputField()
- Returns the Input Field parameter of this tool .
This parameter is the numeric field used in assessing spatial autocorrelation.
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 used in assessing spatial autocorrelation.
This is a required parameter.
- Parameters:
inputField
- the numeric field used in assessing spatial autocorrelation.
getGenerateReport
public String getGenerateReport()
- Returns the Generate Report parameter of this tool .
This is an optional parameter.
- Returns:
- the Generate Report
setGenerateReport
public void setGenerateReport(String generateReport)
- Sets the Generate Report parameter of this tool .
This is an optional parameter.
- Parameters:
generateReport
- null
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.
getIndex
public double getIndex()
- Returns the Index parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the Index
getZScore
public double getZScore()
- Returns the ZScore parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the ZScore
getPValue
public double getPValue()
- Returns the PValue parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the PValue
getHTMLReportFile
public Object getHTMLReportFile()
- Returns the HTML Report File parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the HTML Report File
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