com.esri.arcgis.arcmapui
Interface ISpatialJoin

All Superinterfaces:
Serializable
All Known Implementing Classes:
SpatialJoin

public interface ISpatialJoin
extends Serializable

Provides access to members that join the attributes of feature classes based on the spatial relationships of the features.

Description

ISpatialJoin performs a join operation based a spatial relationship between two feature classes.

Product Availability

Available with ArcGIS Desktop.


Method Summary
 IFeatureClass joinAggregate(IName pOutputName, double maxMapDist)
          Join using aggregate.
 IFeatureClass joinNearest(IName pOutputName, double maxMapDist)
          Joins with the nearest feature in the join feature class.
 IFeatureClass joinWithin(IName pOutputName)
          Joins a feature in the source feature class with the feature if it falls within in the join feature class.
 void setJoinTableByRef(ITable rhs1)
          The spatial table to append fields from.
 void setLeftOuterJoin(boolean rhs1)
          Indicates whether a match is required before adding a record from the source feature class to the result.
 void setShowProcess(boolean bShowMessage, int rhs2)
          Indicates whether to show update messages while processing join.
 void setSourceTableByRef(ITable rhs1)
          The spatial table to append fields to.
 

Method Detail

setSourceTableByRef

void setSourceTableByRef(ITable rhs1)
                         throws IOException,
                                AutomationException
The spatial table to append fields to.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
rhs1 - A reference to a com.esri.arcgis.geodatabase.ITable (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setJoinTableByRef

void setJoinTableByRef(ITable rhs1)
                       throws IOException,
                              AutomationException
The spatial table to append fields from.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
rhs1 - A reference to a com.esri.arcgis.geodatabase.ITable (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

joinAggregate

IFeatureClass joinAggregate(IName pOutputName,
                            double maxMapDist)
                            throws IOException,
                                   AutomationException
Join using aggregate. Only features within a distance of maxMapDist will be joined. A maxMapDist of -1 means infinity.

Remarks

JoinAggregate will count the number of features in the join table that are the closest to features in the source table. The maxMapDist parameter determines the search radius for the join operation. Negative maxMapDist values other than -1 (infinity) are invalid and will produce an empty output feature class.

For example, if a source layer containing line features (rivers) is spatially joined to a layer which contains point features (cities), the new output layer will contain a record for each feature in the source table and include an additional column, 'count'. Where a match was successful, the value in this column indicates the number of cities closest to a particular river, given the value of maxMapDist.

Rivers and cities feature classes:

Output feature class table:

If additional information about the related features is required, QI on the SpatialJoin CoClass for the IAggregateOptions interface to append an aggregate (minimium, average, maximum etc.) of the numeric attributes of the closest features.

Output feature class table with aggregated numeric attributes:

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
pOutputName - A reference to a com.esri.arcgis.system.IName (in)
maxMapDist - The maxMapDist (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

joinNearest

IFeatureClass joinNearest(IName pOutputName,
                          double maxMapDist)
                          throws IOException,
                                 AutomationException
Joins with the nearest feature in the join feature class. Only features within a distance of maxMapDist will be joined. A maxMapDist of -1 means infinity.

Remarks

JoinNearest identifies the nearest feature in the join table to features in the source table. The maxMapDist parameter determines the search radius for the join operation. Negative maxMapDist values other than -1 (infinity) are invalid and will produce an empty output feature class.

For example, joining a source layer containing line features (rivers) to a layer which contains point features (cities) with LeftOuterJoin = FALSE. Where a match is successful, the new output layer will contain a record for each feature in the source table with the corresponding attribute columns for the nearest feature in the join table.

Rivers and cities feature classes:

New output feature class table:

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
pOutputName - A reference to a com.esri.arcgis.system.IName (in)
maxMapDist - The maxMapDist (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

joinWithin

IFeatureClass joinWithin(IName pOutputName)
                         throws IOException,
                                AutomationException
Joins a feature in the source feature class with the feature if it falls within in the join feature class.

Remarks

JoinWithin identifies those features in the source table that are contained by features in the table being joined.

For example, if the source layer containing line features (rivers) is spatially joined to a layer which contains polygon features (administrative boundaries), with the LeftOuterJoin property set to TRUE, the new output layer will contain a record for each feature in the source table with all the attribute columns from the join table appended. Where a JoinWithin match was identified, each river in the new feature class will now have additional attribute information about the administrative boundary it falls within. Where no match was identified, the appended columns will be empty.

River and states feature classes:

New feature class table:

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
pOutputName - A reference to a com.esri.arcgis.system.IName (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setShowProcess

void setShowProcess(boolean bShowMessage,
                    int rhs2)
                    throws IOException,
                           AutomationException
Indicates whether to show update messages while processing join.

Product Availability

Available with ArcGIS Desktop.

Parameters:
bShowMessage - The bShowMessage (in)
rhs2 - The rhs2 (A COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLeftOuterJoin

void setLeftOuterJoin(boolean rhs1)
                      throws IOException,
                             AutomationException
Indicates whether a match is required before adding a record from the source feature class to the result. If TRUE, all records in the source feature class are added regardless of whether there is a match.

Remarks

The following diagram illustrates the nature of the join which is performed depending on whether this parameter is set to true or false:

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.