This document is archived and information here might be outdated. Recommended version. |
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 );
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:
ISpatialJoin Interface | IFeatureClass Interface | Feature Class