Class ClusteringFeatureReduction
- All Implemented Interfaces:
PopupSource
FeatureLayer
or point graphics in a
GraphicsOverlay
in dynamic rendering mode (FeatureLayer.RenderingMode.DYNAMIC
, or
GraphicsOverlay.RenderingMode.DYNAMIC
).
Clustering is configured via the FeatureLayer.featureReductionProperty()
property of the FeatureLayer
or the GraphicsOverlay.featureReductionProperty()
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 case of FeatureLayer
,
a 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 minSymbolSizeProperty()
and maxSymbolSizeProperty()
properties.
At present, this API does not support configuring cluster symbol size from another AggregateField
.
- Since:
- 200.2.0
-
Property Summary
TypePropertyDescriptionThe symbol size of the largest cluster in device-independent pixels.The symbol size of the smallest cluster in device-independent pixels.The radius in device-independent pixels of the area in which multiple points will be grouped and visualized as a single cluster.Properties inherited from class com.esri.arcgisruntime.mapping.reduction.AggregationFeatureReduction
maxScale, renderer, showLabels
Properties inherited from class com.esri.arcgisruntime.mapping.reduction.FeatureReduction
enabled
-
Field Summary
Fields inherited from class com.esri.arcgisruntime.mapping.reduction.AggregationFeatureReduction
mRenderer
-
Constructor Summary
ConstructorDescriptionClusteringFeatureReduction
(Renderer renderer) Creates a ClusteringFeatureReduction object using the given renderer and default values for min size, max size and radius of the cluster. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the value of themaxSymbolSize
property.double
Gets the value of theminSymbolSize
property.double
Gets the value of theradius
property.The symbol size of the largest cluster in device-independent pixels.The symbol size of the smallest cluster in device-independent pixels.The radius in device-independent pixels of the area in which multiple points will be grouped and visualized as a single cluster.void
setMaxSymbolSize
(double maxSymbolSize) Sets the value of themaxSymbolSize
property.void
setMinSymbolSize
(double minSymbolSize) Sets the value of theminSymbolSize
property.void
setRadius
(double radius) Sets the value of theradius
property.Methods inherited from class com.esri.arcgisruntime.mapping.reduction.AggregationFeatureReduction
getAggregateFields, getLabelDefinitions, getMaxScale, getPopupDefinition, getRenderer, isPopupEnabled, isShowLabels, maxScaleProperty, rendererProperty, setMaxScale, setPopupDefinition, setPopupEnabled, setRenderer, setShowLabels, showLabelsProperty
Methods inherited from class com.esri.arcgisruntime.mapping.reduction.FeatureReduction
enabledProperty, isEnabled, setEnabled
-
Property Details
-
maxSymbolSize
The symbol size of the largest cluster in device-independent pixels. The default value is 70.The
ClusteringFeatureReduction#maxSymbolSizeProperty()
andradiusProperty()
complement each other. If you adjust one, you should adjust the other (a largerClusteringFeatureReduction.maxSymbolSizeProperty()
should have a largerClusteringFeatureReduction.radiusProperty()
). 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.The maxSymbolSize value must be a non-negative number.
- Since:
- 200.3.0
- See Also:
-
minSymbolSize
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.
The minSymbolSize value must be a non-negative number.
- Since:
- 200.3.0
- See Also:
-
radius
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
radiusProperty()
should be larger than themaxSymbolSizeProperty()
. Note: changing this property causes data to be re-clustered.The radius value must be a non-negative number.
- Since:
- 200.3.0
- See Also:
-
-
Constructor Details
-
ClusteringFeatureReduction
Creates a ClusteringFeatureReduction object using the given renderer and default values for min size, max size and radius of the cluster.Only
SimpleRenderer
,UniqueValueRenderer
, andClassBreaksRenderer
are currently supported forAggregationFeatureReduction.rendererProperty()
.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 theFeatureLayer
or original graphics from theGraphicsOverlay
are drawn usingFeatureLayer.getRenderer()
orGraphicsOverlay.getRenderer()
respectively. In case ofFeatureLayer
, aLayerViewState
that contains an error indicating the use of an unsupported renderer is bubbled up. Also note,AggregationFeatureReduction.rendererProperty()
is independent ofFeatureLayer.rendererProperty()
andGraphicsOverlay.rendererProperty()
.If you want to symbolize clusters using the same symbology used by the
FeatureLayer
orGraphicsOverlay
, you may cloneFeatureLayer.rendererProperty()
orGraphicsOverlay.rendererProperty()
and set it here. You can also create a new renderer of a supported type. If you create a newSimpleRenderer
, clusters will be drawn using the symbol defined for theSimpleRenderer
. If the new renderer is of typeClassBreaksRenderer
orUniqueValueRenderer
, the field name on the renderer must match one of theAggregateField
inAggregationFeatureReduction.getAggregateFields()
. If this field is not found inAggregationFeatureReduction.getAggregateFields()
, the cluster will be drawn usingClassBreaksRenderer.getDefaultSymbol()
orUniqueValueRenderer.getDefaultSymbol()
. If there is no default symbol defined, clusters will not be drawn.- Parameters:
renderer
- the renderer for drawing clustered geoelements- Throws:
NullPointerException
- if renderer is null- Since:
- 200.3.0
-
-
Method Details
-
maxSymbolSizeProperty
The symbol size of the largest cluster in device-independent pixels. The default value is 70.The
ClusteringFeatureReduction#maxSymbolSizeProperty()
andradiusProperty()
complement each other. If you adjust one, you should adjust the other (a largerClusteringFeatureReduction.maxSymbolSizeProperty()
should have a largerClusteringFeatureReduction.radiusProperty()
). 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.The maxSymbolSize value must be a non-negative number.
- Returns:
- the
maxSymbolSize
property - Since:
- 200.3.0
- See Also:
-
getMaxSymbolSize
public double getMaxSymbolSize()Gets the value of themaxSymbolSize
property.- Property description:
- The symbol size of the largest cluster in device-independent pixels. The default value is 70.
The
ClusteringFeatureReduction#maxSymbolSizeProperty()
andradiusProperty()
complement each other. If you adjust one, you should adjust the other (a largerClusteringFeatureReduction.maxSymbolSizeProperty()
should have a largerClusteringFeatureReduction.radiusProperty()
). 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.The maxSymbolSize value must be a non-negative number.
- Returns:
- the value of the
maxSymbolSize
property - Since:
- 200.3.0
- See Also:
-
setMaxSymbolSize
public void setMaxSymbolSize(double maxSymbolSize) Sets the value of themaxSymbolSize
property.- Property description:
- The symbol size of the largest cluster in device-independent pixels. The default value is 70.
The
ClusteringFeatureReduction#maxSymbolSizeProperty()
andradiusProperty()
complement each other. If you adjust one, you should adjust the other (a largerClusteringFeatureReduction.maxSymbolSizeProperty()
should have a largerClusteringFeatureReduction.radiusProperty()
). 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.The maxSymbolSize value must be a non-negative number.
- Parameters:
maxSymbolSize
- the value for themaxSymbolSize
property- Since:
- 200.3.0
- See Also:
-
minSymbolSizeProperty
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.
The minSymbolSize value must be a non-negative number.
- Returns:
- the
minSymbolSize
property - Since:
- 200.3.0
- See Also:
-
getMinSymbolSize
public double getMinSymbolSize()Gets the value of theminSymbolSize
property.- Property description:
- 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.
The minSymbolSize value must be a non-negative number.
- Returns:
- the value of the
minSymbolSize
property - Since:
- 200.3.0
- See Also:
-
setMinSymbolSize
public void setMinSymbolSize(double minSymbolSize) Sets the value of theminSymbolSize
property.- Property description:
- 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.
The minSymbolSize value must be a non-negative number.
- Parameters:
minSymbolSize
- the value for theminSymbolSize
property- Since:
- 200.3.0
- See Also:
-
radiusProperty
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
radiusProperty()
should be larger than themaxSymbolSizeProperty()
. Note: changing this property causes data to be re-clustered.The radius value must be a non-negative number.
- Returns:
- the
radius
property - Since:
- 200.3.0
- See Also:
-
getRadius
public double getRadius()Gets the value of theradius
property.- Property description:
- 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
radiusProperty()
should be larger than themaxSymbolSizeProperty()
. Note: changing this property causes data to be re-clustered.The radius value must be a non-negative number.
- Returns:
- the value of the
radius
property - Since:
- 200.3.0
- See Also:
-
setRadius
public void setRadius(double radius) Sets the value of theradius
property.- Property description:
- 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
radiusProperty()
should be larger than themaxSymbolSizeProperty()
. Note: changing this property causes data to be re-clustered.The radius value must be a non-negative number.
- Parameters:
radius
- the value for theradius
property- Since:
- 200.3.0
- See Also:
-