OgcFeatureCollectionTable

class OgcFeatureCollectionTable : FeatureTable

An OGC API - Features feature collection table. To display data from an OGC feature collection table in a FeatureLayer use the FeatureLayer.FeatureLayer(FeatureTable) constructor where the OgcFeatureCollectionTable is the parameter that is passed into the constructor. Note: The OgcFeatureCollectionTable should not be confused with FeatureCollectionTable which is used as an input to create a FeatureCollectionLayer.

This API provides building blocks for manipulating OGC Features on the Web. For more information about the OGC API Features specification see the documents: OGC API - Features - Part 1[https://docs.opengeospatial.org/is/17-069r3/17-069r3.html] and https://docs.opengeospatial.org/is/18-058/18-058.html.

The class includes two important members: the OgcFeatureCollectionTable.getFeatureRequestMode() property and the OgcFeatureCollectionTable.populateFromService(QueryParameters, Boolean, MutableListImpl) method. Only the FeatureRequestMode.ManualCache mode is supported. This means OgcFeatureCollectionTable.populateFromService(QueryParameters, Boolean, MutableListImpl) must be called to populate, query, and return features from the service. For the QueryParameters.getWhereClause() that is used by the OgcFeatureCollectionTable.populateFromService(QueryParameters, Boolean, MutableListImpl) method, you can put any CQL2-TEXT or CQL2-JSON string as defined in the document https://docs.ogc.org/DRAFTS/21-065.html.

When populating or updating a local table from an OGC service, you can now request features in a specified SpatialReference (also referred to as SRS in ArcGIS or CRS in OGC). This leverages the power of the server to return features in the same spatial reference as your map rather than having to re-project them on the client.

This class supports loading and querying of features from a non-spatial OGC feature collection table.

Constructors

Link copied to clipboard
fun OgcFeatureCollectionTable(featureCollectionInfo: OgcFeatureCollectionInfo)

Creates a new OGC API - Features feature collection table

Link copied to clipboard
fun OgcFeatureCollectionTable(url: String, collectionId: String)

Creates a new OGC API - Features feature collection table.

Functions

Link copied to clipboard
suspend fun addFeature(feature: Feature): Result<Unit>

Adds a feature to the table. Adding a feature that contains a Geometry causes the geometry to become simplified. This may change a single part geometry to a multipart geometry, or round off X, Y, Z, and M coordinate values that are above the resolution set by the SpatialReference.

Link copied to clipboard
suspend fun addFeatures(features: Iterable<Feature>): Result<Unit>

Adds a collection of features to the table.

Link copied to clipboard
fun canAdd(): Boolean

Determines whether you can add a feature to a table.

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
fun canDelete(feature: Feature): Boolean

Determines whether you can delete a feature from a table.

Link copied to clipboard
fun canEditGeometry(): Boolean

Determines whether you can edit the geometry field in a table.

Link copied to clipboard
fun canUpdate(feature: Feature): Boolean

Determines whether you can update a feature in a table.

Link copied to clipboard
fun createFeature(): Feature

Creates a new empty feature. The new feature is only available in memory at this point. Execute FeatureTable.addFeature(Feature) to commit the new Feature to the table.

fun createFeature(attributes: Map<String, Any?>, geometry: Geometry?): Feature

Creates a new feature with the provided attribute values and, optionally, geometry. The new feature is only available in memory at this point. Execute FeatureTable.addFeature(Feature) to commit the new Feature to the table.

Link copied to clipboard
suspend fun deleteFeature(feature: Feature): Result<Unit>

Deletes a feature from the table. Deleting a feature from a GeodatabaseFeatureTable in a stand-alone mobile geodatabase created with ArcGIS Pro is not supported when the table participates in a controller dataset, such as a utility network or parcel fabric. Use FeatureTable.canDelete(Feature) to determine if this operation is allowed.

Link copied to clipboard
suspend fun deleteFeatures(features: Iterable<Feature>): Result<Unit>

Deletes a collection of features from the table.

Link copied to clipboard
fun getField(fieldName: String): Field?

Retrieves the field with the given name.

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

Loads the metadata for the object.

Link copied to clipboard
suspend fun populateFromService(    parameters: QueryParameters?,     clearCache: Boolean,     outFields: Iterable<String>): Result<FeatureQueryResult>

Populate the OGC API - Features feature collection table with the results of a query. Use the default (empty) QueryParameters to get all features from the service. Specifying null or an empty MutableListImpl for outfields will result in the default set of outfields being used. Spatial queries (those that specify geometries) must use the Intersects spatial relationship.

Link copied to clipboard
suspend fun queryExtent(queryParameters: QueryParameters): Result<Geometry>

Determines the minimum bounding envelope that contains features satisfying the provided query parameters. If no features meet the query criteria, an empty envelope is returned.

Link copied to clipboard
suspend fun queryFeatureCount(queryParameters: QueryParameters): Result<Long>

Determines the count of features that satisfy the provided query parameters.

Link copied to clipboard
suspend fun queryFeatures(parameters: QueryParameters): Result<FeatureQueryResult>

Submits a query against the table.

Link copied to clipboard
suspend fun queryStatistics(statisticsQueryParameters: StatisticsQueryParameters): Result<StatisticsQueryResult>

Calculates values for the requested statistics. Statistics query parameters may also define fields on which results are grouped or sorted.

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

Loads or retries loading metadata for the object.

Link copied to clipboard
suspend fun updateFeature(feature: Feature): Result<Unit>

Updates a feature in the table. If you update a feature that contains a Geometry, the geometry becomes simplified. This may change a single part geometry to a multipart geometry, or round X, Y, Z, and M coordinate values that are above the resolution set by the SpatialReference.

Link copied to clipboard
suspend fun updateFeatures(features: Iterable<Feature>): Result<Unit>

Updates a collection of features in the table.

Properties

Link copied to clipboard
var displayName: String

A user-friendly name that can be displayed in the UI (for example, in a Table of Contents). If the table is displayed with a FeatureLayer, the FeatureTable.getDisplayName() is used as the FeatureLayer.getName().

Link copied to clipboard
val extent: Envelope?
Link copied to clipboard
val featureCollectionInfo: OgcFeatureCollectionInfo?
Link copied to clipboard
var featureRequestMode: FeatureRequestMode

The mode defining when features are requested from the service. Warning: At v100.9, OGC API - Features collection table only supports FeatureRequestMode.ManualCache but defaults to FeatureRequestMode.OnInteractionCache. Set the feature request mode to manual before attempting to populate the table.

Link copied to clipboard
open val fields: List<Field>

The collection of Field objects representing the fields of the feature table.

Link copied to clipboard
open val geometryType: GeometryType

The type of geometry of the features stored in this table. If FeatureTable.getHasGeometry() is false, then the geometry type is GeometryType.Unknown.

Link copied to clipboard
val hasGeometry: Boolean

True if the feature table supports geographic features, false otherwise.

Link copied to clipboard
val hasM: Boolean

True if the feature table supports geometries with M values, false otherwise.

Link copied to clipboard
val hasZ: Boolean

True if the feature table supports geometries with Z values, false otherwise.

Link copied to clipboard
val isEditable: Boolean

True if this feature table is editable, false otherwise. Underlying file permissions (for subclasses such as ShapefileFeatureTable and GeodatabaseFeatureTable) can be changed while the feature table is open. In these cases the value of this property may not be accurate.

Link copied to clipboard
open override var isPopupEnabled: Boolean

A flag indicating whether the PopupDefinition defined on the PopupSource is enable / disable. Will return false if an error occurs.

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

The load status.

Link copied to clipboard
val numberOfFeatures: Long

The number of features in the table. If all the features are stored in the local table, for example with a GeodatabaseFeatureTable or a ShapefileFeatureTable, then the FeatureTable.getNumberOfFeatures() will return the full number of features.

Link copied to clipboard
open override var popupDefinition: PopupDefinition?

The pop-up definition. The PopupDefinition associated with the popup source. A null if an error occurs or if the popup source is not associated with a pop-up definition.

Link copied to clipboard
open val spatialReference: SpatialReference?
Link copied to clipboard
val tableName: String

The name of the table in the source dataset.

Link copied to clipboard
val url: String

The URL of the OGC API - Features service landing page.