ArcGISFeature

class ArcGISFeature : Feature, Loadable

A Feature stored in an ArcGISFeatureTable. An ArcGISFeature can contain:

  • A set of attributes that describe the real-world entity it represents

  • A geometry that defines its location and shape. The geometry might contain m-values, which are typically used for linear referencing.

  • Zero or more feature attachments such as images or documents

A feature's attribute values can be changed, but attribute definitions cannot be added, deleted, or modified.

If you create a ServiceFeatureTable from the URL of a feature service, features in the table are initially in one of the following states:

  • A minimum set of attributes are available in the table, and m-values are omitted. This is an optimization for faster rendering.

  • All attributes defined by the service are available in the table, including m-values, which might be NaN

The initial state of features is determined by the feature request mode of the table. For important details, see FeatureRequestMode.

By default, a query on ArcGISFeatures in a minimum state will return them in the same state. To access all attributes (or the m-values) of features returned by a query, you must load the features. You can do one of the following:

For more information, see the class description for ServiceFeatureTable.

Functions

Link copied to clipboard
suspend fun addAttachment(    name: String,     contentType: String,     data: ByteArray?): Result<Attachment>

Adds a new attachment for this feature.

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
suspend fun deleteAttachment(attachment: Attachment): Result<Unit>

Deletes an attachment of this feature.

Link copied to clipboard
suspend fun deleteAttachments(attachments: Iterable<Attachment>): Result<Unit>

Deletes a list of attachments from this feature.

Link copied to clipboard
suspend fun fetchAttachments(): Result<List<Attachment>>

Gets the list of attachments on this feature. Attachments are returned in descending order based on their id.

Link copied to clipboard
fun getFeatureSubtype(): FeatureSubtype?

Gets the corresponding FeatureSubtype for this feature If this feature belongs to an ArcGISFeatureTable that defines an ArcGISFeatureTable.getSubtypeField(), a FeatureSubtype that matches FeatureSubtype.getCode() with this feature's attribute value for subtype field is returned; otherwise, this will return null.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
fun refresh(): Boolean

Resets the attributes and geometry to the values in the data source. Discards any in-memory changes to the Feature that have not been applied to the table, and reloads the Feature geometry and all attributes.

Link copied to clipboard
fun relateFeature(feature: ArcGISFeature, relationshipInfo: RelationshipInfo? = null)

Sets up a relationship between this feature and the provided feature based on the given relationshipInfo if it is not null.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.

Link copied to clipboard
fun unrelateFeature(feature: ArcGISFeature)

Removes the relationship between this feature and the provided feature. If there is no existing relationship between the features, an IllegalStateException is thrown.

Link copied to clipboard
suspend fun updateAttachment(    attachmentInfo: Attachment,     name: String,     contentType: String,     data: ByteArray?): Result<Unit>

Updates an attachment for this feature.

Properties

Link copied to clipboard
open override val attributes: MutableMap<String, Any?>

All attributes of the geoelement.

Link copied to clipboard
val canEditAttachments: Boolean

True if attachments on this feature can be edited.

Link copied to clipboard
val canUpdateGeometry: Boolean

True if the geometry of this feature can be edited.

Link copied to clipboard
val featureTable: FeatureTable?

The feature table.

Link copied to clipboard
open override var geometry: Geometry?

The geometry of a geoelement.

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.