Click or drag to resize

ServiceFeatureTable Class

Represents a feature table created from the URL to an ArcGIS feature service.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Data
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.9.0
Syntax
public sealed class ServiceFeatureTable : ArcGISFeatureTable

The ServiceFeatureTable type exposes the following members.

Constructors
  NameDescription
Public methodServiceFeatureTable
Initializes a new instance of the ServiceFeatureTable class.
Public methodCode exampleServiceFeatureTable(Uri)
Initializes a new instance of the ServiceFeatureTable class.
Public methodServiceFeatureTable(Item, Int64)
Initializes a new instance of the ServiceFeatureTable class from an ArcGIS Item.
Public methodServiceFeatureTable(ServiceFeatureTable, RelationshipInfo)
Initializes a new instance of the ServiceFeatureTable class.
Top
Properties
  NameDescription
Public propertyBufferFactor
Gets or sets the factor used to calculate a buffered extent around the current visible area when requesting new features from the service.
Public propertyCredential
Gets or sets the security credential used to access the remote table
Public propertyDefaultSubtypeCode
Gets the table's default subtype code.
(Inherited from ArcGISFeatureTable.)
Public propertyDefinitionExpression
Gets or sets the expression which is a SQL statement WHERE clause to filter out the features to be queried.
Public propertyDisplayName
Gets or sets the table's display name.
(Inherited from FeatureTable.)
Public propertyEditableAttributeFields
Gets the editable fields of this feature table.
(Inherited from ArcGISFeatureTable.)
Public propertyCode exampleExtent
Gets the geographic extent of features within the table.
(Inherited from FeatureTable.)
Public propertyFeatureLayer Obsolete.
Gets the FeatureLayer this table is associated with, or created from, if any.
(Inherited from FeatureTable.)
Public propertyCode exampleFeatureRequestMode
Gets or sets the mode defining when features are requested from the service.
Public propertyFeatureSubtypes
Gets a list of FeatureSubtype of this feature table.
(Inherited from ArcGISFeatureTable.)
Public propertyFeatureTemplates
Gets a list of FeatureTemplate of this feature table.
(Inherited from ArcGISFeatureTable.)
Public propertyFeatureTypes
Gets a list of FeatureType of this feature table.
(Inherited from ArcGISFeatureTable.)
Public propertyCode exampleFields
Gets the fields of the feature table.
(Inherited from FeatureTable.)
Public propertyGeodatabaseVersion
Gets or sets the geodatabase version.
Public propertyCode exampleGeometryType
Gets the GeometryType of features in this table.
(Inherited from FeatureTable.)
Public propertyGlobalIdField
Gets the name of the global ID field.
(Inherited from ArcGISFeatureTable.)
Public propertyHasAttachments
Gets a value indicating whether table supports attachments.
(Inherited from ArcGISFeatureTable.)
Public propertyHasGeometry
Gets a value indicating whether this table has geometry data.
(Inherited from FeatureTable.)
Public propertyHasM
Gets a value indicating whether the shapefile geometries have M values.
(Inherited from FeatureTable.)
Public propertyHasZ
Gets a value indicating whether the shapefile geometries have Z values.
(Inherited from FeatureTable.)
Public propertyIsEditable
Gets a value indicating whether this table is editable.
(Inherited from FeatureTable.)
Public propertyIsPopupEnabled
Gets or sets a value indicating whether the PopupDefinition defined is enabled.
(Inherited from FeatureTable.)
Public propertyItem
Gets the ArcGIS Item
Public propertyLayer
Gets the layer this table is associated with, or created from, if any.
(Inherited from FeatureTable.)
Public propertyCode exampleLayerInfo
Gets the ArcGISFeatureLayerInfo of this feature table.
(Inherited from ArcGISFeatureTable.)
Public propertyLoadError
Gets the exception associated with a failed load. This property remains null if load is successful.
(Inherited from FeatureTable.)
Public propertyCode exampleLoadStatus
Gets the current load status.
(Inherited from FeatureTable.)
Public propertyNumberOfFeatures
Gets the number of features in this table.
(Inherited from FeatureTable.)
Public propertyObjectIdField
Gets the name of the object ID field.
(Inherited from ArcGISFeatureTable.)
Public propertyPopupDefinition
Gets or sets the pop-up definition for the table.
(Inherited from FeatureTable.)
Public propertyServiceGeodatabase
Gets the ServiceGeodatabase this service feature table is part of.
Public propertyCode exampleServiceLayerId
Returns the layer ID in the feature service that this table was created from.
(Inherited from ArcGISFeatureTable.)
Public propertySource
Gets or sets the ArcGIS REST service endpoint.
Public propertySpatialReference
Gets the SpatialReference of this table.
(Inherited from FeatureTable.)
Public propertySubtypeField
Gets the table's subtype field.
(Inherited from ArcGISFeatureTable.)
Public propertyCode exampleTableName
Gets the name of the table.
(Inherited from FeatureTable.)
Public propertyTypeIdField
Gets the name of the type ID field.
(Inherited from ArcGISFeatureTable.)
Public propertyUnknownJson
Gets unknown data from the source JSON.
(Inherited from ArcGISFeatureTable.)
Public propertyUnsupportedJson
Gets unsupported data from the source JSON.
(Inherited from ArcGISFeatureTable.)
Public propertyUseAdvancedSymbology
Gets or sets a value indicating whether advanced symbology is used.
(Inherited from ArcGISFeatureTable.)
Top
Methods
  NameDescription
Public methodCode exampleAddFeatureAsync
Asynchronously adds new Feature to the table.
(Inherited from FeatureTable.)
Public methodAddFeaturesAsync
Asynchronously adds the set of Features to the table.
(Inherited from FeatureTable.)
Public methodCode exampleApplyEditsAsync
Asynchronously uploads any changes to the local table to the feature service.
Public methodApplyEditsAsync(CancellationToken)
Asynchronously uploads any changes to the local table to the feature service.
Public methodCanAdd
Determines if a feature can be added to the table.
(Inherited from FeatureTable.)
Public methodCancelLoad
Cancel the previous load operation,
(Inherited from FeatureTable.)
Public methodCanDelete
Determines if the specified Feature can be deleted from the table.
(Inherited from FeatureTable.)
Public methodCanEditGeometry
Determines if the table allows for the geometry field to be modified.
(Inherited from FeatureTable.)
Public methodCanUpdate
Determines if the specified Feature can be updated on the table.
(Inherited from FeatureTable.)
Public methodClearCache
Clears cached data.
Public methodCode exampleCreateFeature
Creates a new feature.
(Inherited from FeatureTable.)
Public methodCreateFeature(FeatureSubtype)
Creates and returns a new ArcGISFeature based on the specified FeatureSubtype.
(Inherited from ArcGISFeatureTable.)
Public methodCreateFeature(FeatureTemplate)
Creates and returns a new ArcGISFeature based on the specified FeatureTemplate.
(Inherited from ArcGISFeatureTable.)
Public methodCreateFeature(FeatureType)
Creates and returns a new ArcGISFeature based on the specified FeatureType.
(Inherited from ArcGISFeatureTable.)
Public methodCreateFeature(IEnumerableKeyValuePairString, Object, Geometry)
Creates a new feature with specified attributes and geometry.
(Inherited from FeatureTable.)
Public methodCreateFeature(FeatureSubtype, Geometry)
Creates and returns a new ArcGISFeature based on the specified FeatureSubtype and Geometry.
(Inherited from ArcGISFeatureTable.)
Public methodCreateFeature(FeatureTemplate, Geometry)
Creates and returns a new ArcGISFeature based on the specified FeatureTemplate and Geometry.
(Inherited from ArcGISFeatureTable.)
Public methodCreateFeature(FeatureType, Geometry)
Creates and returns a new ArcGISFeature based on the specified FeatureType and Geometry.
(Inherited from ArcGISFeatureTable.)
Public methodCode exampleDeleteFeatureAsync
Asynchronously deletes new Feature from the table.
(Inherited from FeatureTable.)
Public methodDeleteFeaturesAsync
Asynchronously deletes the set of Features from the table.
(Inherited from FeatureTable.)
Public methodGetAddedFeaturesAsync
Retrieves the features added since the last sync.
(Inherited from ArcGISFeatureTable.)
Public methodGetAddedFeaturesCountAsync
Retrieves the number of features added since the last sync.
(Inherited from ArcGISFeatureTable.)
Public methodGetDeletedFeaturesAsync
Retrieves the features deleted since the last sync.
(Inherited from ArcGISFeatureTable.)
Public methodGetDeletedFeaturesCountAsync
Retrieves the number of features deleted since the last sync.
(Inherited from ArcGISFeatureTable.)
Public methodGetFeatureTemplate
Retrieves the FeatureTemplate associated with the specified feature template name.
(Inherited from ArcGISFeatureTable.)
Public methodGetFeatureType
Retrieves the FeatureType associated with the specified feature type name.
(Inherited from ArcGISFeatureTable.)
Public methodGetField
Gets the associated Field with specified field name.
(Inherited from FeatureTable.)
Public methodGetRelatedTables
Returns a list of all related tables that have been added to the map.
(Inherited from ArcGISFeatureTable.)
Public methodGetRelatedTables(RelationshipInfo)
Returns list of tables related by the given relationship info.
(Inherited from ArcGISFeatureTable.)
Public methodGetUpdatedFeaturesAsync
Retrieves the features updated since the last sync. This set of features exists on server but were updated locally and have not yet been submitted to server.
(Inherited from ArcGISFeatureTable.)
Public methodGetUpdatedFeaturesCountAsync
Retrieves the number of features updated since the last sync.
(Inherited from ArcGISFeatureTable.)
Public methodHasLocalEdits
Checks whether the feature table has local edits.
(Inherited from ArcGISFeatureTable.)
Public methodCode exampleLoadAsync
Asynchronously initiates loading of this table.
(Inherited from FeatureTable.)
Public methodLoadOrRefreshFeaturesAsync
Loads all attributes and geometries for unloaded features, and re-fetches attributes and geometries for previously loaded features. All features loaded or refreshed by this method will have m-values if defined by the service. Note that an m-value might be NaN.
Public methodCode examplePopulateFromServiceAsync(QueryParameters, Boolean, IEnumerableString)
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 FeatureRequestMode set to ManualCache.
Public methodPopulateFromServiceAsync(QueryParameters, Boolean, IEnumerableString, CancellationToken)
Asynchronously performs manual query of data from the service and imports feature results into the table.
Public methodCode exampleQueryExtentAsync
Asynchronously queries the extent of all features that satisfy the provided parameters.
(Inherited from FeatureTable.)
Public methodCode exampleQueryFeatureCountAsync
Asynchronously queries the count of all features that satisfy the provided parameters.
(Inherited from FeatureTable.)
Public methodCode exampleQueryFeaturesAsync(QueryParameters)
Asynchronously performs query against the table.
(Inherited from FeatureTable.)
Public methodQueryFeaturesAsync(QueryParameters, CancellationToken)
Asynchronously performs query against the table.
(Inherited from FeatureTable.)
Public methodCode exampleQueryFeaturesAsync(QueryParameters, QueryFeatureFields)
Queries features from this table's cache and/or from the feature service used to create this table.
Public methodQueryFeaturesAsync(QueryParameters, QueryFeatureFields, CancellationToken)
Asynchronously submits a query against the table.
Public methodQueryRelatedFeatureCountAsync(ArcGISFeature)
Asynchronously queries for the number of related features to the supplied feature.
(Inherited from ArcGISFeatureTable.)
Public methodQueryRelatedFeatureCountAsync(ArcGISFeature, RelatedQueryParameters)
Asynchronously queries for the number of related features to the supplied feature based on the parameters.
(Inherited from ArcGISFeatureTable.)
Public methodCode exampleQueryRelatedFeaturesAsync(ArcGISFeature)
Asynchronously queries for related features of a given feature in all relationships.
(Inherited from ArcGISFeatureTable.)
Public methodCode exampleQueryRelatedFeaturesAsync(ArcGISFeature, RelatedQueryParameters)
Asynchronously queries for related features of a given feature in a specific relationship.
(Inherited from ArcGISFeatureTable.)
Public methodQueryRelatedFeaturesAsync(ArcGISFeature, RelatedQueryParameters, QueryFeatureFields)
Asynchronously queries for related features in this service feature table using the provided parameters and query feature fields. See QueryFeaturesAsync(QueryParameters, QueryFeatureFields) for more details.
Public methodCode exampleQueryStatisticsAsync
Calculates values for the requested statistics.
(Inherited from FeatureTable.)
Public methodRetryLoadAsync
Asynchronously retries loading of this table table.
(Inherited from FeatureTable.)
Public methodUndoLocalEditsAsync
Undoes all of the local edits since the last server acknowledgment.
Public methodCode exampleUpdateFeatureAsync
Asynchronously updates new Feature on the table.
(Inherited from FeatureTable.)
Public methodUpdateFeaturesAsync
Asynchronously updates the set of Features on the table.
(Inherited from FeatureTable.)
Public methodValidateRelationshipConstraintsAsync
Asynchronously validates constraints for a given feature participating in a relationship. In a composite relationship, adding an orphan feature to the destination table without relating it to an origin feature. Cardinality Violations: In 1:1 relationships, if an origin feature is already related to a destination feature, relating another feature to either of them. In 1:n relationships, relating a destination feature to more than one origin feature. To recover from an orphaned destination feature violation, simply relate it to a valid origin feature. You can usually recover from a cardinality violation by unrelating the appropriate features. Also, see UnrelateFeature(ArcGISFeature) Note that edit operations do not error when there are constraint violations. This allows you to recover from violations in a back office operation after applying edits or syncing, if you choose to do so. See ArcGIS Desktop Validate Features process here. Note: This method makes network calls to query for the related features if they are not present locally.
(Inherited from ArcGISFeatureTable.)
Top
Events
  NameDescription
Public eventCode exampleLoaded
Occurs when the table is loaded.
(Inherited from FeatureTable.)
Public eventCode exampleLoadStatusChanged
Occurs when the table LoadStatus is changed.
(Inherited from FeatureTable.)
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from FeatureTable.)
Top
Remarks

A service feature table has a FeatureRequestMode, which controls (1) whether features are cached locally (for quicker access by map and scene layers) and (2) whether queries are performed on the local cache or on the server. You can retrieve or modify a table's feature request mode using FeatureRequestMode.

If the table's mode is OnInteractionCache, features are requested from the server in response to user or developer interaction (pan or zoom) and are cached locally. Queries are executed on the cache or (if requested features are not resident in the cache) on the server. This mode is the default.

If the table's mode is OnInteractionNoCache, features are always requested from the server. Features are not cached, and all queries are executed on the server.

If the table's mode is ManualCache, you must call PopulateFromServiceAsync(QueryParameters, Boolean, IEnumerableString), which populates the local table with the features specified by QueryParameters and containing the attributes specified by IEnumerableT. Features are cached for the duration of the session and queries are executed against the cache.

If the table's feature request mode is OnInteractionCache or OnInteractionNoCache, ArcGIS features in the table initially contain a minimum set of attributes and geometry that omits any m-values. This is an optimization for faster rendering. To access all attributes (and geometry with m-values) in features you get from a query, do one of the following:

When used to create a FeatureLayer in a [!:Esri.ArcGISRuntime.UI.Controls.MapView], features are requested from the services in the correct spatial reference to match the spatial reference of the map.

You can use a service feature table to access non-spatial tables from feature services where HasGeometry is false. The feature request mode of the table must be ManualCache, and you must call PopulateFromServiceAsync(QueryParameters, Boolean, IEnumerableString).

The parent class definition allows a service feature table to have editable attribute fields, feature templates, feature types, and editing capabilities defined in Capabilities. See FeatureTemplate and FeatureType.

A service feature table might require authentication to access the service.

Examples

WPF

Example Name: DisplayDrawingStatus

Get the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.

Code example screen shot.

C#
// Copyright 2016 Esri.
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific 
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI;
using System;
using System.Windows.Threading;

namespace ArcGISRuntime.WPF.Samples.DisplayDrawingStatus
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Display draw status",
        category: "MapView",
        description: "Get the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.",
        instructions: "Pan and zoom around the map. Observe how the status changes from a loading animation to solid, indicating that drawing has completed.",
        tags: new[] { "draw", "loading", "map", "render" })]
    public partial class DisplayDrawingStatus
    {
        public DisplayDrawingStatus()
        {
            InitializeComponent();

            // Create the UI, setup the control references and execute initialization 
            Initialize();
        }

        private void Initialize()
        {
            // Hook up the DrawStatusChanged event
            MyMapView.DrawStatusChanged += OnDrawStatusChanged;

            // Create new Map with basemap
            Map myMap = new Map(BasemapType.Topographic, 34.056, -117.196, 4);

            // Create uri to the used feature service
            Uri serviceUri = new Uri(
                "https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0");

            // Initialize a new feature layer
            ServiceFeatureTable myFeatureTable = new ServiceFeatureTable(serviceUri);
            FeatureLayer myFeatureLayer = new FeatureLayer(myFeatureTable);

            // Add the feature layer to the Map
            myMap.OperationalLayers.Add(myFeatureLayer);

            // Provide used Map to the MapView
            MyMapView.Map = myMap;
        }

        private void OnDrawStatusChanged(object sender, DrawStatusChangedEventArgs e)
        {
            // Update the load status information
            Dispatcher.Invoke(delegate ()
            {
                // Show the activity indicator if the map is drawing
                if (e.Status == DrawStatus.InProgress)
                {
                    ActivityIndicator.IsEnabled = true;
                    ActivityIndicator.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    ActivityIndicator.IsEnabled = false;
                    ActivityIndicator.Visibility = System.Windows.Visibility.Collapsed;
                }
            });
        }
    }
}
XAML
<UserControl x:Class="ArcGISRuntime.WPF.Samples.DisplayDrawingStatus.DisplayDrawingStatus"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <esri:MapView x:Name="MyMapView" />
        <Border Style="{StaticResource BorderStyle}">
            <StackPanel>
                <TextBlock Text="Pan and zoom to see drawing status changes."
                           FontWeight="SemiBold" TextAlignment="Center" />
                <ProgressBar x:Name="ActivityIndicator"
                             IsIndeterminate="True"
                             Height="20" Margin="0,5,0,0"
                             HorizontalAlignment="Stretch" />
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
See Also
Additional Examples
Hyperlink to ExampleDescription
AddFeaturesAdd features to a feature layer.
ChangeFeatureLayerRendererChange the appearance of a feature layer with a renderer.
ClosestFacilityStaticFind routes from several locations to the respective closest facility.
DeleteFeaturesDelete features from an online feature service.
DisplayAnnotationDisplay annotation from a feature service URL.
DisplayDrawingStatusGet the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.
DisplaySubtypeFeatureLayerDisplays a composite layer of all the subtype values in a feature class.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
EditFeatureAttachmentsAdd, delete, and download attachments for features from a service.
FeatureCollectionLayerFromQueryCreate a feature collection layer to show a query result from a service feature table.
FeatureLayerDefinitionExpressionLimit the features displayed on a map with a definition expression.
FeatureLayerExtrusionExtrude features based on their attributes.
FeatureLayerQueryFind features in a feature table which match an SQL query.
FeatureLayerRenderingModeMapRender features statically or dynamically by setting the feature layer rendering mode.
FeatureLayerRenderingModeSceneRender features in a scene statically or dynamically by setting the feature layer rendering mode.
FeatureLayerSelectionSelect features in a feature layer.
FindServiceAreasForMultipleFacilitiesFind the service areas of several facilities from a feature service.
GenerateGeodatabaseGenerate a local geodatabase from an online feature service.
GenerateOfflineMapWithOverridesTake a web map offline with additional options for each layer.
LocalServerFeatureLayerStart a local feature service and display its features in a map.
MapImageLayerTablesFind features in a spatial table related to features in a non-spatial table.
MapImageSublayerQueryFind features in a sublayer based on attributes and location.
QueryFeatureCountAndExtentZoom to features matching a query and count the features in the current visible extent.
RenderUniqueValuesRender features in a layer using a distinct symbol for each unique attribute value.
ServiceFeatureTableCacheDisplay a feature layer from a service using the **on interaction cache** feature request mode.
ServiceFeatureTableManualCacheDisplay a feature layer from a service using the **manual cache** feature request mode.
ServiceFeatureTableNoCacheDisplay a feature layer from a service using the **no cache** feature request mode.
ShowLabelsOnLayerDisplay custom labels on a feature layer.
StatisticalQueryQuery a table to get aggregated statistics back for a specific field.
StatsQueryGroupAndSortQuery a feature table for statistics, grouping and sorting by different fields.
TimeBasedQueryQuery data using a time extent.
UpdateAttributesUpdate feature attributes in an online feature service.
UpdateGeometriesUpdate a feature's location in an online feature service.