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
PropertiesTypePropertyDescriptionThe 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, showLabelsProperties 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
ConstructorsConstructorDescriptionClusteringFeatureReduction(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 TypeMethodDescriptiondoubleGets the value of themaxSymbolSizeproperty.doubleGets the value of theminSymbolSizeproperty.doubleGets the value of theradiusproperty.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.voidsetMaxSymbolSize(double maxSymbolSize) Sets the value of themaxSymbolSizeproperty.voidsetMinSymbolSize(double minSymbolSize) Sets the value of theminSymbolSizeproperty.voidsetRadius(double radius) Sets the value of theradiusproperty.Methods inherited from class com.esri.arcgisruntime.mapping.reduction.AggregationFeatureReduction
getAggregateFields, getLabelDefinitions, getMaxScale, getPopupDefinition, getRenderer, isPopupEnabled, isShowLabels, maxScaleProperty, rendererProperty, setMaxScale, setPopupDefinition, setPopupEnabled, setRenderer, setShowLabels, showLabelsPropertyMethods 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, andClassBreaksRendererare currently supported forAggregationFeatureReduction.rendererProperty().UniqueValueRendererwith multiple fields is not supported. If the renderer passed is not one of the supported renderer types listed above, then original features from theFeatureLayeror original graphics from theGraphicsOverlayare drawn usingFeatureLayer.getRenderer()orGraphicsOverlay.getRenderer()respectively. In case ofFeatureLayer, aLayerViewStatethat 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
FeatureLayerorGraphicsOverlay, 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 typeClassBreaksRendererorUniqueValueRenderer, the field name on the renderer must match one of theAggregateFieldinAggregationFeatureReduction.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
maxSymbolSizeproperty - Since:
- 200.3.0
- See Also:
-
getMaxSymbolSize
public double getMaxSymbolSize()Gets the value of themaxSymbolSizeproperty.- 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
maxSymbolSizeproperty - Since:
- 200.3.0
- See Also:
-
setMaxSymbolSize
public void setMaxSymbolSize(double maxSymbolSize) Sets the value of themaxSymbolSizeproperty.- 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 themaxSymbolSizeproperty- 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
minSymbolSizeproperty - Since:
- 200.3.0
- See Also:
-
getMinSymbolSize
public double getMinSymbolSize()Gets the value of theminSymbolSizeproperty.- 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
minSymbolSizeproperty - Since:
- 200.3.0
- See Also:
-
setMinSymbolSize
public void setMinSymbolSize(double minSymbolSize) Sets the value of theminSymbolSizeproperty.- 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 theminSymbolSizeproperty- 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
radiusproperty - Since:
- 200.3.0
- See Also:
-
getRadius
public double getRadius()Gets the value of theradiusproperty.- 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
radiusproperty - Since:
- 200.3.0
- See Also:
-
setRadius
public void setRadius(double radius) Sets the value of theradiusproperty.- 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 theradiusproperty- Since:
- 200.3.0
- See Also:
-