Class AggregationFeatureReduction
- All Implemented Interfaces:
PopupSource
- Direct Known Subclasses:
ClusteringFeatureReduction
Feature reduction dynamically aggregates groups of points that are within proximity of each other in order to
represent each group with a single symbol. Such grouping allows you to see patterns in the data that are difficult
to visualize when a layer contains hundreds or thousands of points that overlap and cover each other.
The count of geoelements in each group can be displayed, and numeric attribute values can also be summarized
within each group.
Note, properties defined for AggregationFeatureReduction are independent of properties of
FeatureLayer and GraphicsOverlay.
FeatureReduction is not supported in 3D.
- Since:
- 200.2.0
-
Property Summary
PropertiesTypePropertyDescriptionThe map scale at which aggregation is enabled.Defines the symbology for displaying aggregated geoelements.True to display labels for aggregated geoelements, false to turn them off.Properties inherited from class com.esri.arcgisruntime.mapping.reduction.FeatureReduction
enabled -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGets the collection ofAggregateFieldthat summarizes one or more attributes for a group of geoelements visualized withFeatureReduction.Gets the collection ofLabelDefinitionobjects that define label display for the summarized attribute values of aggregated geoelements.doubleGets the value of themaxScaleproperty.Gets the PopupDefinition that is currently defined or set on the entity.Gets the value of therendererproperty.booleanChecks if the pop-up definition returned fromPopupSource.getPopupDefinition()is enabled or disabled.booleanGets the value of theshowLabelsproperty.The map scale at which aggregation is enabled.Defines the symbology for displaying aggregated geoelements.voidsetMaxScale(double maxScale) Sets the value of themaxScaleproperty.voidsetPopupDefinition(PopupDefinition popupDefinition) Sets a new PopupDefinition on the entity, overriding any previously existing one.voidsetPopupEnabled(boolean enabled) Sets whether the pop-up definition returned fromPopupSource.getPopupDefinition()is enabled or disabled.voidsetRenderer(Renderer renderer) Sets the value of therendererproperty.voidsetShowLabels(boolean showLabels) Sets the value of theshowLabelsproperty.True to display labels for aggregated geoelements, false to turn them off.Methods inherited from class com.esri.arcgisruntime.mapping.reduction.FeatureReduction
enabledProperty, isEnabled, setEnabled
-
Property Details
-
maxScale
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.
The maxScale value must be a non-negative number.
- Since:
- 200.3.0
- See Also:
-
renderer
Defines the symbology for displaying aggregated geoelements.Only
SimpleRenderer,UniqueValueRenderer, andClassBreaksRendererare currently supported forrendererProperty().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 the case ofFeatureLayer, aLayerViewStatethat contains an error indicating the use of an unsupported renderer is bubbled up. Also, note thatAggregationFeatureReduction.rendererProperty()is independent ofFeatureLayer.rendererProperty()andGraphicsOverlay.rendererProperty().If you want to symbolize aggregate geoelements using the same symbology used by the
FeatureLayerorGraphicsOverlay, you may calltoJson()onFeatureLayer.getRenderer()orGraphicsOverlay.getRenderer()and then create a new renderer withfromJson(). You can also create a new renderer of a supported type. If you create a newSimpleRenderer, aggregate geoelements will display with the symbol defined for theSimpleRenderer. orUniqueValueRenderer, the field name on the renderer must match one of theAggregateFieldingetAggregateFields(). If this field is not found inAggregationFeatureReduction.getAggregateFields(), aggregate geoelements will draw usingClassBreaksRenderer.getDefaultSymbol()orUniqueValueRenderer.getDefaultSymbol(). If there is no default symbol defined, aggregate geoelements will not draw.Note: Updating the renderer causes data to be re-aggregated.
Attempting to set the value to null will throw a NullPointerException exception.
- Since:
- 200.3.0
- See Also:
-
showLabels
True to display labels for aggregated geoelements, false to turn them off.The default value is true.
- Since:
- 200.3.0
- See Also:
-
-
Field Details
-
mRenderer
-
-
Method Details
-
getAggregateFields
Gets the collection ofAggregateFieldthat summarizes one or more attributes for a group of geoelements visualized withFeatureReduction.getAggregateFields()define the attributes of anAggregateGeoElement. EachAggregateFieldstores 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 theAggregationFeatureReduction.getAggregateFields()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 theFeatureLayer. You can then use the 'sum_population' attribute as a label for theAggregateGeoElement, but not the original 'population' attribute from the feature layer. SeeAggregateFieldfor more info. Note: Updates to this collection cause data to be re-aggregated.- Returns:
- the collection of
AggregateFieldthat summarizes one or more attributes for a group of geoelements visualized withFeatureReduction - Since:
- 200.3.0
-
getLabelDefinitions
Gets the collection ofLabelDefinitionobjects that define label display for the summarized attribute values of aggregated geoelements.Label expressions can only refer to the fields defined in
getAggregateFields(). Feature layer fields are not accessible to aggregated geoelements.getLabelDefinitions()is independent ofFeatureLayer.getLabelDefinitions()andGraphicsOverlay.getLabelDefinitions(). Labels on aggregated geoelements will only appear if there is at least oneLabelDefinitiondefined.- Returns:
- the collection of
LabelDefinitionobjects that define label display for the summarized attribute values of aggregated geoelements - Since:
- 200.3.0
-
maxScaleProperty
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.
The maxScale value must be a non-negative number.
- Returns:
- the
maxScaleproperty - Since:
- 200.3.0
- See Also:
-
getMaxScale
public double getMaxScale()Gets the value of themaxScaleproperty.- Property description:
- 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.
The maxScale value must be a non-negative number.
- Returns:
- the value of the
maxScaleproperty - Since:
- 200.3.0
- See Also:
-
setMaxScale
public void setMaxScale(double maxScale) Sets the value of themaxScaleproperty.- Property description:
- 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.
The maxScale value must be a non-negative number.
- Parameters:
maxScale- the value for themaxScaleproperty- Since:
- 200.3.0
- See Also:
-
rendererProperty
Defines the symbology for displaying aggregated geoelements.Only
SimpleRenderer,UniqueValueRenderer, andClassBreaksRendererare currently supported forrendererProperty().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 the case ofFeatureLayer, aLayerViewStatethat contains an error indicating the use of an unsupported renderer is bubbled up. Also, note thatAggregationFeatureReduction.rendererProperty()is independent ofFeatureLayer.rendererProperty()andGraphicsOverlay.rendererProperty().If you want to symbolize aggregate geoelements using the same symbology used by the
FeatureLayerorGraphicsOverlay, you may calltoJson()onFeatureLayer.getRenderer()orGraphicsOverlay.getRenderer()and then create a new renderer withfromJson(). You can also create a new renderer of a supported type. If you create a newSimpleRenderer, aggregate geoelements will display with the symbol defined for theSimpleRenderer. orUniqueValueRenderer, the field name on the renderer must match one of theAggregateFieldingetAggregateFields(). If this field is not found inAggregationFeatureReduction.getAggregateFields(), aggregate geoelements will draw usingClassBreaksRenderer.getDefaultSymbol()orUniqueValueRenderer.getDefaultSymbol(). If there is no default symbol defined, aggregate geoelements will not draw.Note: Updating the renderer causes data to be re-aggregated.
Attempting to set the value to null will throw a NullPointerException exception.
- Returns:
- the
rendererproperty - Since:
- 200.3.0
- See Also:
-
getRenderer
Gets the value of therendererproperty.- Property description:
- Defines the symbology for displaying aggregated geoelements.
Only
SimpleRenderer,UniqueValueRenderer, andClassBreaksRendererare currently supported forrendererProperty().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 the case ofFeatureLayer, aLayerViewStatethat contains an error indicating the use of an unsupported renderer is bubbled up. Also, note thatAggregationFeatureReduction.rendererProperty()is independent ofFeatureLayer.rendererProperty()andGraphicsOverlay.rendererProperty().If you want to symbolize aggregate geoelements using the same symbology used by the
FeatureLayerorGraphicsOverlay, you may calltoJson()onFeatureLayer.getRenderer()orGraphicsOverlay.getRenderer()and then create a new renderer withfromJson(). You can also create a new renderer of a supported type. If you create a newSimpleRenderer, aggregate geoelements will display with the symbol defined for theSimpleRenderer. orUniqueValueRenderer, the field name on the renderer must match one of theAggregateFieldingetAggregateFields(). If this field is not found inAggregationFeatureReduction.getAggregateFields(), aggregate geoelements will draw usingClassBreaksRenderer.getDefaultSymbol()orUniqueValueRenderer.getDefaultSymbol(). If there is no default symbol defined, aggregate geoelements will not draw.Note: Updating the renderer causes data to be re-aggregated.
Attempting to set the value to null will throw a NullPointerException exception.
- Returns:
- the value of the
rendererproperty - Since:
- 200.3.0
- See Also:
-
setRenderer
Sets the value of therendererproperty.- Property description:
- Defines the symbology for displaying aggregated geoelements.
Only
SimpleRenderer,UniqueValueRenderer, andClassBreaksRendererare currently supported forrendererProperty().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 the case ofFeatureLayer, aLayerViewStatethat contains an error indicating the use of an unsupported renderer is bubbled up. Also, note thatAggregationFeatureReduction.rendererProperty()is independent ofFeatureLayer.rendererProperty()andGraphicsOverlay.rendererProperty().If you want to symbolize aggregate geoelements using the same symbology used by the
FeatureLayerorGraphicsOverlay, you may calltoJson()onFeatureLayer.getRenderer()orGraphicsOverlay.getRenderer()and then create a new renderer withfromJson(). You can also create a new renderer of a supported type. If you create a newSimpleRenderer, aggregate geoelements will display with the symbol defined for theSimpleRenderer. orUniqueValueRenderer, the field name on the renderer must match one of theAggregateFieldingetAggregateFields(). If this field is not found inAggregationFeatureReduction.getAggregateFields(), aggregate geoelements will draw usingClassBreaksRenderer.getDefaultSymbol()orUniqueValueRenderer.getDefaultSymbol(). If there is no default symbol defined, aggregate geoelements will not draw.Note: Updating the renderer causes data to be re-aggregated.
Attempting to set the value to null will throw a NullPointerException exception.
- Parameters:
renderer- the value for therendererproperty- Since:
- 200.3.0
- See Also:
-
showLabelsProperty
True to display labels for aggregated geoelements, false to turn them off.The default value is true.
- Returns:
- the
showLabelsproperty - Since:
- 200.3.0
- See Also:
-
isShowLabels
public boolean isShowLabels()Gets the value of theshowLabelsproperty.- Property description:
- True to display labels for aggregated geoelements, false to turn them off.
The default value is true.
- Returns:
- the value of the
showLabelsproperty - Since:
- 200.3.0
- See Also:
-
setShowLabels
public void setShowLabels(boolean showLabels) Sets the value of theshowLabelsproperty.- Property description:
- True to display labels for aggregated geoelements, false to turn them off.
The default value is true.
- Parameters:
showLabels- the value for theshowLabelsproperty- Since:
- 200.3.0
- See Also:
-
isPopupEnabled
public boolean isPopupEnabled()Description copied from interface:PopupSourceChecks if the pop-up definition returned fromPopupSource.getPopupDefinition()is enabled or disabled.- Specified by:
isPopupEnabledin interfacePopupSource- Returns:
- true if the pop-up definition is enabled; false otherwise. Will return false if an error occurs.
- See Also:
-
setPopupEnabled
public void setPopupEnabled(boolean enabled) Description copied from interface:PopupSourceSets whether the pop-up definition returned fromPopupSource.getPopupDefinition()is enabled or disabled.- Specified by:
setPopupEnabledin interfacePopupSource- Parameters:
enabled- true to enable the PopupDefinition; false otherwise- See Also:
-
getPopupDefinition
Description copied from interface:PopupSourceGets the PopupDefinition that is currently defined or set on the entity.- Specified by:
getPopupDefinitionin interfacePopupSource- Returns:
- the current PopupDefinition. Will return null if an error occurs or if the pop-up source is not associated with a pop-up definition.
- See Also:
-
setPopupDefinition
Description copied from interface:PopupSourceSets a new PopupDefinition on the entity, overriding any previously existing one.- Specified by:
setPopupDefinitionin interfacePopupSource- Parameters:
popupDefinition- the PopupDefinition to set- See Also:
-