com.esri.arcgis.geoprocessing.tools.analysistools
Class SpatialJoin

java.lang.Object
  extended by com.esri.arcgis.geoprocessing.AbstractGPTool
      extended by com.esri.arcgis.geoprocessing.tools.analysistools.SpatialJoin
All Implemented Interfaces:
GPTool

public class SpatialJoin
extends AbstractGPTool

Creates a table join in which fields from one layer's attribute table are appended to another layer's attribute table based on the relative locations of the features in the two layers. The Spatial Join tool is contained in the Analysis Tools tool box.
Learn more about aggregating field values with Spatial Join

Software restrictions: none

Usage tips:


Field Summary
 
Fields inherited from class com.esri.arcgis.geoprocessing.AbstractGPTool
vals
 
Constructor Summary
SpatialJoin()
          Creates the Spatial Join tool with defaults.
SpatialJoin(Object targetFeatures, Object joinFeatures, Object outFeatureClass)
          Creates the Spatial Join tool with the required parameters.
 
Method Summary
 String getDistanceFieldName()
          Returns the Distance Field Name parameter of this tool .
 Object getFieldMapping()
          Returns the Field Map of Join Features parameter of this tool .
 Object getJoinFeatures()
          Returns the Join Features parameter of this tool .
 String getJoinOperation()
          Returns the Join Operation parameter of this tool .
 String getJoinType()
          Returns the Keep All Target Features parameter of this tool .
 String getMatchOption()
          Returns the Match Option parameter of this tool .
 Object getOutFeatureClass()
          Returns the Output Feature Class parameter of this tool .
 Object getSearchRadius()
          Returns the Search Radius parameter of this tool .
 Object getTargetFeatures()
          Returns the Target Features parameter of this tool .
 String getToolboxAlias()
          Returns the alias of the tool box containing this tool.
 String getToolboxName()
          Returns the name of the tool box containing this tool.
 String getToolName()
          Returns the name of this tool.
 void setDistanceFieldName(String distanceFieldName)
          Sets the Distance Field Name parameter of this tool .
 void setFieldMapping(Object fieldMapping)
          Sets the Field Map of Join Features parameter of this tool .
 void setJoinFeatures(Object joinFeatures)
          Sets the Join Features parameter of this tool .
 void setJoinOperation(String joinOperation)
          Sets the Join Operation parameter of this tool .
 void setJoinType(String joinType)
          Sets the Keep All Target Features parameter of this tool .
 void setMatchOption(String matchOption)
          Sets the Match Option parameter of this tool .
 void setOutFeatureClass(Object outFeatureClass)
          Sets the Output Feature Class parameter of this tool .
 void setSearchRadius(Object searchRadius)
          Sets the Search Radius parameter of this tool .
 void setTargetFeatures(Object targetFeatures)
          Sets the Target Features parameter of this tool .
 
Methods inherited from class com.esri.arcgis.geoprocessing.AbstractGPTool
getParameterValues, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpatialJoin

public SpatialJoin()
Creates the Spatial Join tool with defaults.

Initializes the array of tool parameters with the default values specified when the tool was created.


SpatialJoin

public SpatialJoin(Object targetFeatures,
                   Object joinFeatures,
                   Object outFeatureClass)
Creates the Spatial Join 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:
targetFeatures - Feature Layer, the dataset that you are joining to. The output of the join operation will contain the features from this feature class with appended columns from the join feature class. It can be any spatial data source (shapefiles, SDE feature classes, coverages, SDC, query tables etc) supported by ArcGIS. It can also be read only.
joinFeatures - Feature Layer, the dataset that you are joining from. The attributes from this dataset are appended to the attributes of the target feature class in the output based on a spatial relation. It can be any spatial data source (shapefiles, SDE feature classes, coverages, SDC, query tables etc) supported by ArcGIS. It can also be read only.
outFeatureClass - Feature Class, a new dataset which contains the results of the join operation.
Method Detail

getTargetFeatures

public Object getTargetFeatures()
Returns the Target Features parameter of this tool . This parameter is Feature Layer, the dataset that you are joining to. The output of the join operation will contain the features from this feature class with appended columns from the join feature class. It can be any spatial data source (shapefiles, SDE feature classes, coverages, SDC, query tables etc) supported by ArcGIS. It can also be read only. This is a required parameter.

Returns:
the Target Features

setTargetFeatures

public void setTargetFeatures(Object targetFeatures)
Sets the Target Features parameter of this tool . This parameter is Feature Layer, the dataset that you are joining to. The output of the join operation will contain the features from this feature class with appended columns from the join feature class. It can be any spatial data source (shapefiles, SDE feature classes, coverages, SDC, query tables etc) supported by ArcGIS. It can also be read only. This is a required parameter.

Parameters:
targetFeatures - Feature Layer, the dataset that you are joining to. The output of the join operation will contain the features from this feature class with appended columns from the join feature class. It can be any spatial data source (shapefiles, SDE feature classes, coverages, SDC, query tables etc) supported by ArcGIS. It can also be read only.

getJoinFeatures

public Object getJoinFeatures()
Returns the Join Features parameter of this tool . This parameter is Feature Layer, the dataset that you are joining from. The attributes from this dataset are appended to the attributes of the target feature class in the output based on a spatial relation. It can be any spatial data source (shapefiles, SDE feature classes, coverages, SDC, query tables etc) supported by ArcGIS. It can also be read only. This is a required parameter.

Returns:
the Join Features

setJoinFeatures

public void setJoinFeatures(Object joinFeatures)
Sets the Join Features parameter of this tool . This parameter is Feature Layer, the dataset that you are joining from. The attributes from this dataset are appended to the attributes of the target feature class in the output based on a spatial relation. It can be any spatial data source (shapefiles, SDE feature classes, coverages, SDC, query tables etc) supported by ArcGIS. It can also be read only. This is a required parameter.

Parameters:
joinFeatures - Feature Layer, the dataset that you are joining from. The attributes from this dataset are appended to the attributes of the target feature class in the output based on a spatial relation. It can be any spatial data source (shapefiles, SDE feature classes, coverages, SDC, query tables etc) supported by ArcGIS. It can also be read only.

getOutFeatureClass

public Object getOutFeatureClass()
Returns the Output Feature Class parameter of this tool . This parameter is Feature Class, a new dataset which contains the results of the join operation. This is a required parameter.

Returns:
the Output Feature Class

setOutFeatureClass

public void setOutFeatureClass(Object outFeatureClass)
Sets the Output Feature Class parameter of this tool . This parameter is Feature Class, a new dataset which contains the results of the join operation. This is a required parameter.

Parameters:
outFeatureClass - Feature Class, a new dataset which contains the results of the join operation.

getJoinOperation

public String getJoinOperation()
Returns the Join Operation parameter of this tool . This parameter is String, the join operation describes cardinality rules associated with matching features during the join. The join options are: This is an optional parameter.

Returns:
the Join Operation

setJoinOperation

public void setJoinOperation(String joinOperation)
Sets the Join Operation parameter of this tool . This parameter is String, the join operation describes cardinality rules associated with matching features during the join. The join options are: This is an optional parameter.

Parameters:
joinOperation - String, the join operation describes cardinality rules associated with matching features during the join. The join options are:

getJoinType

public String getJoinType()
Returns the Keep All Target Features parameter of this tool . This parameter is String, determine if the join will be an inner or outer join. This is an optional parameter.

Returns:
the Keep All Target Features

setJoinType

public void setJoinType(String joinType)
Sets the Keep All Target Features parameter of this tool . This parameter is String, determine if the join will be an inner or outer join. This is an optional parameter.

Parameters:
joinType - String, determine if the join will be an inner or outer join.

getFieldMapping

public Object getFieldMapping()
Returns the Field Map of Join Features parameter of this tool . This parameter is Field Mappings, for each Field Map, you can add, rename, or delete output fields as well as set properties such as data type and merge rule. You can also delete an output field's sub fields, and you can format any output field's values if the data type is text. This is an optional parameter.

Returns:
the Field Map of Join Features

setFieldMapping

public void setFieldMapping(Object fieldMapping)
Sets the Field Map of Join Features parameter of this tool . This parameter is Field Mappings, for each Field Map, you can add, rename, or delete output fields as well as set properties such as data type and merge rule. You can also delete an output field's sub fields, and you can format any output field's values if the data type is text. This is an optional parameter.

Parameters:
fieldMapping - Field Mappings, for each Field Map, you can add, rename, or delete output fields as well as set properties such as data type and merge rule. You can also delete an output field's sub fields, and you can format any output field's values if the data type is text.

getMatchOption

public String getMatchOption()
Returns the Match Option parameter of this tool . This parameter is String, defines the criteria used to match rows. The match options are: This is an optional parameter.

Returns:
the Match Option

setMatchOption

public void setMatchOption(String matchOption)
Sets the Match Option parameter of this tool . This parameter is String, defines the criteria used to match rows. The match options are: This is an optional parameter.

Parameters:
matchOption - String, defines the criteria used to match rows. The match options are:

getSearchRadius

public Object getSearchRadius()
Returns the Search Radius parameter of this tool . This parameter is Linear unit, only used when the Match Option is INTERSECT or CLOSEST. Join features that are within this distance of the individual input feature will be considered for the operation. The default search radius is 0. A value of 0 for the Search radius means different things to the Match Option. - INTERSECT : only the join features that INTERESCT the input feature will be included in the join. - CLOSEST : all join features will be candidates for each input feature. Basically a value of 0 here means use all join features. This is an optional parameter.

Returns:
the Search Radius

setSearchRadius

public void setSearchRadius(Object searchRadius)
Sets the Search Radius parameter of this tool . This parameter is Linear unit, only used when the Match Option is INTERSECT or CLOSEST. Join features that are within this distance of the individual input feature will be considered for the operation. The default search radius is 0. A value of 0 for the Search radius means different things to the Match Option. - INTERSECT : only the join features that INTERESCT the input feature will be included in the join. - CLOSEST : all join features will be candidates for each input feature. Basically a value of 0 here means use all join features. This is an optional parameter.

Parameters:
searchRadius - Linear unit, only used when the Match Option is INTERSECT or CLOSEST. Join features that are within this distance of the individual input feature will be considered for the operation. The default search radius is 0. A value of 0 for the Search radius means different things to the Match Option. - INTERSECT : only the join features that INTERESCT the input feature will be included in the join. - CLOSEST : all join features will be candidates for each input feature. Basically a value of 0 here means use all join features.

getDistanceFieldName

public String getDistanceFieldName()
Returns the Distance Field Name parameter of this tool . This parameter is String, the name of a new field to be added to the output feature class. This field will be of type Double and will contain distances between the Target and the closest Join Features. This option is only available when the Match Option parameter is set to CLOSEST. A value of -1 in the Distance Field means there were no Join Features within the distance specified in the Search Radius parameter. If no Distance Field Name is specified, then no field will be added to the output to capture this information. This is an optional parameter.

Returns:
the Distance Field Name

setDistanceFieldName

public void setDistanceFieldName(String distanceFieldName)
Sets the Distance Field Name parameter of this tool . This parameter is String, the name of a new field to be added to the output feature class. This field will be of type Double and will contain distances between the Target and the closest Join Features. This option is only available when the Match Option parameter is set to CLOSEST. A value of -1 in the Distance Field means there were no Join Features within the distance specified in the Search Radius parameter. If no Distance Field Name is specified, then no field will be added to the output to capture this information. This is an optional parameter.

Parameters:
distanceFieldName - String, the name of a new field to be added to the output feature class. This field will be of type Double and will contain distances between the Target and the closest Join Features. This option is only available when the Match Option parameter is set to CLOSEST. A value of -1 in the Distance Field means there were no Join Features within the distance specified in the Search Radius parameter. If no Distance Field Name is specified, then no field will be added to the output to capture this information.

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