Class FeatureCollectionTable

java.lang.Object
com.esri.arcgisruntime.data.FeatureTable
com.esri.arcgisruntime.data.FeatureCollectionTable
All Implemented Interfaces:
FeatureSet, Loadable, PopupSource, Iterable<Feature>

public final class FeatureCollectionTable extends FeatureTable implements FeatureSet
A feature collection table represents an individual feature table in a FeatureCollection.

A FeatureCollectionTable consists of a feature definition (table schema) and a set of features that match that feature definition. You can obtain a FeatureCollectionTable from an existing FeatureCollection.getTables() collection, or you can create a new FeatureCollectionTable programmatically in your app.

To create a new FeatureCollectionTable, you can use a constructor that defines a set of fields, the geometry type, and spatial reference, and then populate it by adding new features. Alternatively, you can create a new FeatureCollectionTable from a FeatureSet, such as the FeatureQueryResult returned from a FeatureTable.queryFeaturesAsync(QueryParameters).

To render the features in a map or scene, add the FeatureCollectionTable to a FeatureCollection.getTables() collection, construct a FeatureCollectionLayer from the FeatureCollection, and add it to the map or scene's collection of operational layers. To specify the FeatureCollectionTable symbology, just apply a renderer to the setRenderer(Renderer). If required, you can override this symbology on a per-feature basis using the setSymbolOverride(Feature, Symbol).

Since:
100.0.0
  • Constructor Details

    • FeatureCollectionTable

      public FeatureCollectionTable(Iterable<Field> fields, GeometryType geometryType, SpatialReference spatialReference)
      Creates an empty FeatureCollectionTable from the specified fields, geometry type and spatial reference.
      Parameters:
      fields - the fields of all features in the table
      geometryType - the geometry type of all features in the table, pass GeometryType.UNKNOWN to create a non-spatial FeatureCollectionTable
      spatialReference - the spatial reference of all features in the table, can be null for a non-spatial FeatureCollectionTable
      Throws:
      IllegalArgumentException - if
      • fields is null or empty
      • geometryType is null
      • spatialReference is null and geometryType not GeometryType.UNKNOWN
      Since:
      100.0.0
    • FeatureCollectionTable

      public FeatureCollectionTable(Iterable<Field> fields, GeometryType geometryType, SpatialReference spatialReference, boolean hasZ, boolean hasM)
      Creates an empty FeatureCollectionTable from the specified fields, geometry type, spatial reference. The table can contain z and m values.
      Parameters:
      fields - the fields of all features in the table
      geometryType - the geometry type of all features in the table, pass GeometryType.UNKNOWN to create a non-spatial FeatureCollectionTable
      spatialReference - the spatial reference of all features in the table, can be null for a non-spatial FeatureCollectionTable
      hasZ - specifies whether the table supports geometries with z values, true if it does, false otherwise
      hasM - specifies whether the table supports geometries with m values, true if it does, false otherwise
      Throws:
      IllegalArgumentException - if
      • fields is null or empty
      • geometryType is null
      • spatialReference is null and geometryType not GeometryType.UNKNOWN
      Since:
      100.0.0
    • FeatureCollectionTable

      public FeatureCollectionTable(Iterable<GeoElement> geoElements, Iterable<Field> fields)
      Creates a FeatureCollectionTable populated from the specified GeoElement collection.

      The geometry type and spatial reference will be inferred from the geo-elements passed in. Note that this constructor may take some time to complete depending on how many geo-elements are passed in.

      Parameters:
      geoElements - the geo-elements to populate the FeatureCollectionTable with
      fields - the fields of all features in the table
      Throws:
      IllegalArgumentException - if
      • geoElements is null or empty
      • fields is null or empty
      Since:
      100.0.0
      See Also:
    • FeatureCollectionTable

      public FeatureCollectionTable(FeatureSet featureSet)
      Creates a FeatureCollectionTable populated from the specified FeatureSet.

      The FeatureCollectionTable will be populated with the contents of the FeatureSet. Note that this constructor may take some time to complete depending on how many features are in the feature set.

      Parameters:
      featureSet - a set of features to populate the FeatureCollectionTable with
      Throws:
      IllegalArgumentException - if featureSet is null
      Since:
      100.00
      See Also:
  • Method Details

    • getLayerInfo

      public ArcGISFeatureLayerInfo getLayerInfo()
      Gets the layer info of this FeatureCollectionTable.
      Returns:
      an ArcGISFeatureLayerInfo
      Since:
      100.0.0
    • getRenderer

      public Renderer getRenderer()
      Gets the renderer of this FeatureCollectionTable.
      Returns:
      the renderer used to render features of this table
      Since:
      100.0.0
    • setRenderer

      public void setRenderer(Renderer renderer)
      Sets the Renderer of this FeatureCollectionTable.
      Parameters:
      renderer - the Renderer to use with this FeatureCollectionTable
      Throws:
      IllegalArgumentException - if renderer is null
      Since:
      100.0.0
      See Also:
    • getSymbolOverride

      public Symbol getSymbolOverride(Feature feature)
      Gets the symbol override for the given feature in the FeatureCollectionTable.
      Parameters:
      feature - the feature in the table for which to retrieve its symbol override
      Returns:
      a Symbol used to render the given feature
      Since:
      100.0.0
    • setSymbolOverride

      public void setSymbolOverride(Feature feature, Symbol symbol)
      Sets the symbol override for the given feature in the FeatureCollectionTable. The specified symbol is used to render the given feature instead of the renderer of this table.
      Parameters:
      feature - the feature in the table for which to set the specified symbol override
      symbol - the symbol override
      Since:
      100.0.0
    • getTitle

      public String getTitle()
      Gets the title of this FeatureCollectionTable.
      Returns:
      the title of this FeatureCollectionTable
      Since:
      100.0.0
    • setTitle

      public void setTitle(String title)
      Sets the title of this FeatureCollectionTable.
      Parameters:
      title - the title of this FeatureCollectionTable
      Since:
      100.0.0
    • iterator

      public Iterator<Feature> iterator()
      Returns an iterator over the set of features in this FeatureCollectionTable. Iterators previously returned from this method will become invalid and their methods will throw an IllegalStateException.
      Specified by:
      iterator in interface Iterable<Feature>
      Returns:
      an iterator over the set of features in this FeatureCollectionTable
      Since:
      100.0.0