ServiceFeatureTable class final

A table of features that typically represent real-world objects created from an ArcGIS feature service.

An instance of this class represents the dataset of an individual layer or table in an ArcGIS map or feature service. The map or feature service may be hosted in the cloud on ArcGIS Online, or on-premises on an ArcGIS Server. To access these services you may need to provide authentication in your application.

You can construct a ServiceFeatureTable directly from the feature service using its URI or PortalItem. Alternatively, you can obtain a ServiceFeatureTable from a FeatureLayer or a FeatureTable that is part of an ArcGISMap or ArcGISScene. You can also obtain a ServiceFeatureTable directly from its service geodatabase using ServiceGeodatabase.getTable(int64).

The ServiceFeatureTable adopts the loadable pattern so many of its properties are initialized asynchronously after connecting to the service. For more information, see Loadable.

Display

If the FeatureTable.hasGeometry is true, you can display the features in an ArcGISMap or ArcGISScene. To do this create a FeatureLayer from the feature table and add it to the map or scene's collection of operational layers (GeoModel.operationalLayers). Spatial features are requested in the SpatialReference that matches the ArcGISMap or ArcGISScene and are displayed using the ArcGISSymbol information defined by the map or feature service. Query You can query the data in the ServiceFeatureTable based on SQL expressions and/or spatial relationships. Use the QueryParameters object to define your spatial or attribute query and pass it to the ServiceFeatureTable.queryFeaturesWithFieldOptions method. If the service feature table is related to any other tables that are part of the map or scene, use the ServiceFeatureTable.queryRelatedFeaturesWithFieldOptions method to query the related tables. For more information, see RelatedQueryParameters. Edit A ServiceFeatureTable can have editable attribute fields, feature templates (FeatureTemplate), feature types (FeatureType), and editing capabilities defined in ArcGISFeatureLayerInfo.capabilities. You can create, delete, and update data in the local cache depending upon whether the service allows those operations, who owns the data, and what ownership-based access control policies are in place. Permission to edit the data is managed by the author of the feature service. Explore FeatureTable.isEditable, FeatureTable.canAdd, FeatureTable.canUpdate, and FeatureTable.canDelete for information on what is permitted. If the service supports attachments (ArcGISFeatureTable.hasAttachments), you can also view and potentially edit the attachments. If you want to apply your edits to the feature service, you must call the ServiceGeodatabase.applyEditsAsync() method on the ServiceFeatureTable.serviceGeodatabase. This will ensure that the table and any tables involved in geodatabase behavior are updated. Areas that have geodatabase behavior include: * Composite relationships * Annotation feature layers * Utility network association deletion semantics * Attribute rules

Contingent Values The ServiceFeatureTable supports querying and editing contingent values. See ArcGISFeatureTable.getContingentValues(ArcGISFeature, String) for more information.

Offline If you wish to adopt an offline workflow, you can take areas of a ServiceFeatureTable offline using the GeodatabaseSyncTask. If you wish to take an ArcGISMap offline use the OfflineMapTask. See Build offline applications for more information.

Feature Request Mode The FeatureRequestMode determines whether ServiceFeatureTable features are cached locally (for quicker access by map and scene layers) and whether queries are performed on the local cache or on the server. Consider which of these 3 modes is appropriate for your application:

  • FeatureRequestMode.onInteractionCache - User interactions (pan or zoom) with the ArcGISMapViewController or SceneView request features from the server and cache them locally for the duration of the session. Subsequent interactions with the ArcGISMapViewController or SceneView will refresh this local cache. Queries are executed on the local cache or (if requested features are not resident in the cache) on the server. If the network connection is lost then the application can still operate with the local cache. This is the default mode.

  • FeatureRequestMode.onInteractionNoCache - Your application will display or query features directly from the server. They are not cached locally. This mode ensures that you are working against the latest data, but it has a high network bandwidth since it goes to the server for all interactions (pans, zooms, selects, or queries).

  • FeatureRequestMode.manualCache - Your application must explicitly call ServiceFeatureTable.populateFromService to query the feature service and cache the resulting features in the ServiceFeatureTable. All queries are made against this local cache. You must adopt this mode for tables that contain non-spatial records (see FeatureTable.hasGeometry).

Inheritance
Implemented types

Constructors

ServiceFeatureTable.fromTable(ServiceFeatureTable table, {required RelationshipInfo relationshipInfo})
Creates a new service feature table object from the specified table and relationship information.
factory
ServiceFeatureTable.withFeatureLayerItem(Item item)
Creates a new service feature table object from an ArcGIS feature service or feature layer portal item.
factory
ServiceFeatureTable.withItem(Item item, {required int layerId})
Creates a new service feature table object from a feature service portal item.
factory
ServiceFeatureTable.withUri(Uri uri)
Creates a new service feature table object from a given URI.
factory

Properties

apiKey String
The API key allows your app to access ArcGIS location services and private portal items.
getter/setter pairoverride
bufferFactor double
The factor used to calculate a buffered extent around the current visible area when requesting features from a service.
getter/setter pair
defaultSubtypeCode → dynamic
The table's default subtype code.
no setterinherited
definitionExpression String
An expression (SQL where clause) to filter features queried in this table.
getter/setter pair
displayName String
A user-friendly name that can be displayed in the UI (for example, in a Table of Contents).
getter/setter pairinherited
editableAttributeFields List<Field>
A list of editable fields.
no setterinherited
extent Envelope?
The geographic extent of features within the table.
no setterinherited
featureRequestMode FeatureRequestMode
Defines when features and non-spatial records are requested from the feature service.
getter/setter pair
featureSubtypes List<FeatureSubtype>
The table's feature subtypes.
no setterinherited
featureTemplates List<FeatureTemplate>
A list of the feature templates on this table.
no setterinherited
featureTypes List<FeatureType>
The feature types for this table.
no setterinherited
fields List<Field>
The collection of Field objects representing the fields of the feature table.
no setterinherited
geodatabaseVersion String
The service geodatabase version name.
getter/setter pair
geometryType GeometryType
The type of geometry of the features stored in this table.
no setterinherited
globalIdField String
The global id field name.
no setterinherited
hasAttachments bool
True if the features in this table have attachments, false otherwise.
no setterinherited
hasGeometry bool
True if the feature table supports geographic features, false otherwise.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasM bool
True if the feature table supports geometries with M values, false otherwise.
no setterinherited
hasZ bool
True if the feature table supports geometries with Z values, false otherwise.
no setterinherited
isEditable bool
True if this feature table is editable, false otherwise.
no setterinherited
item Item?
The Item that defines the service feature table.
no setter
layer Layer?
The layer that displays this table, if any.
no setterinherited
layerInfo ArcGISFeatureLayerInfo?
The service information related to the feature layer.
no setterinherited
loadError ArcGISException?
The load error.
no setterinherited
loadStatus LoadStatus
The load status.
no setterinherited
numberOfFeatures int
The number of features in the table.
no setterinherited
objectIdField String
The object id field name.
no setterinherited
onLoadStatusChanged Stream<LoadStatus>
A stream that reports changes to the LoadStatus.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceLayerId int
The layer ID in the feature service that this table was created from.
no setterinherited
spatialReference SpatialReference?
The spatial reference of the table.
no setterinherited
subtypeField String
The table's subtype field.
no setterinherited
tableName String
The name of the table in the source dataset.
no setterinherited
typeIdField String
The type id field name.
no setterinherited
uri Uri?
The URI of the service feature table.
no setter
useAdvancedSymbology bool
True if the table is using advanced symbology, false otherwise.
getter/setter pairinherited
username String
The username of the feature table.
no setterinherited

Methods

addFeature(Feature feature) Future<void>
Adds a feature to the table.
inherited
addFeatureCancelable(Feature feature) CancelableOperation<void>
Cancelable version of addFeature. See that method for more information.
inherited
addFeatures(List<Feature> features) Future<void>
Adds a collection of features to the table.
inherited
addFeaturesCancelable(List<Feature> features) CancelableOperation<void>
Cancelable version of addFeatures. See that method for more information.
inherited
applyEdits() Future<List<FeatureEditResult>>
Uploads any changes to the local table to the feature service.
applyEditsCancelable() CancelableOperation<List<FeatureEditResult>>
Cancelable version of applyEdits. See that method for more information.
canAdd() bool
Determines whether you can add new features to the table.
inherited
cancelLoad() → void
Cancels loading metadata for the object.
inherited
canDelete({required Feature feature}) bool
Determines whether you can delete the feature from the table.
inherited
canEditGeometry() bool
Determines whether you can edit the geometry field in a table.
inherited
canUpdate({required Feature feature}) bool
Determines whether you can update the feature in the table.
inherited
clearCache({required bool keepLocalEdits}) → void
Clears cached data.
createFeature({Map<String, dynamic> attributes = const {}, Geometry? geometry}) Feature
Creates a new feature with the provided attribute values and, optionally, geometry.
inherited
createFeatureWithSubtype(FeatureSubtype featureSubtype, {Geometry? geometry}) ArcGISFeature
Creates a new feature based on the provided feature subtype and geometry.
inherited
createFeatureWithTemplate(FeatureTemplate featureTemplate, {Geometry? geometry}) ArcGISFeature
Creates a new feature based on the provided feature template and geometry.
inherited
createFeatureWithType(FeatureType featureType, {Geometry? geometry}) ArcGISFeature
Creates a new feature based on the provided feature type and geometry.
inherited
deleteFeature(Feature feature) Future<void>
Deletes a feature from the table.
inherited
deleteFeatureCancelable(Feature feature) CancelableOperation<void>
Cancelable version of deleteFeature. See that method for more information.
inherited
deleteFeatures(List<Feature> features) Future<void>
Deletes a collection of features from the table.
inherited
deleteFeaturesCancelable(List<Feature> features) CancelableOperation<void>
Cancelable version of deleteFeatures. See that method for more information.
inherited
getAddedFeatures() Future<FeatureQueryResult>
Returns the features added since the last sync.
inherited
getAddedFeaturesCancelable() CancelableOperation<FeatureQueryResult>
Cancelable version of getAddedFeatures. See that method for more information.
inherited
getAddedFeaturesCount() Future<int>
Returns the number of features added since the last sync.
inherited
getAddedFeaturesCountCancelable() CancelableOperation<int>
Cancelable version of getAddedFeaturesCount. See that method for more information.
inherited
getDeletedFeatures() Future<FeatureQueryResult>
Returns the features deleted since the last sync.
inherited
getDeletedFeaturesCancelable() CancelableOperation<FeatureQueryResult>
Cancelable version of getDeletedFeatures. See that method for more information.
inherited
getDeletedFeaturesCount() Future<int>
Returns the number of features deleted since the last sync.
inherited
getDeletedFeaturesCountCancelable() CancelableOperation<int>
Cancelable version of getDeletedFeaturesCount. See that method for more information.
inherited
getFeatureTemplate({required String name}) FeatureTemplate?
Searches for the feature template with the given name.
inherited
getFeatureType({required String name}) FeatureType?
Searches for the feature type with the given name.
inherited
getField({required String fieldName}) Field?
Retrieves the field with the given name.
inherited
getLocalEdits() Future<LocalFeatureEditsResult>
Returns all the features that were added, updated or deleted since the last sync.
inherited
getLocalEditsCancelable() CancelableOperation<LocalFeatureEditsResult>
Cancelable version of getLocalEdits. See that method for more information.
inherited
getLocalEditsCount() Future<int>
Returns the number of features that were added, updated or deleted since the last sync.
inherited
getLocalEditsCountCancelable() CancelableOperation<int>
Cancelable version of getLocalEditsCount. See that method for more information.
inherited
getRelatedTables() List<ArcGISFeatureTable>
Returns a list of all related tables that have been added to the map.
inherited
getRelatedTablesWithRelationshipInfo({required RelationshipInfo relationshipInfo}) List<ArcGISFeatureTable>
Returns list of tables related by the given relationship info.
inherited
getUpdatedFeatures() Future<FeatureQueryResult>
Returns the features updated since the last sync.
inherited
getUpdatedFeaturesCancelable() CancelableOperation<FeatureQueryResult>
Cancelable version of getUpdatedFeatures. See that method for more information.
inherited
getUpdatedFeaturesCount() Future<int>
Returns the number of features updated since the last sync.
inherited
getUpdatedFeaturesCountCancelable() CancelableOperation<int>
Cancelable version of getUpdatedFeaturesCount. See that method for more information.
inherited
hasLocalEdits() bool
Checks whether the feature table has local edits.
inherited
load() Future<void>
Loads the metadata for the object asynchronously.
inherited
loadOrRefreshFeatures({required List<Feature> features}) Future<void>
Loads all attributes and geometries for features that have not been loaded and fetches attributes and geometries for previously loaded features.
loadOrRefreshFeaturesCancelable({required List<Feature> features}) CancelableOperation<void>
Cancelable version of loadOrRefreshFeatures. See that method for more information.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
populateFromService({required QueryParameters parameters, required bool clearCache, required List<String> outFields}) Future<FeatureQueryResult>
Queries the feature service and places the resulting features in the local table, which is cached for the duration of the session. The ServiceFeatureTable must have its ServiceFeatureTable.featureRequestMode set to FeatureRequestMode.manualCache.
populateFromServiceCancelable({required QueryParameters parameters, required bool clearCache, required List<String> outFields}) CancelableOperation<FeatureQueryResult>
Cancelable version of populateFromService. See that method for more information.
queryExtent({required QueryParameters queryParameters}) Future<Envelope>
Determines the minimum bounding envelope that contains features satisfying the provided query parameters.
inherited
queryExtentCancelable({required QueryParameters queryParameters}) CancelableOperation<Envelope>
Cancelable version of queryExtent. See that method for more information.
inherited
queryFeatureCount({required QueryParameters queryParameters}) Future<int>
Determines the count of features that satisfy the provided query parameters.
inherited
queryFeatureCountCancelable({required QueryParameters queryParameters}) CancelableOperation<int>
Cancelable version of queryFeatureCount. See that method for more information.
inherited
queryFeatures({required QueryParameters parameters}) Future<FeatureQueryResult>
Submits a query against the table.
inherited
queryFeaturesCancelable({required QueryParameters parameters}) CancelableOperation<FeatureQueryResult>
Cancelable version of queryFeatures. See that method for more information.
inherited
queryFeaturesWithFieldOptions({required QueryParameters parameters, required QueryFeatureFields queryFeatureFields}) Future<FeatureQueryResult>
Queries features from this table's cache and/or from the feature service used to create this table.
queryFeaturesWithFieldOptionsCancelable({required QueryParameters parameters, required QueryFeatureFields queryFeatureFields}) CancelableOperation<FeatureQueryResult>
Cancelable version of queryFeaturesWithFieldOptions. See that method for more information.
queryRelatedFeatureCount({required ArcGISFeature feature, RelatedQueryParameters? parameters}) Future<int>
Performs a query that returns the number of related features to supplied feature based on the parameters.
inherited
queryRelatedFeatureCountCancelable({required ArcGISFeature feature, RelatedQueryParameters? parameters}) CancelableOperation<int>
Cancelable version of queryRelatedFeatureCount. See that method for more information.
inherited
queryRelatedFeatures({required ArcGISFeature feature, RelatedQueryParameters? parameters}) Future<List<RelatedFeatureQueryResult>>
Queries for related features of a given feature in a specific relationship.
inherited
queryRelatedFeaturesCancelable({required ArcGISFeature feature, RelatedQueryParameters? parameters}) CancelableOperation<List<RelatedFeatureQueryResult>>
Cancelable version of queryRelatedFeatures. See that method for more information.
inherited
queryRelatedFeaturesWithFieldOptions({required ArcGISFeature feature, required RelatedQueryParameters parameters, required QueryFeatureFields queryFeatureFields}) Future<List<RelatedFeatureQueryResult>>
Queries for related features in this service feature table using the provided parameters and query feature fields. See ServiceFeatureTable.queryFeaturesWithFieldOptions for more details.
queryRelatedFeaturesWithFieldOptionsCancelable({required ArcGISFeature feature, required RelatedQueryParameters parameters, required QueryFeatureFields queryFeatureFields}) CancelableOperation<List<RelatedFeatureQueryResult>>
Cancelable version of queryRelatedFeaturesWithFieldOptions. See that method for more information.
queryStatistics({required StatisticsQueryParameters statisticsQueryParameters}) Future<StatisticsQueryResult>
Calculates values for the requested statistics.
inherited
queryStatisticsCancelable({required StatisticsQueryParameters statisticsQueryParameters}) CancelableOperation<StatisticsQueryResult>
Cancelable version of queryStatistics. See that method for more information.
inherited
retryLoad() Future<void>
Loads or retries loading metadata for the object asynchronously.
inherited
toString() String
A string representation of this object.
inherited
undoLocalEdits() Future<void>
Undoes all of the local edits since the last server acknowledgment.
undoLocalEditsCancelable() CancelableOperation<void>
Cancelable version of undoLocalEdits. See that method for more information.
updateFeature(Feature feature) Future<void>
Updates a feature in the table.
inherited
updateFeatureCancelable(Feature feature) CancelableOperation<void>
Cancelable version of updateFeature. See that method for more information.
inherited
updateFeatures(List<Feature> features) Future<void>
Updates a collection of features in the table.
inherited
updateFeaturesCancelable(List<Feature> features) CancelableOperation<void>
Cancelable version of updateFeatures. See that method for more information.
inherited
validateRelationshipConstraints({required ArcGISFeature feature}) Future<RelationshipConstraintViolationType>
Validates constraints for a given feature participating in a relationship.
inherited
validateRelationshipConstraintsCancelable({required ArcGISFeature feature}) CancelableOperation<RelationshipConstraintViolationType>
Cancelable version of validateRelationshipConstraints. See that method for more information.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited