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

Transfers the attributes from one feature class to another feature class, based on the spatial relationships between the features in the two feature classes. The Spatial Join tool is contained in the Analysis Tools tool box.

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 - the attributes from the Join Features are transferred to the Target Features whenever a specified spatial relationship (or Match Option) is found. The Target Features can be any spatial data source supported by ArcGIS.
joinFeatures - the attributes from the Join Features are transferred to the Target Features whenever a specified spatial relationship (or Match Option) is found. The Join Features can be any spatial data source supported by ArcGIS.
outFeatureClass - a new feature class containing the attributes of the Join Features joined to the Target Features.
Method Detail

getTargetFeatures

public Object getTargetFeatures()
Returns the Target Features parameter of this tool . This parameter is the attributes from the Join Features are transferred to the Target Features whenever a specified spatial relationship (or Match Option) is found. The Target Features can be any spatial data source supported by ArcGIS. 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 the attributes from the Join Features are transferred to the Target Features whenever a specified spatial relationship (or Match Option) is found. The Target Features can be any spatial data source supported by ArcGIS. This is a required parameter.

Parameters:
targetFeatures - the attributes from the Join Features are transferred to the Target Features whenever a specified spatial relationship (or Match Option) is found. The Target Features can be any spatial data source supported by ArcGIS.

getJoinFeatures

public Object getJoinFeatures()
Returns the Join Features parameter of this tool . This parameter is the attributes from the Join Features are transferred to the Target Features whenever a specified spatial relationship (or Match Option) is found. The Join Features can be any spatial data source supported by ArcGIS. 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 the attributes from the Join Features are transferred to the Target Features whenever a specified spatial relationship (or Match Option) is found. The Join Features can be any spatial data source supported by ArcGIS. This is a required parameter.

Parameters:
joinFeatures - the attributes from the Join Features are transferred to the Target Features whenever a specified spatial relationship (or Match Option) is found. The Join Features can be any spatial data source supported by ArcGIS.

getOutFeatureClass

public Object getOutFeatureClass()
Returns the Output Feature Class parameter of this tool . This parameter is a new feature class containing the attributes of the Join Features joined to the Target Features. 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 a new feature class containing the attributes of the Join Features joined to the Target Features. This is a required parameter.

Parameters:
outFeatureClass - a new feature class containing the attributes of the Join Features joined to the Target Features.

getJoinOperation

public String getJoinOperation()
Returns the Join Operation parameter of this tool . This parameter is determines how joins between the Target Features and Join Features will be handled in the output feature class if multiple Join Features are found that have the same spatial relationship with a single Target Feature. For example, if a single point Target Feature is found within two separate polygon Join Features, should the attributes of both polygons be aggregated using a Field Map merge rule (JOIN_ONE_TO_ONE), or should the output contain two instances of the Target Feature: one instance with the attributes of one polygon, and one instance with the attributes of the other polygon (JOIN_ONE_TO_MANY). 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 determines how joins between the Target Features and Join Features will be handled in the output feature class if multiple Join Features are found that have the same spatial relationship with a single Target Feature. For example, if a single point Target Feature is found within two separate polygon Join Features, should the attributes of both polygons be aggregated using a Field Map merge rule (JOIN_ONE_TO_ONE), or should the output contain two instances of the Target Feature: one instance with the attributes of one polygon, and one instance with the attributes of the other polygon (JOIN_ONE_TO_MANY). This is an optional parameter.

Parameters:
joinOperation - determines how joins between the Target Features and Join Features will be handled in the output feature class if multiple Join Features are found that have the same spatial relationship with a single Target Feature. For example, if a single point Target Feature is found within two separate polygon Join Features, should the attributes of both polygons be aggregated using a Field Map merge rule (JOIN_ONE_TO_ONE), or should the output contain two instances of the Target Feature: one instance with the attributes of one polygon, and one instance with the attributes of the other polygon (JOIN_ONE_TO_MANY).

getJoinType

public String getJoinType()
Returns the Keep All Target Features parameter of this tool . This parameter is determines if all Taget Features will be maintained in the output feature class (outer join), or only those that have the specified spatial relationship with the Join Features (inner 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 determines if all Taget Features will be maintained in the output feature class (outer join), or only those that have the specified spatial relationship with the Join Features (inner join). This is an optional parameter.

Parameters:
joinType - determines if all Taget Features will be maintained in the output feature class (outer join), or only those that have the specified spatial relationship with the Join Features (inner join).

getFieldMapping

public Object getFieldMapping()
Returns the Field Map of Join Features parameter of this tool . This parameter is controls what attribute fields will be in the output feature class. Fields can be added, deleted, renamed, or have their properties changed. The initial list contains fields from both the Target Features and the Join Features. 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 controls what attribute fields will be in the output feature class. Fields can be added, deleted, renamed, or have their properties changed. The initial list contains fields from both the Target Features and the Join Features. This is an optional parameter.

Parameters:
fieldMapping - controls what attribute fields will be in the output feature class. Fields can be added, deleted, renamed, or have their properties changed. The initial list contains fields from both the Target Features and the Join Features.

getMatchOption

public String getMatchOption()
Returns the Match Option parameter of this tool . This parameter is defines the criteria used to match rows. The attributes from the Join Features are transferred to the Target Features whenever this spatial relationship (or Match Option) is found. 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 defines the criteria used to match rows. The attributes from the Join Features are transferred to the Target Features whenever this spatial relationship (or Match Option) is found. The match options are: This is an optional parameter.

Parameters:
matchOption - defines the criteria used to match rows. The attributes from the Join Features are transferred to the Target Features whenever this spatial relationship (or Match Option) is found. The match options are:

getSearchRadius

public Object getSearchRadius()
Returns the Search Radius parameter of this tool . This parameter is join Features within this distance of a Target Feature will be considered for the spatial join. Search Radius is only valid when the spatial relationship (or Match Option) INTERSECTS or CLOSEST is specified. Using a search radius of 100 meters with the spatial relationship INTERSECTS is the equivalent of saying: If a Join Feature is within 100 meters of a Target Feature, transfer the Join Feature attributes to the Target Feature. Using a search radius of 100 meters with the spatial relationship CLOSEST is the equivalent of saying: If a Join Feature is within 100 meters of a Target Feature, and is the closest Join Feature to that Target Feature, transfer the Join Feature attribtures to that Target Feature. 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 join Features within this distance of a Target Feature will be considered for the spatial join. Search Radius is only valid when the spatial relationship (or Match Option) INTERSECTS or CLOSEST is specified. Using a search radius of 100 meters with the spatial relationship INTERSECTS is the equivalent of saying: If a Join Feature is within 100 meters of a Target Feature, transfer the Join Feature attributes to the Target Feature. Using a search radius of 100 meters with the spatial relationship CLOSEST is the equivalent of saying: If a Join Feature is within 100 meters of a Target Feature, and is the closest Join Feature to that Target Feature, transfer the Join Feature attribtures to that Target Feature. This is an optional parameter.

Parameters:
searchRadius - join Features within this distance of a Target Feature will be considered for the spatial join. Search Radius is only valid when the spatial relationship (or Match Option) INTERSECTS or CLOSEST is specified. Using a search radius of 100 meters with the spatial relationship INTERSECTS is the equivalent of saying: If a Join Feature is within 100 meters of a Target Feature, transfer the Join Feature attributes to the Target Feature. Using a search radius of 100 meters with the spatial relationship CLOSEST is the equivalent of saying: If a Join Feature is within 100 meters of a Target Feature, and is the closest Join Feature to that Target Feature, transfer the Join Feature attribtures to that Target Feature.

getDistanceFieldName

public String getDistanceFieldName()
Returns the Distance Field Name parameter of this tool . This parameter is the name of a field to be added to the output feature class, which contains the distance between the Target Feature and the closest Join Feature. This option is only valid when the spatial relationship (or Match Option) CLOSEST is specified. If no field name is specified, the field will not be added to the output feature class. 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 the name of a field to be added to the output feature class, which contains the distance between the Target Feature and the closest Join Feature. This option is only valid when the spatial relationship (or Match Option) CLOSEST is specified. If no field name is specified, the field will not be added to the output feature class. This is an optional parameter.

Parameters:
distanceFieldName - the name of a field to be added to the output feature class, which contains the distance between the Target Feature and the closest Join Feature. This option is only valid when the spatial relationship (or Match Option) CLOSEST is specified. If no field name is specified, the field will not be added to the output feature class.

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