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 FeatureLayer properties. 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.

      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 are drawn using FeatureLayer.getRenderer() and LayerViewState will contain an error indicating the use of an unsupported renderer. Also note, AggregationFeatureReduction.rendererProperty() is independent of FeatureLayer.rendererProperty().

      If you want to symbolize clusters using the same symbology used by the FeatureLayer, you may clone FeatureLayer.rendererProperty() and set it here. You can also create a new renderer of a supported type. If you create a new SimpleRenderer, clusters will draw using 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 getAggregateFields(). If this field is not found in getAggregateFields(), cluster will draw using ClassBreaksRenderer.getDefaultSymbol() or UniqueValueRenderer.getDefaultSymbol(). If there is no default symbol defined, clusters will not draw.

      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.

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

      The maxScale value must be a non-negative number.

      Since:
      200.3.0
      See Also:
    • getMaxScale

      public double getMaxScale()
      Gets the value of the property maxScale.
      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.

      The maxScale value must be a non-negative number.

      Since:
      200.3.0
    • setMaxScale

      public void setMaxScale(double maxScale)
      Sets the value of the property maxScale.
      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.

      The maxScale value must be a non-negative number.

      Since:
      200.3.0
    • 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 are drawn using FeatureLayer.getRenderer() and LayerViewState will contain an error indicating the use of an unsupported renderer. Also note, AggregationFeatureReduction.rendererProperty() is independent of FeatureLayer.rendererProperty().

      If you want to symbolize clusters using the same symbology used by the FeatureLayer, you may clone FeatureLayer.rendererProperty() and set it here. You can also create a new renderer of a supported type. If you create a new SimpleRenderer, clusters will draw using 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 getAggregateFields(). If this field is not found in getAggregateFields(), cluster will draw using ClassBreaksRenderer.getDefaultSymbol() or UniqueValueRenderer.getDefaultSymbol(). If there is no default symbol defined, clusters will not draw.

      Attempting to set the value to null will throw a NullPointerException exception.

      Since:
      200.3.0
      See Also:
    • getRenderer

      public Renderer getRenderer()
      Gets the value of the property renderer.
      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 are drawn using FeatureLayer.getRenderer() and LayerViewState will contain an error indicating the use of an unsupported renderer. Also note, AggregationFeatureReduction.rendererProperty() is independent of FeatureLayer.rendererProperty().

      If you want to symbolize clusters using the same symbology used by the FeatureLayer, you may clone FeatureLayer.rendererProperty() and set it here. You can also create a new renderer of a supported type. If you create a new SimpleRenderer, clusters will draw using 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 getAggregateFields(). If this field is not found in getAggregateFields(), cluster will draw using ClassBreaksRenderer.getDefaultSymbol() or UniqueValueRenderer.getDefaultSymbol(). If there is no default symbol defined, clusters will not draw.

      Attempting to set the value to null will throw a NullPointerException exception.

      Since:
      200.3.0
    • setRenderer

      public void setRenderer(Renderer renderer)
      Sets the value of the property renderer.
      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 are drawn using FeatureLayer.getRenderer() and LayerViewState will contain an error indicating the use of an unsupported renderer. Also note, AggregationFeatureReduction.rendererProperty() is independent of FeatureLayer.rendererProperty().

      If you want to symbolize clusters using the same symbology used by the FeatureLayer, you may clone FeatureLayer.rendererProperty() and set it here. You can also create a new renderer of a supported type. If you create a new SimpleRenderer, clusters will draw using 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 getAggregateFields(). If this field is not found in getAggregateFields(), cluster will draw using ClassBreaksRenderer.getDefaultSymbol() or UniqueValueRenderer.getDefaultSymbol(). If there is no default symbol defined, clusters will not draw.

      Attempting to set the value to null will throw a NullPointerException exception.

      Since:
      200.3.0
    • showLabelsProperty

      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:
    • isShowLabels

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

      The default value is true.

      Since:
      200.3.0
    • setShowLabels

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

      The default value is true.

      Since:
      200.3.0
    • 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: