A feature type is used to ensure that appropriate attribute values are captured when a new feature is created. A FeatureType can specify the domains for the attribute values and can provide a template that populates the feature with initial values. For example, a roads layer may contain different types of roads, such as main roads, city streets, and unpaved tracks. The owner could set up a feature type named 'main road' to ensure that new features are only populated with attribute values appropriate for a 'main road', and so on.
The owner of the ArcGIS Feature Service defines the feature types when they publish the service. They are held
within the "Types" tag of the ArcGIS feature service's REST Services Directory. Each type has an ID, a name, a
set of domains and a set of templates. You can obtain the collection of feature types by using
ArcGISFeatureTable.getFeatureTypes()
. Use ArcGISFeatureTable.createFeature(FeatureType)
to create a
feature with the feature type.
If you are building an editing application, you can present users with a list of feature types. Upon choosing a
feature type, the app can populate the feature's attribute values with the
FeatureTemplate.getPrototypeAttributes()
and ensure that any attributes in the user interface correspond to the
getDomains()
.
- Since:
- 100.0.0
-
Method Details
-
getDomains
Gets ajava.util.Map
of field names to domain instances.- Returns:
- a unmodifiable map of field names to domain instances
- Since:
- 100.0.0
-
getId
Gets the ID of this feature type.The underlying type of the returned Object corresponds to the ID's
Field.Type
. If the ID is of type SHORT then this method returns a Short; for INTEGER this method returns a Integer, and so on.- Returns:
- the ID of this feature type
- Since:
- 100.0.0
-
getName
Gets the name of this feature type.- Returns:
- the name of this feature type
- Since:
- 100.0.0
-
getTemplates
Gets a list of templates for this feature type.- Returns:
- an unmodifiable list of templates for this feature type
- Since:
- 100.0.0
-