com.esri.arcgis.geoprocessing.tools.spatialstatisticstools
Class GenerateSpatialWeightsMatrix
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.spatialstatisticstools.GenerateSpatialWeightsMatrix
- All Implemented Interfaces:
- GPTool
public class GenerateSpatialWeightsMatrix
- extends AbstractGPTool
Constructs a spatial weights matrix (.swm) file to represent the spatial relationships among features in a dataset.
The Generate Spatial Weights Matrix tool is contained in the Spatial Statistics Tools tool box.
Usage tips:
- Output from this tool is a spatial weights matrix file (.swm). Tools that require you to specify a Conceptualization of Spatial Relationships option will accept a ; select GET_SPATIAL_WEIGHTS_FROM_FILE for the Conceptualization of Spatial Relationships parameter and, for the Weights Matrix File parameter, specify the full pathname to the spatial weights file you create using this tool.
- This tool also reports characteristics of the resultant spatial weights matrix file: number of features, connectivity, minimum, maximum and average number of neighbors. This summary is accessible from the and may be viewed by right-clicking on the in the Results window and selecting. Using this summary, ensure that all features have at least 1 neighbor (8 neighbors is ideal). In general, especially with large datasets, a low value for feature connectivity is desirable.
- Whenever using a distance-based Conceptualization of Spatial Relationships, data should be in a (rather than a ).
- 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 Unique ID field is linked to feature relationships derived from running this tool. Consequently, the Unique ID values must be unique for every feature and typically should be in a permanent field that remains with the feature class. If you don't have a Unique ID field, you can easily create one by adding a new integer field to your feature class table and calculating the field values to be equal to the FID/OID field. You cannot use the FID/OID field directly for the Unique ID parameter.
- The polygon contiguity options, CONTIGUITY_EDGES_ONLY and CONTIGUITY_EDGES_CORNERS, for the Conceptualization of Spatial Relationships parameter are only valid for polygon features. These options are available with the Advanced license only.
- The Number of Neighbors parameter may override the Threshold Distance parameter for Inverse or Fixed Distance Conceptualizations of Spatial Relationships. If you specify a threshold distance of 10 miles and 3 for the number of neighbors, all features will receive a minimum of 3 neighbors even if the threshold has to be increased to find them. The threshold distance is only increased in those cases where the minimum number of neighbors is not met.
- The CONVERT_TABLE option for the Conceptualization of Spatial Relationships parameter may be used to convert an to a . First you will need to put your ASCII weights into a table (using Excel, for example).
- 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 .
Constructor Summary |
GenerateSpatialWeightsMatrix()
Creates the Generate Spatial Weights Matrix tool with defaults. |
GenerateSpatialWeightsMatrix(java.lang.Object inputFeatureClass,
java.lang.Object uniqueIDField,
java.lang.Object outputSpatialWeightsMatrixFile,
java.lang.String conceptualizationOfSpatialRelationships)
Creates the Generate Spatial Weights Matrix tool with the required parameters. |
Method Summary |
java.lang.String |
getConceptualizationOfSpatialRelationships()
Returns the Conceptualization of Spatial Relationships parameter of this tool . |
java.lang.String |
getDistanceMethod()
Returns the Distance Method parameter of this tool . |
double |
getExponent()
Returns the Exponent parameter of this tool . |
java.lang.Object |
getInputFeatureClass()
Returns the Input Feature Class parameter of this tool . |
java.lang.Object |
getInputTable()
Returns the Input Table parameter of this tool . |
int |
getNumberOfNeighbors()
Returns the Number of Neighbors parameter of this tool . |
java.lang.Object |
getOutputSpatialWeightsMatrixFile()
Returns the Output Spatial Weights Matrix File parameter of this tool . |
java.lang.String |
getRowStandardization()
Returns the Row Standardization parameter of this tool . |
double |
getThresholdDistance()
Returns the Threshold Distance parameter of this tool . |
java.lang.String |
getToolboxAlias()
Returns the alias of the tool box containing this tool. |
java.lang.String |
getToolboxName()
Returns the name of the tool box containing this tool. |
java.lang.String |
getToolName()
Returns the name of this tool. |
java.lang.Object |
getUniqueIDField()
Returns the Unique ID Field parameter of this tool . |
void |
setConceptualizationOfSpatialRelationships(java.lang.String conceptualizationOfSpatialRelationships)
Sets the Conceptualization of Spatial Relationships parameter of this tool . |
void |
setDistanceMethod(java.lang.String distanceMethod)
Sets the Distance Method parameter of this tool . |
void |
setExponent(double exponent)
Sets the Exponent parameter of this tool . |
void |
setInputFeatureClass(java.lang.Object inputFeatureClass)
Sets the Input Feature Class parameter of this tool . |
void |
setInputTable(java.lang.Object inputTable)
Sets the Input Table parameter of this tool . |
void |
setNumberOfNeighbors(int numberOfNeighbors)
Sets the Number of Neighbors parameter of this tool . |
void |
setOutputSpatialWeightsMatrixFile(java.lang.Object outputSpatialWeightsMatrixFile)
Sets the Output Spatial Weights Matrix File parameter of this tool . |
void |
setRowStandardization(java.lang.String rowStandardization)
Sets the Row Standardization parameter of this tool . |
void |
setThresholdDistance(double thresholdDistance)
Sets the Threshold Distance parameter of this tool . |
void |
setUniqueIDField(java.lang.Object uniqueIDField)
Sets the Unique ID Field parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
GenerateSpatialWeightsMatrix
public GenerateSpatialWeightsMatrix()
- Creates the Generate Spatial Weights Matrix tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
GenerateSpatialWeightsMatrix
public GenerateSpatialWeightsMatrix(java.lang.Object inputFeatureClass,
java.lang.Object uniqueIDField,
java.lang.Object outputSpatialWeightsMatrixFile,
java.lang.String conceptualizationOfSpatialRelationships)
- Creates the Generate Spatial Weights Matrix 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 relationships of features will be assessed.uniqueIDField
- an integer field containing a different value for every feature in the Input Feature Class.outputSpatialWeightsMatrixFile
- the full pathname for the spatial weights matrix file (.swm) you want to create.conceptualizationOfSpatialRelationships
- specifies how spatial relationships among features are conceptualized. note: Polygon Contiguity methods are only available with an Advanced license.
getInputFeatureClass
public java.lang.Object getInputFeatureClass()
- Returns the Input Feature Class parameter of this tool .
This parameter is the feature class for which spatial relationships of features will be assessed.
This is a required parameter.
- Returns:
- the Input Feature Class
setInputFeatureClass
public void setInputFeatureClass(java.lang.Object inputFeatureClass)
- Sets the Input Feature Class parameter of this tool .
This parameter is the feature class for which spatial relationships of features will be assessed.
This is a required parameter.
- Parameters:
inputFeatureClass
- the feature class for which spatial relationships of features will be assessed.
getUniqueIDField
public java.lang.Object getUniqueIDField()
- Returns the Unique ID Field parameter of this tool .
This parameter is an integer field containing a different value for every feature in the Input Feature Class.
This is a required parameter.
- Returns:
- the Unique ID Field
setUniqueIDField
public void setUniqueIDField(java.lang.Object uniqueIDField)
- Sets the Unique ID Field parameter of this tool .
This parameter is an integer field containing a different value for every feature in the Input Feature Class.
This is a required parameter.
- Parameters:
uniqueIDField
- an integer field containing a different value for every feature in the Input Feature Class.
getOutputSpatialWeightsMatrixFile
public java.lang.Object getOutputSpatialWeightsMatrixFile()
- Returns the Output Spatial Weights Matrix File parameter of this tool .
This parameter is the full pathname for the spatial weights matrix file (.swm) you want to create.
This is a required parameter.
- Returns:
- the Output Spatial Weights Matrix File
setOutputSpatialWeightsMatrixFile
public void setOutputSpatialWeightsMatrixFile(java.lang.Object outputSpatialWeightsMatrixFile)
- Sets the Output Spatial Weights Matrix File parameter of this tool .
This parameter is the full pathname for the spatial weights matrix file (.swm) you want to create.
This is a required parameter.
- Parameters:
outputSpatialWeightsMatrixFile
- the full pathname for the spatial weights matrix file (.swm) you want to create.
getConceptualizationOfSpatialRelationships
public java.lang.String getConceptualizationOfSpatialRelationships()
- Returns the Conceptualization of Spatial Relationships parameter of this tool .
This parameter is specifies how spatial relationships among features are conceptualized. note: Polygon Contiguity methods are only available with an Advanced license.
This is a required parameter.
- Returns:
- the Conceptualization of Spatial Relationships
setConceptualizationOfSpatialRelationships
public void setConceptualizationOfSpatialRelationships(java.lang.String conceptualizationOfSpatialRelationships)
- Sets the Conceptualization of Spatial Relationships parameter of this tool .
This parameter is specifies how spatial relationships among features are conceptualized. note: Polygon Contiguity methods are only available with an Advanced license.
This is a required parameter.
- Parameters:
conceptualizationOfSpatialRelationships
- specifies how spatial relationships among features are conceptualized. note: Polygon Contiguity methods are only available with an Advanced license.
getDistanceMethod
public java.lang.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 an optional parameter.
- Returns:
- the Distance Method
setDistanceMethod
public void setDistanceMethod(java.lang.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 an optional parameter.
- Parameters:
distanceMethod
- specifies how distances are calculated from each feature to neighboring features.
getExponent
public double getExponent()
- Returns the Exponent parameter of this tool .
This parameter is parameter for inverse distance calculation. Typical values are 1 or 2.
This is an optional parameter.
- Returns:
- the Exponent
setExponent
public void setExponent(double exponent)
- Sets the Exponent parameter of this tool .
This parameter is parameter for inverse distance calculation. Typical values are 1 or 2.
This is an optional parameter.
- Parameters:
exponent
- parameter for inverse distance calculation. Typical values are 1 or 2.
getThresholdDistance
public double getThresholdDistance()
- Returns the Threshold Distance parameter of this tool .
This parameter is specifies a cutoff distance for Inverse Distance and Fixed Distance conceptualizations of spatial relationships. Enter this value using the units specified in the environment output coordinate system. a value of zero indicates that no threshold distance is applied. When this parameter is left blank, a default threshold value is computed based on output feature class extent and the number of features.
This is an optional parameter.
- Returns:
- the Threshold Distance
setThresholdDistance
public void setThresholdDistance(double thresholdDistance)
- Sets the Threshold Distance parameter of this tool .
This parameter is specifies a cutoff distance for Inverse Distance and Fixed Distance conceptualizations of spatial relationships. Enter this value using the units specified in the environment output coordinate system. a value of zero indicates that no threshold distance is applied. When this parameter is left blank, a default threshold value is computed based on output feature class extent and the number of features.
This is an optional parameter.
- Parameters:
thresholdDistance
- specifies a cutoff distance for Inverse Distance and Fixed Distance conceptualizations of spatial relationships. Enter this value using the units specified in the environment output coordinate system. a value of zero indicates that no threshold distance is applied. When this parameter is left blank, a default threshold value is computed based on output feature class extent and the number of features.
getNumberOfNeighbors
public int getNumberOfNeighbors()
- Returns the Number of Neighbors parameter of this tool .
This parameter is an integer reflecting either the minimum or the exact number of neighbors. For , each feature will have exactly this specified number of neighbors. For or each feature will have at least this many neighbors (the threshold distance will be temporarily extended to ensure this many neighbors, if necessary). When there are island polygons and one of the conceptualizations of Spatial Relationships is selected, then this specified number of nearest polygons will be associated with those island polygons.
This is an optional parameter.
- Returns:
- the Number of Neighbors
setNumberOfNeighbors
public void setNumberOfNeighbors(int numberOfNeighbors)
- Sets the Number of Neighbors parameter of this tool .
This parameter is an integer reflecting either the minimum or the exact number of neighbors. For , each feature will have exactly this specified number of neighbors. For or each feature will have at least this many neighbors (the threshold distance will be temporarily extended to ensure this many neighbors, if necessary). When there are island polygons and one of the conceptualizations of Spatial Relationships is selected, then this specified number of nearest polygons will be associated with those island polygons.
This is an optional parameter.
- Parameters:
numberOfNeighbors
- an integer reflecting either the minimum or the exact number of neighbors. For , each feature will have exactly this specified number of neighbors. For or each feature will have at least this many neighbors (the threshold distance will be temporarily extended to ensure this many neighbors, if necessary). When there are island polygons and one of the conceptualizations of Spatial Relationships is selected, then this specified number of nearest polygons will be associated with those island polygons.
getRowStandardization
public java.lang.String getRowStandardization()
- Returns the Row Standardization parameter of this tool .
This parameter is row standardization is recommended whenever feature distribution is potentially biased due to sampling design or to an imposed aggregation scheme.
This is an optional parameter.
- Returns:
- the Row Standardization
setRowStandardization
public void setRowStandardization(java.lang.String rowStandardization)
- Sets the Row Standardization parameter of this tool .
This parameter is row standardization is recommended whenever feature distribution is potentially biased due to sampling design or to an imposed aggregation scheme.
This is an optional parameter.
- Parameters:
rowStandardization
- row standardization is recommended whenever feature distribution is potentially biased due to sampling design or to an imposed aggregation scheme.
getInputTable
public java.lang.Object getInputTable()
- Returns the Input Table parameter of this tool .
This parameter is a table containing numeric weights relating every feature to every other feature in the input feature class. Required fields are the Input Feature Class Unique ID field, NID (neighbor ID), and WEIGHT.
This is an optional parameter.
- Returns:
- the Input Table
setInputTable
public void setInputTable(java.lang.Object inputTable)
- Sets the Input Table parameter of this tool .
This parameter is a table containing numeric weights relating every feature to every other feature in the input feature class. Required fields are the Input Feature Class Unique ID field, NID (neighbor ID), and WEIGHT.
This is an optional parameter.
- Parameters:
inputTable
- a table containing numeric weights relating every feature to every other feature in the input feature class. Required fields are the Input Feature Class Unique ID field, NID (neighbor ID), and WEIGHT.
getToolName
public java.lang.String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public java.lang.String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public java.lang.String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias