Class AggregationFeatureReduction

java.lang.Object
com.esri.arcgisruntime.mapping.reduction.FeatureReduction
com.esri.arcgisruntime.mapping.reduction.AggregationFeatureReduction
All Implemented Interfaces:
PopupSource
Direct Known Subclasses:
ClusteringFeatureReduction

public class AggregationFeatureReduction extends FeatureReduction implements PopupSource
A base class to define visual aggregation of geoelements.

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 Details

    • maxScale

      public DoubleProperty 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.

      Since:
      200.3.0
      See Also:
    • renderer

      public ObjectProperty<Renderer> rendererProperty
      Defines the symbology for displaying aggregated geoelements.

      Only SimpleRenderer, UniqueValueRenderer, and ClassBreaksRenderer are currently supported for 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 the FeatureLayer or original graphics from the GraphicsOverlay are drawn using FeatureLayer.getRenderer() or GraphicsOverlay.getRenderer() respectively. In the case of FeatureLayer, a LayerViewState that contains an error indicating the use of an unsupported renderer is bubbled up. Also, note that AggregationFeatureReduction.rendererProperty() is independent of FeatureLayer.rendererProperty() and GraphicsOverlay.rendererProperty().

      If you want to symbolize aggregate geoelements using the same symbology used by the FeatureLayer or GraphicsOverlay, you may call toJson() on FeatureLayer.getRenderer() or GraphicsOverlay.getRenderer() and then create a new renderer with fromJson(). You can also create a new renderer of a supported type. If you create a new SimpleRenderer, aggregate geoelements will display with the symbol defined for the SimpleRenderer. or UniqueValueRenderer, the field name on the renderer must match one of the AggregateField in getAggregateFields(). If this field is not found in AggregationFeatureReduction.getAggregateFields(), aggregate geoelements will draw using ClassBreaksRenderer.getDefaultSymbol() or UniqueValueRenderer.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

      public BooleanProperty showLabelsProperty
      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

      protected Renderer mRenderer
  • Method Details

    • getAggregateFields

      public List<AggregateField> getAggregateFields()
      Gets the collection of AggregateField that summarizes one or more attributes for a group of geoelements visualized with FeatureReduction.

      getAggregateFields() 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.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 the 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.

      Returns:
      the collection of AggregateField that summarizes one or more attributes for a group of geoelements visualized with FeatureReduction
      Since:
      200.3.0
    • getLabelDefinitions

      public List<LabelDefinition> getLabelDefinitions()
      Gets the collection of LabelDefinition objects 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 of FeatureLayer.getLabelDefinitions() and GraphicsOverlay.getLabelDefinitions(). Labels on aggregated geoelements will only appear if there is at least one LabelDefinition defined.

      Returns:
      the collection of LabelDefinition objects that define label display for the summarized attribute values of aggregated geoelements
      Since:
      200.3.0
    • maxScaleProperty

      public DoubleProperty 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 maxScale property
      Since:
      200.3.0
      See Also:
    • getMaxScale

      public double getMaxScale()
      Gets the value of the maxScale property.
      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 maxScale property
      Since:
      200.3.0
      See Also:
    • setMaxScale

      public void setMaxScale(double maxScale)
      Sets the value of the maxScale property.
      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 the maxScale property
      Since:
      200.3.0
      See Also:
    • rendererProperty

      public ObjectProperty<Renderer> rendererProperty()
      Defines the symbology for displaying aggregated geoelements.

      Only SimpleRenderer, UniqueValueRenderer, and ClassBreaksRenderer are currently supported for 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 the FeatureLayer or original graphics from the GraphicsOverlay are drawn using FeatureLayer.getRenderer() or GraphicsOverlay.getRenderer() respectively. In the case of FeatureLayer, a LayerViewState that contains an error indicating the use of an unsupported renderer is bubbled up. Also, note that AggregationFeatureReduction.rendererProperty() is independent of FeatureLayer.rendererProperty() and GraphicsOverlay.rendererProperty().

      If you want to symbolize aggregate geoelements using the same symbology used by the FeatureLayer or GraphicsOverlay, you may call toJson() on FeatureLayer.getRenderer() or GraphicsOverlay.getRenderer() and then create a new renderer with fromJson(). You can also create a new renderer of a supported type. If you create a new SimpleRenderer, aggregate geoelements will display with the symbol defined for the SimpleRenderer. or UniqueValueRenderer, the field name on the renderer must match one of the AggregateField in getAggregateFields(). If this field is not found in AggregationFeatureReduction.getAggregateFields(), aggregate geoelements will draw using ClassBreaksRenderer.getDefaultSymbol() or UniqueValueRenderer.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 renderer property
      Since:
      200.3.0
      See Also:
    • getRenderer

      public Renderer getRenderer()
      Gets the value of the renderer property.
      Property description:
      Defines the symbology for displaying aggregated geoelements.

      Only SimpleRenderer, UniqueValueRenderer, and ClassBreaksRenderer are currently supported for 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 the FeatureLayer or original graphics from the GraphicsOverlay are drawn using FeatureLayer.getRenderer() or GraphicsOverlay.getRenderer() respectively. In the case of FeatureLayer, a LayerViewState that contains an error indicating the use of an unsupported renderer is bubbled up. Also, note that AggregationFeatureReduction.rendererProperty() is independent of FeatureLayer.rendererProperty() and GraphicsOverlay.rendererProperty().

      If you want to symbolize aggregate geoelements using the same symbology used by the FeatureLayer or GraphicsOverlay, you may call toJson() on FeatureLayer.getRenderer() or GraphicsOverlay.getRenderer() and then create a new renderer with fromJson(). You can also create a new renderer of a supported type. If you create a new SimpleRenderer, aggregate geoelements will display with the symbol defined for the SimpleRenderer. or UniqueValueRenderer, the field name on the renderer must match one of the AggregateField in getAggregateFields(). If this field is not found in AggregationFeatureReduction.getAggregateFields(), aggregate geoelements will draw using ClassBreaksRenderer.getDefaultSymbol() or UniqueValueRenderer.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 renderer property
      Since:
      200.3.0
      See Also:
    • setRenderer

      public void setRenderer(Renderer renderer)
      Sets the value of the renderer property.
      Property description:
      Defines the symbology for displaying aggregated geoelements.

      Only SimpleRenderer, UniqueValueRenderer, and ClassBreaksRenderer are currently supported for 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 the FeatureLayer or original graphics from the GraphicsOverlay are drawn using FeatureLayer.getRenderer() or GraphicsOverlay.getRenderer() respectively. In the case of FeatureLayer, a LayerViewState that contains an error indicating the use of an unsupported renderer is bubbled up. Also, note that AggregationFeatureReduction.rendererProperty() is independent of FeatureLayer.rendererProperty() and GraphicsOverlay.rendererProperty().

      If you want to symbolize aggregate geoelements using the same symbology used by the FeatureLayer or GraphicsOverlay, you may call toJson() on FeatureLayer.getRenderer() or GraphicsOverlay.getRenderer() and then create a new renderer with fromJson(). You can also create a new renderer of a supported type. If you create a new SimpleRenderer, aggregate geoelements will display with the symbol defined for the SimpleRenderer. or UniqueValueRenderer, the field name on the renderer must match one of the AggregateField in getAggregateFields(). If this field is not found in AggregationFeatureReduction.getAggregateFields(), aggregate geoelements will draw using ClassBreaksRenderer.getDefaultSymbol() or UniqueValueRenderer.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 the renderer property
      Since:
      200.3.0
      See Also:
    • showLabelsProperty

      public BooleanProperty showLabelsProperty()
      True to display labels for aggregated geoelements, false to turn them off.

      The default value is true.

      Returns:
      the showLabels property
      Since:
      200.3.0
      See Also:
    • isShowLabels

      public boolean isShowLabels()
      Gets the value of the showLabels property.
      Property description:
      True to display labels for aggregated geoelements, false to turn them off.

      The default value is true.

      Returns:
      the value of the showLabels property
      Since:
      200.3.0
      See Also:
    • setShowLabels

      public void setShowLabels(boolean showLabels)
      Sets the value of the showLabels property.
      Property description:
      True to display labels for aggregated geoelements, false to turn them off.

      The default value is true.

      Parameters:
      showLabels - the value for the showLabels property
      Since:
      200.3.0
      See Also:
    • isPopupEnabled

      public boolean isPopupEnabled()
      Description copied from interface: PopupSource
      Checks if the pop-up definition returned from PopupSource.getPopupDefinition() is enabled or disabled.
      Specified by:
      isPopupEnabled in interface PopupSource
      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: PopupSource
      Sets whether the pop-up definition returned from PopupSource.getPopupDefinition() is enabled or disabled.
      Specified by:
      setPopupEnabled in interface PopupSource
      Parameters:
      enabled - true to enable the PopupDefinition; false otherwise
      See Also:
    • getPopupDefinition

      public PopupDefinition getPopupDefinition()
      Description copied from interface: PopupSource
      Gets the PopupDefinition that is currently defined or set on the entity.
      Specified by:
      getPopupDefinition in interface PopupSource
      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

      public void setPopupDefinition(PopupDefinition popupDefinition)
      Description copied from interface: PopupSource
      Sets a new PopupDefinition on the entity, overriding any previously existing one.
      Specified by:
      setPopupDefinition in interface PopupSource
      Parameters:
      popupDefinition - the PopupDefinition to set
      See Also: