This document is archived and information here might be outdated.  Recommended version.


ISpatialJoin.JoinAggregate Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > ArcMapUI > ESRI.ArcGIS.ArcMapUI > Interfaces > IS > ISpatialJoin Interface > ISpatialJoin.JoinAggregate Method
ArcGIS Developer Help

ISpatialJoin.JoinAggregate Method

Join using aggregate. Only features within a distance of maxMapDist will be joined. A maxMapDist of -1 means infinity.

[Visual Basic .NET]
Public Function JoinAggregate ( _
    ByVal pOutputName As IName, _
    ByVal maxMapDist As Double _
) As IFeatureClass
[C#]
public IFeatureClass JoinAggregate (
    IName pOutputName,
    double maxMapDist
);

Product Availability

Available with ArcGIS Desktop.

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:

         

 

         

See Also

ISpatialJoin Interface | IFeatureClass Interface | Feature Class