ClusteringFeatureReduction

Method for aggregating and summarizing features in a point com.arcgismaps.mapping.layers.FeatureLayer or point graphics in a com.arcgismaps.mapping.view.GraphicsOverlay in dynamic rendering mode (com.arcgismaps.mapping.layers.FeatureRenderingMode.Dynamic, or com.arcgismaps.mapping.view.GraphicsRenderingMode.Dynamic). Clustering is configured via the com.arcgismaps.mapping.layers.FeatureLayer.featureReduction property of the com.arcgismaps.mapping.layers.FeatureLayer or the com.arcgismaps.mapping.view.GraphicsOverlay.featureReduction of the com.arcgismaps.mapping.view.GraphicsOverlay.

Feature clustering allows you to visually represent large numbers of point geoelements in relatively small areas by aggregating them into clusters. Each cluster of two or more points is represented with an AggregateGeoElement that has its own symbol. If a point feature is not clustered, it continues to draw as an individual feature using the layer's renderer. As a user navigates the map, clusters update dynamically depending on the map's scale and extent. Feature clustering only applies to layers with point geometries in a 2D map. It does not apply to layers with polyline and polygon geometries and is not supported in 3D. In such unsupported scenarios, the original features or graphics are drawn. In case of com.arcgismaps.mapping.layers.FeatureLayer, a com.arcgismaps.mapping.view.LayerViewState is bubbled up indicating the appropriate error. The symbol for the cluster is determined by the renderer passed to ClusteringFeatureReduction and cluster symbol size is determined by the ClusteringFeatureReduction.minSymbolSize and ClusteringFeatureReduction.maxSymbolSize properties. At present, this API does not support configuring cluster symbol size from another AggregateField.

Since

200.2.0

Constructors

Link copied to clipboard
constructor(renderer: Renderer)

Creates a ClusteringFeatureReduction object using the given renderer and default values for min size, max size and radius of the cluster. Only com.arcgismaps.mapping.symbology.SimpleRenderer, com.arcgismaps.mapping.symbology.UniqueValueRenderer, and com.arcgismaps.mapping.symbology.ClassBreaksRenderer are currently supported for AggregationFeatureReduction.renderer. com.arcgismaps.mapping.symbology.UniqueValueRenderer with multiple fields is not supported. If the renderer passed is not one of the supported renderer types listed above, then original features from the com.arcgismaps.mapping.layers.FeatureLayer or original graphics from the com.arcgismaps.mapping.view.GraphicsOverlay are drawn using com.arcgismaps.mapping.layers.FeatureLayer.renderer or com.arcgismaps.mapping.view.GraphicsOverlay.renderer respectively. In case of com.arcgismaps.mapping.layers.FeatureLayer, a com.arcgismaps.mapping.view.LayerViewState that contains an error indicating the use of an unsupported renderer is bubbled up. Also note, AggregationFeatureReduction.renderer is independent of com.arcgismaps.mapping.layers.FeatureLayer.renderer and com.arcgismaps.mapping.view.GraphicsOverlay.renderer.

Properties

Link copied to clipboard

The symbol size of the largest cluster in device-independent pixels. The default value is 70. The ClusteringFeatureReduction.maxSymbolSize and ClusteringFeatureReduction.radius complement each other. If you adjust one, you should adjust the other (a larger ClusteringFeatureReduction.maxSymbolSize should have a larger ClusteringFeatureReduction.radius). Note, if a custom renderer is defined for clusters and that renderer contains size visual variables, this property is ignored and cluster sizes are determined using the cluster renderer's size variable. Note: Changing this property causes data to be re-clustered.

Link copied to clipboard

The symbol size of the smallest cluster in device-independent pixels. The default value is 12. If a custom renderer is defined for the clusters, and that renderer contains size visual variables, this property is ignored and cluster sizes are determined using the cluster renderer's size variable. Note: changing this property causes data to be re-clustered.

Link copied to clipboard

The radius in device-independent pixels of the area in which multiple points will be grouped and visualized as a single cluster. The default value is 60. If you don't want cluster graphics to overlap, the ClusteringFeatureReduction.radius should be larger than the ClusteringFeatureReduction.maxSymbolSize. Note: changing this property causes data to be re-clustered.

Inherited properties

Link copied to clipboard

An array of AggregateField that summarizes one or more attributes for a group of geoelements visualized with FeatureReduction. AggregationFeatureReduction.aggregateFields define the attributes of an AggregateGeoElement. Each AggregateField stores a value that is generated by aggregating values from a field referenced in the feature layer. These aggregate fields may be used in popups, labels, and renderers. Note that aggregated geoelements only have access to the AggregationFeatureReduction.aggregateFields defined. The fields from the feature layer are not accessible for use in popups, labels, or renderers for aggregated geoelements. For example, to display the sum of the population values in a cluster of features, you can create an aggregate field called 'sum_population' using the 'population' attribute of the com.arcgismaps.mapping.layers.FeatureLayer. You can then use the 'sum_population' attribute as a label for the AggregateGeoElement, but not the original 'population' attribute from the feature layer. See AggregateField for more info. Note: Updates to this collection cause data to be re-aggregated.

Link copied to clipboard

True to enable feature reduction, false to show individual geoelements. The default value is true. Changing this property from false to true may cause data to be re-calculated.

Link copied to clipboard
open override var isPopupEnabled: Boolean

A flag indicating whether the PopupDefinition defined on the PopupSource is enable / disable. Will return false if an error occurs.

Link copied to clipboard

The collection of com.arcgismaps.mapping.labeling.LabelDefinition objects that define label display for the summarized attribute values of aggregated geoelements. Label expressions can only refer to the fields defined in AggregationFeatureReduction.aggregateFields. Feature layer fields are not accessible to aggregated geoelements. AggregationFeatureReduction.labelDefinitions is independent of com.arcgismaps.mapping.layers.FeatureLayer.labelDefinitions and com.arcgismaps.mapping.view.GraphicsOverlay.labelDefinitions. Labels on aggregated geoelements will only appear if there is at least one com.arcgismaps.mapping.labeling.LabelDefinition defined.

Link copied to clipboard

The map scale at which aggregation is enabled. Geoelements are not aggregated when the map scale goes beyond the maximum scale. The default value is 0, which means aggregation is applied at all map scales. Note: changing this property causes data to be re-aggregated.

Link copied to clipboard
open override var popupDefinition: PopupDefinition?

The pop-up definition. The PopupDefinition associated with the popup source. A null if an error occurs or if the popup source is not associated with a pop-up definition.

Link copied to clipboard

Defines the symbology for displaying aggregated geoelements. Only com.arcgismaps.mapping.symbology.SimpleRenderer, com.arcgismaps.mapping.symbology.UniqueValueRenderer, and com.arcgismaps.mapping.symbology.ClassBreaksRenderer are currently supported for AggregationFeatureReduction.renderer. com.arcgismaps.mapping.symbology.UniqueValueRenderer with multiple fields is not supported. If the renderer passed is not one of the supported renderer types listed above then original features from the com.arcgismaps.mapping.layers.FeatureLayer or original graphics from the com.arcgismaps.mapping.view.GraphicsOverlay are drawn using com.arcgismaps.mapping.layers.FeatureLayer.renderer or com.arcgismaps.mapping.view.GraphicsOverlay.renderer respectively. In the case of com.arcgismaps.mapping.layers.FeatureLayer, a com.arcgismaps.mapping.view.LayerViewState that contains an error indicating the use of an unsupported renderer is bubbled up. Also, note that AggregationFeatureReduction.renderer is independent of com.arcgismaps.mapping.layers.FeatureLayer.renderer and com.arcgismaps.mapping.view.GraphicsOverlay.renderer.

Link copied to clipboard

True to display labels for aggregated geoelements, false to turn them off. The default value is true.