MapLink Pro .NET 11.1
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
Track Aggregation

Track Aggregation provides a method of reducing the amount of tracks on the display based on static or dynamic rules. This is similar to the 'decluttering' concepts used elsewhere in MapLink however the rules for aggregation are evaluated at draw-time, allowing for more dynamic functionality.

This is provided through the Track Aggregator class.

Aggregated tracks displayed on a map, at various zoom levels

Track Groups

A Track Group provides the ability to create a conceptual hierarchy of tracks which represents real-world structures. This class also provides the ability to assign a visualisation to the group in the same manner as tracks. This class is used by track aggregators to provide both:

  • A hierarchy of tracks, if required by the aggregator
  • The visualisation to use for a group of tracks

Aggregator Configuration

Each aggregator implementation can use different parameters to declutter the tracks. These may include:

  • The resolution/zoom level of the drawing surface at the time tracks are drawn
  • A hierarchy of tracks/track groups specified by the application
  • Whether tracks are positioned close to each other on the display
  • Attributes from the tracks
  • Other information required for the aggregator's algorithm

These parameters will change based on the implementation of the aggregator, however will typically involve a set of aggregator 'rules', which are primarily indexed based on the drawing surface zoom level.

This example demonstrates the basic setup of echelon-based aggregation. This is used to perform track aggregation based on the real-world relationship between the tracks.

// This aggregator requires that each track has a defined 'type' attribute
// in order to group the tracks together on the display. This custom attribute
// may be setup using TSLNTrackBase.addAttribute and TSLNTrackBase.setAttributeValue
// The track manager has been setup to contain 4 tracks:
// - Track 1: type == "person"
// - Track 2: type == "person"
// - Track 3: type == "car"
// - Track 4: type == "aircraft"
// Create the aggregator
// This aggregator will use the 'type' attribute from the tracks
// to perform aggregation.
TSLNTrackAggregatorDensity agg = new TSLNTrackAggregatorDensity("type");
// Assign the aggregator to the tracks
// In this case we only need to add the aggregator to tracks 1 & 2
// however the aggregator may also be assigned to every track
// If there is no aggregator rule which matches the specified tracks
// then the tracks will be drawn as normal.
track1.aggregator(agg);
track2.aggregator(agg);
// Setup a TSLTrackGroup, which specifies how a group of "person"
// tracks should be displayed.
// For the density aggregator the group does not need to have any
// children.
TSLNTrackGroup personGroup = TSLNTrackGroup.create();
setupRenderingForPersonGroup(personGroup);
// Setup a rule for the aggregator
// - This rule will be activated when the display resolution (Map Units per Pixel)
// is above the threshold
// - This rule will use a 10 x 10 grid as part of the calculation
// - This rule will only activate for tracks with type == "person"
//
// If 2 or more tracks with type == "person" are drawn within the same grid cell, and the
// display has been zoomed out far enough to activate the rule, then
// the personGroup will be displayed instead of the individual tracks.
TSLNTrackAggregatorDensity::ZoomLevel zoomLevel = agg.addZoomLevel(100.0, 10, 10);
zoomLevel.addRule( new TSLNTrackAggregatorDensity::AggregationRule("person", 2, personGroup) );

Interaction with track graphics

When used in conjunction with Track Graphics any track which is used as a control point for a graphic will be excluded from aggregation.

This means that the aggregated track group will be displayed, in addition to the track itself in this situation.