Method for aggregating and summarizing features in a point FeatureLayer or point graphics in a GraphicsOverlay in dynamic rendering mode (FeatureRenderingMode::Dynamic, or GraphicsRenderingMode::Dynamic). More...
Header: | #include <ClusteringFeatureReduction.h> |
Since: | Esri::ArcGISRuntime 200.2 |
Inherits: | Esri::ArcGISRuntime::AggregationFeatureReduction |
Public Functions
ClusteringFeatureReduction(Esri::ArcGISRuntime::Renderer *renderer, QObject *parent = nullptr) | |
virtual | ~ClusteringFeatureReduction() override |
double | maxSymbolSize() const |
double | minSymbolSize() const |
double | radius() const |
void | setMaxSymbolSize(double maxSymbolSize) |
void | setMinSymbolSize(double minSymbolSize) |
void | setRadius(double radius) |
Detailed Description
Clustering is configured via the FeatureLayer::featureReduction property of the FeatureLayer or the GraphicsOverlay::featureReduction} of the 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 the case of the FeatureLayer, a LayerViewState is bubbled up indicating the appropriate error. The symbol for the cluster is determined by the renderer passed to the ClusteringFeatureReduction and the cluster symbol is determined by the ClusteringFeatureReduction::minSymbolSize and ClusteringFeatureReduction::maxSymbolSize properties.
At present, this API does not support configuring cluster symbol size from another AggregateField.
Relevant samples:
- Configure clusters: Add client side feature reduction on a point feature layer that is not pre-configured with clustering.
Member Function Documentation
[explicit, since Esri::ArcGISRuntime 200.3]
ClusteringFeatureReduction::ClusteringFeatureReduction (Esri::ArcGISRuntime::Renderer *renderer, QObject *parent = nullptr)
Creates a ClusteringFeatureReduction object using the given renderer and default values for min size, max size and radius of the cluster.
- renderer - The renderer for drawing clustered geoelements.
- parent - The optional parent QObject.
Only SimpleRenderer, UniqueValueRenderer, and ClassBreaksRenderer are currently supported for AggregationFeatureReduction::renderer. 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 FeatureLayer or original graphics from the GraphicsOverlay are drawn using FeatureLayer::renderer or {Esri::ArcGISRuntime::GraphicsOverlay::renderer} {GraphicsOverlay::renderer} respectively.
In case of FeatureLayer, a {Esri::ArcGISRuntime::LayerViewState} {LayerViewState} that contains an error indicating the use of an unsupported renderer is bubbled up. Also note, AggregationFeatureReduction::renderer is independent of FeatureLayer::renderer and GraphicsOverlay::renderer
If you want to symbolize clusters using the same symbology used by the FeatureLayer or GraphicsOverlay, you may clone FeatureLayer::renderer or GraphicsOverlay::renderer and set it here. You can also create a new renderer of a supported type.
If you create a new SimpleRenderer, clusters will be drawn using the symbol defined for the SimpleRenderer.
If the new renderer is of type ClassBreaksRenderer or UniqueValueRenderer, the field name on the renderer must match one of the AggregateField in AggregationFeatureReduction::aggregateFields.
If this field is not found in AggregationFeatureReduction::aggregateFields, the cluster will be drawn using ClassBreaksRenderer::defaultSymbol or UniqueValueRenderer::defaultSymbol. If there is no default symbol defined, clusters will not be drawn.
This function was introduced in Esri::ArcGISRuntime 200.3.
[override virtual]
ClusteringFeatureReduction::~ClusteringFeatureReduction ()
Destructor.
[since Esri::ArcGISRuntime 200.3]
double ClusteringFeatureReduction::maxSymbolSize () const
Returns the symbol size of the largest cluster in device-independent pixels. The default value is 70.
The maxSymbolSize and radius complement each other. If you adjust one, you should adjust the other (a larger maxSymbolSize should have a larger 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.
This function was introduced in Esri::ArcGISRuntime 200.3.
See also setMaxSymbolSize().
[since Esri::ArcGISRuntime 200.3]
double ClusteringFeatureReduction::minSymbolSize () const
Returns 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.
This function was introduced in Esri::ArcGISRuntime 200.3.
See also setMinSymbolSize().
[since Esri::ArcGISRuntime 200.3]
double ClusteringFeatureReduction::radius() const
Returns 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 radius should be larger than the maxSymbolSize.
Note: changing this property causes data to be re-clustered.
This function was introduced in Esri::ArcGISRuntime 200.3.
See also setRadius().
[since Esri::ArcGISRuntime 200.3]
void ClusteringFeatureReduction::setMaxSymbolSize (double maxSymbolSize )
Sets the maxSymbolSize to maxSymbolSize.
This function was introduced in Esri::ArcGISRuntime 200.3.
See also maxSymbolSize.
[since Esri::ArcGISRuntime 200.3]
void ClusteringFeatureReduction::setMinSymbolSize (double minSymbolSize )
Sets the minSymbolSize to minSymbolSize.
This function was introduced in Esri::ArcGISRuntime 200.3.
See also minSymbolSize.
[since Esri::ArcGISRuntime 200.3]
void ClusteringFeatureReduction::setRadius (double radius)
Sets the radius to radius.
This function was introduced in Esri::ArcGISRuntime 200.3.
See also radius.