Summarize Related Features

ERDAS IMAGINE Help

HGD_Variant
16.5.2
HGD_Product
ERDAS IMAGINE
HGD_Portfolio_Suite
Producer

Category: Feature Analysis

Associated Namespace: HexagonGeospatial.FeatureAnalysis.SummarizeRelatedFeatures

Default

Show All Ports

SummarizeRelatedFeaturesDefault

SummarizeRelatedFeaturesAll

Description

This operator relates one set of features (the detail features) to another set of features (the summary features) based on spatial relationships and/or attribute matches, summarizing data from the detail features onto the summary features via functional attributes.

The summary features are provided through the FeaturesIn port, and the detail features are provided through the DetailFeatures port.

The input features may be nongraphic (no primary geometry field), or may have point, line, area, or vector geometry fields.

If the primary geometry fields of the two sets of input features have different CRS's, then DetailFeatures are automatically transformed to match FeaturesIn.

All geometry types are supported including arcs, composites, collections, and boundaries with holes. Z values are retained and used as appropriate.

This is a global sink operator, as it must evaluate all features and relate them before the first output can be produced.

This is a two-step operation, involving first the relating of detail features to summary features, then second the creation of new attributes on the summary features. features.

Step 1: Relating

The summary features given through the FeaturesIn port are compared with the detail features given through the DetailFeatures port, for matches in each of the identified attribute pairs (if any), and/or a spatial relationship between the pair of primary geometry fields. There is a logical “and” among all of these association criteria. SpatialRelationship must be set to something other than None, or MatchAttributeNames set to have at least one pair, otherwise an error is thrown.

Null values are considered not equal to one another whether found in attributes or geometry fields. Features with null values for any of the match attributes or the primary geometry field are never related to other features.

The result is zero, one, or more detail features related to each summary feature. Not every detail feature may be related to a summary feature. In the event that a detail feature is related to more than one summary feature, the AssignmentMode port determines how the detail feature is assigned (to none, to all, to the first, etc.).

Step 2: Summarizing

The set of detail features related to a specific summary feature (if any), are summarized onto the summary feature. The result is one or more new fields on the summary features. The new fields are defined by the SummaryAttribute ports, which summarize the data of the related detail features using expressions. The original schema of the summary features found on the FeaturesIn port is otherwise unchanged, as is the primary key.

Some expression functions that are useful in summarizing data:

  • It is common for one summary attribute to count the number of related detail features, using an expression of the form “COUNT(*)”.
  • It is also common to compute summary statistics on numeric attributes of related detail features (for example SUM or AVERAGE).
  • The geometries of detail features can be summarized, for example by calculating the total perimeter of a set of areas.
  • The minimum distance between each related summary/detail feature pair is available through a special DISTANCE expression function.

Example Usage

To find the single nearest grocery (detail) for each house (summary):

  • SpatialRelationship = Accumulate Nearest
  • MatchAttributeNames = <None>
  • AssignmentMode = First

Then compute summary attributes using expressions such as:

  • FIRST(DetailFeatures.StoreName) can be used to get the name of the nearest grocery
  • FORMATMEAS(DISTANCE(FeaturesIn.Geometry, FIRST(DetailFeatures.Geometry)), FormatType.Distance, Mile, 2) can be used to get the distance of the nearest grocery in miles to 2 decimal places

To assign every house (detail) to its nearest grocery (summary):

  • SpatialRelationship = Nearest To
  • MatchAttributeNames = <None>
  • AssignmentMode = All

Then compute summary attributes using expressions such as:

  • COUNT(*) can be used to count the number of houses which are closest to each grocery
  • FIRST(DetailFeatures.CustomerName) can be used to get the name of the nearest of the customers for whom each grocery is the closest
  • CONCATENATE(“,”,DetailFeatures.CustomerName) can be used to obtain a comma-separated list of the names of customers which are closest to each grocery
  • AVERAGE(FORMATMEAS(DISTANCE(FeaturesIn.Geometry, FIRST(DetailFeatures.Geometry)), FormatType.Distance, Mile, 2)) can be used to get the average distance to the houses nearest the grocery, in miles to 2 decimal places

Result Diagrams - Relating Process

The following diagrams present summary and details features for various scenarios of area, line, and point geometries; as well as relating based on attribute matches and spatial relationship. In each pair of diagrams the lefthand diagram is of the input data and the righthand diagram is of the result. Result features are presented as collections in order to display every applicable feature. Only a small sampling of the possibilities is presented here, as the number of combinations of input types, spatial relationship types, attribute matching, etc. is very large. The samples chosen include use of all geometry field types (point, line, area), an attribute match, one conventional spatial relationship, and several spatial relationships unique to this operator.

In the legend for each righthand picture, note the extra entry at the top representing the results. The title for that legend entry consists of the spatial relationship, attribute relationship, and assignment mode, in that order.

Relate detail points to the input areas that contain them

AreasContainPointsAllNoMatch_Input AreasContainPointsAllNoMatch

Relate detail points to their nearest input lines, with attribute match

PointsNearestToLinesAttrMatch_Input PointsNearestToLinesAttrMatch

Relate detail points to the input points that they are within a specified distance of

WithinDistanceAllNoAttrMatch_Input WithinDistanceAllNoAttrMatch

Relate detail points to their nearest input points

NearestToNoAttrMatch AccumulateNearestNoAttrMatch

Relate detail points to the input points for which they are the nearest detail point

NonGraphicFeaturesIn NonGraphicDetailFeatures NonGraphicAggregationResults

Result Diagrams - Assignment Mode

The following diagrams present the influence of the AssignmentMode port for cases in which a detail feature is related to multiple summary features. The first diagram (purple colors) represents input data for FeaturesIn (the larger, lighter areas labeled A-D) and DetailFeatures (the smaller, darker filled boxes). The subsequent six diagrams (red boxes) represent the results for this case with the 6 different settings for AssignmentMode. See the title of the red legend entry in each diagram to see the mode value. First row L-R: All, None, First. Second row L-R: Nearest, Largest, Largest Overlap.

ResolutionInput.PNG

ResolutionAll ResolutionNone Graphics\SGI\Imagine\Solution Builder

ResolutionNearest ResolutionLargest ResolutionLargestOverlap

Limitations

When determining the spatial relationship between summary and detail features, the operator always operates on the primary geometry field of both FeaturesIn and DetailFeatures.

Connections

Inputs

Name

Objects Supported

Description

Shown by Default

Required

Default Value or Behavior (must xist if not Required, may exist otherwise)

FeaturesIn

IMAGINE.Features

Input summary features which will be related to detail features and will be output from the operator with additional summary fields.

checkmark_gray

checkmark_gray

DetailFeatures

IMAGINE.Features

Detail features which will be related to summary features and whose data will be summarized as new fields on the summary features.

checkmark_gray

checkmark_gray

SpatialRelationship

IMAGINE.String

If set to None, indicates that a spatial relationship between summary and detail features is not to be considered in relating features.

Otherwise, defines the spatial relationship between the primary geometry fields of two sets of features. The operator is used in the context: <summary feature> <spatial relationship> <detail feature>; e.g. counties contain schools. Allowable values are:

  • None
  • Touch
  • Meet
  • Overlap
  • Contain
  • Contained By
  • Entirely Contain
  • Entirely Contained By
  • Spatially Equal
  • Within Distance Of
  • Nearest To
  • Accumulate Nearest

The last three are proximity-based relationships unique to this operator and warrant further explanation:

  • Within Distance Of relates all detail features within a specified distance of a summary feature, to that summary feature. It is achieved through a buffer zone on the summary features, and implicitly uses the Touch spatial relationship with those buffer zones.
  • Nearest To relates each detail feature to the one summary feature nearest it, as if each summary feature were attracting all features with an equal gravitational pull. Each detail feature is related to exactly one summary feature, and any given summary feature may be related to zero, one, or many detail features. The detailed features related to a summary feature are sorted in order from nearest to farthest.
  • Accumulate Nearest relates each summary feature to the one detail feature nearest it, like a nearest-neighbor search. Each summary feature is related to exactly one detail feature, and any given detail feature may be related to zero, one, or many summary features.

checkmark_gray

None.

Distance

IMAGINE.Double

A linear distance value to be used for the Within Distance Of spatial relationship.

Required if SpatialRelationship is set to Within Distance Of, ignored if SpatialRelationship is set to any other option.

If the distance value is greater than zero, then the spatial relationship is evaluated as if the geometries of the summary features were buffered at the distance given.

If the value is null, zero, or less than zero, then it is as if no buffer is generated and the geometries must actually touch.

The value is assumed to be a True distance, rather than a Projected distance. The buffer zones are generated in the context of an equidistant projection with the projection origin set to the centroid of the MBR of the geometry in order to minimize distortion.

checkmark_gray

0.0

DistanceUnits

IMAGINE.String

Unit of measure for the Distance port. Allowable values are:

  • Chain
  • Centimeter
  • Foot
  • Furlong
  • Hundredth
  • Inch
  • Kilofoot
  • Kilometer
  • Link
  • Meter
  • Mile
  • Millimeter
  • Nanometer
  • NauticalMile
  • Point
  • Pole
  • Rod
  • SurveyFoot
  • SurveyInch
  • SurveyKilofoot
  • Tenth
  • Thousandth
  • Yard

checkmark_gray

Default value is the HorizontalUnits from the Coordinate Reference System (CRS) of the primary geometry field of FeaturesIn. If this unit is non-linear, Meter is used. If the unit is undefined, no conversion is performed.

MatchAttributeNames

IMAGINE.String

IMAGINE.StringList

Identifies one or more pairs of attributes, one each from the summary and detail features, to be used in relating features.

The syntax for specifying a match of two attributes is:

"<summary attribute name>"="<detail attribute name>"

For example:

"PP_ID=PolicePrecinct"

If populated with a single String then summary and detail features are to be related based on matching values in those attributes.

If populated with a StringList having multiple such strings then summary and detail features are to be related based on matching values in each pair of those attributes, with a logical "and" between them. Order in the list is not important.

Only attributes of the following types are supported. If the name of an attribute of any other type is provided, then an error is generated.

  • Boolean
  • String
  • Byte
  • SByte
  • Int16
  • Uint16
  • Int32
  • UInt32
  • Int64
  • UInt64
  • Single
  • Double
  • Decimal
  • Currency
  • DateTime
  • GUID

If a given attribute name does not exist, then an error is generated.

checkmark_gray

AssignmentMode

IMAGINE.String

Used to indicate how to resolve the ambiguous case in which a detail feature is related to more than one summary feature. Allowable values are:

  • All. The detail feature is assigned to all of the related summary features.
  • None. The detail feature is assigned to none of the related summary features.
  • First. The detail feature is assigned to the first of the related summary features. This is essentially an arbitrary assignment, but it ensures that the detail feature is assigned to precisely one summary feature.
  • Largest. The detail feature is assigned to the largest/longest of the related summary features. This is not applicable when summary features are points.
  • Largest Overlap. The detail feature is assigned to the related summary feature with which it shares the largest overlap. This is not applicable when either the summary features or detail features are points.
  • Nearest. The detail feature is assigned to the nearest of the related summary features.

In all cases in which a tie is possible, as can occur with Largest, Largest Overlap, and Nearest, then the fallback mode is First.

The modes of Largest and Largest Overlap cannot be applied to point features. If this port is set to Largest and the summary features are points; or if this port is set to Largest Overlap and the summary or detail features are points. then the mode reverts to First and a Warning is given.

checkmark_gray

All

SummaryAttribute1

SummaryAttribute<N>

IMAGINE.FunctionalAttribute

Definition of a functional attribute which summarizes data from the detail features related to a summary feature. This port is repeating, so that multiple functional attributes can be defined. At least one is required.

checkmark_gray

checkmark_gray

Outputs

Name

DataType(s)

Description

Shown by Default

FeaturesOut

IMAGINE.Features

Output features composed of the original schema and membership of FeaturesIn, with additional fields as defined by the one or more SummaryAttribute# ports, providing summary information for those detail features related to each summary feature.

checkmark_gray

Related Operators