Class FeatureSubtype

java.lang.Object
com.esri.arcgisruntime.data.FeatureSubtype

public final class FeatureSubtype extends Object
A feature subtype describes a subset of features in an ArcGISFeatureTable that share the same integer attribute value.

Feature subtypes categorize features in a dataset based on the value of an integer attribute. A subtype can define different default values or domains for fields. For example, city streets in a feature table could be categorized into three feature subtypes: local streets, collector streets, and arterial streets. Feature subtypes can also be used with utility networks to represent asset groups.

If ArcGISFeatureTable.getFeatureSubtypes() contains one or more FeatureSubtype, you can use SubtypeFeatureLayer(ArcGISFeatureTable) to create a SubtypeFeatureLayer. You can then obtain a sublayer for each of the feature sub types from SubtypeFeatureLayer.getSubtypeSublayers(). Each SubtypeSublayer allows you to configure different layer properties, such as opacity, renderer, and scale, for each FeatureSubtype. This is particularly useful for data, such as utility networks, in which many different network elements are grouped into a single subtype feature layer.

If you build an editing application, you can use ArcGISFeatureTable.createFeature(FeatureSubtype) to create a new feature with the specified feature subtype. The getPrototypeAttributes() will ensure that a default set of attribute values are applied to the ArcGISFeature and the getDomains() are utilized.

Since:
100.3.0
  • Method Details

    • getName

      public String getName()
      Gets the name of the feature subtype.
      Returns:
      the name of the feature subtype
      Since:
      100.3.0
    • getCode

      public Object getCode()
      Gets the feature subtype's code.

      The feature subtypes have a paired code and value. For example, the following codes in a subtype named RoadClass could represent valid classes in a feature class for streets:

      • 0 - Local Streets
      • 1 - Secondary Streets
      • 2 - Main Streets
      If this feature subtype represents the Main Streets, the Integer 2 will be returned as the code.
      Returns:
      the code of the feature subtype
      Since:
      100.3.0
    • getDomains

      public Map<String,Domain> getDomains()
      Gets the domains associated with this feature subtype.
      Returns:
      an unmodifiable Map; the keys are Strings containing the names of fields and the values are Domains applicable to these fields
      Since:
      100.3.0
      See Also:
    • getFieldOverrides

      public List<Field> getFieldOverrides()
      Gets the fields defined for this feature subtype.

      A subset of FeatureTable.getFields() relevant to this feature subtype. This collection of Field may override properties defined in the FeatureTable.getFields(). For example, Field.getAlias(), Field.isEditable(), and Field.getDomain().

      Returns:
      an unmodifiable list of the fields defined for this feature subtype
      Since:
      100.9.0
    • getPrototypeAttributes

      public Map<String,Object> getPrototypeAttributes()
      Gets the prototype attributes for creating a Feature with this subtype.
      Returns:
      an unmodifiable Map; the keys are Strings containing attribute names and the values are Objects to be assigned to these attributes
      Since:
      100.3.0