Click or drag to resize

FeatureCollectionTable Class

A user-defined feature table that can be stored in a FeatureCollection for saving or sharing.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.DataFeatureTable
    Esri.ArcGISRuntime.DataFeatureCollectionTable

Namespace:  Esri.ArcGISRuntime.Data
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
C#
public class FeatureCollectionTable : FeatureTable, 
	IFeatureSet, IEnumerable

The FeatureCollectionTable type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyDisplayName
Gets or sets the table's display name.
(Inherited from FeatureTable.)
Public propertyCode exampleExtent
Gets the geographic extent of features within the table.
(Inherited from FeatureTable.)
Public propertyFeatureLayer
Gets the FeatureLayer this table is associated with, or created from, if any.
(Inherited from FeatureTable.)
Public propertyCode exampleFields
Gets the fields of the feature table.
(Inherited from FeatureTable.)
Public propertyCode exampleGeometryType
Gets the GeometryType of features in this table.
(Inherited from FeatureTable.)
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 propertyLayer
Gets the layer this table is associated with, or created from, if any.
(Inherited from FeatureTable.)
Public propertyLayerInfo
Gets the ArcGISFeatureLayerInfo of this feature table.
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 propertyPopupDefinition
Gets or sets the pop-up definition for the table.
(Inherited from FeatureTable.)
Public propertyCode exampleRenderer
Gets or sets the renderer to use when rendering this feature collection table in a FeatureLayer.
Public propertySpatialReference
Gets the SpatialReference of this table.
(Inherited from FeatureTable.)
Public propertyCode exampleTableName
Gets the name of the table.
(Inherited from FeatureTable.)
Public propertyTitle
Gets or sets a title for the feature collection table.
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 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 methodCode exampleCreateFeature
Creates a new feature.
(Inherited from FeatureTable.)
Public methodCreateFeature(IEnumerableKeyValuePairString, Object, Geometry)
Creates a new feature with specified attributes and geometry.
(Inherited from FeatureTable.)
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 methodGetField
Gets the associated Field with specified field name.
(Inherited from FeatureTable.)
Public methodGetSymbolOverride
Gets the symbol override for the given feature in the feature collection table.
Public methodCode exampleLoadAsync
Asynchronously initiates loading of this table.
(Inherited from FeatureTable.)
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 exampleQueryStatisticsAsync
Calculates values for the requested statistics.
(Inherited from FeatureTable.)
Public methodRetryLoadAsync
Asynchronously retries loading of this table table.
(Inherited from FeatureTable.)
Public methodSetSymbolOverride
Sets the symbol override for the given feature in the feature collection table.
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.)
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
Examples

Android

Example Name: FeatureCollectionLayerFromQuery

Create a feature collection layer to show a query result from a service feature table. The feature collection is then displayed on a map with a feature collection layer.

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 Android.App;
using Android.OS;
using Android.Widget;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI.Controls;
using System;

namespace ArcGISRuntime.Samples.FeatureCollectionLayerFromQuery
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Feature collection layer from query result",
        "Layers",
        "This sample demonstrates how to create a feature collection layer to show a query result from a service feature table.",
        "")]
    public class FeatureCollectionLayerFromQuery : Activity
    {
        // Hold a reference to the map view.
        private MapView _myMapView;

        // Service endpoint to query for features
        private const string FeatureLayerUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0";

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Title = "Add a query result as a feature collection layer";

            // Create the UI
            CreateLayout();

            // Initialize the app
            Initialize();
        }

        private void Initialize()
        {
            // Create a new map with the oceans basemap and add it to the map view
            Map myMap = new Map(Basemap.CreateOceans());
            _myMapView.Map = myMap;

            // Call a function that will create a new feature collection layer from a service query
            GetFeaturesFromQuery();
        }

        private async void GetFeaturesFromQuery()
        {
            try
            {
                // Create a service feature table to get features from
                ServiceFeatureTable featTable = new ServiceFeatureTable(new Uri(FeatureLayerUrl));

                // Create a query to get all features in the table
                QueryParameters queryParams = new QueryParameters
                {
                    WhereClause = "1=1"
                };

                // Query the table to get all features
                FeatureQueryResult featureResult = await featTable.QueryFeaturesAsync(queryParams);

                // Create a new feature collection table from the result features
                FeatureCollectionTable collectTable = new FeatureCollectionTable(featureResult);

                // Create a feature collection and add the table
                FeatureCollection featCollection = new FeatureCollection();
                featCollection.Tables.Add(collectTable);

                // Create a layer to display the feature collection, add it to the map's operational layers
                FeatureCollectionLayer featCollectionTable = new FeatureCollectionLayer(featCollection);
                _myMapView.Map.OperationalLayers.Add(featCollectionTable);
            }
            catch (Exception e)
            {
                new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
            }
        }

        private void CreateLayout()
        {
            // Create a new layout
            LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };

            // Add the map view to the layout
            _myMapView = new MapView(this);
            layout.AddView(_myMapView);

            // Show the layout in the app
            SetContentView(layout);
        }
    }
}
Examples

Xamarin Forms Android

Example Name: FeatureCollectionLayerFromQuery

Create a feature collection layer to show a query result from a service feature table. The feature collection is then displayed on a map with a feature collection layer.

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 System;
using Xamarin.Forms;

namespace ArcGISRuntime.Samples.FeatureCollectionLayerFromQuery
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "Feature collection layer from query result",
        "Layers",
        "This sample demonstrates how to create a feature collection layer to show a query result from a service feature table.",
        "")]
    public partial class FeatureCollectionLayerFromQuery : ContentPage
    {
        // Feature service URL to query for features
        private const string FeatureLayerUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0";

        public FeatureCollectionLayerFromQuery()
        {
            InitializeComponent();

            // call a function to initialize a map to display in the MyMapView control
            Initialize();
        }

        private void Initialize()
        {
            // Create a new map with the oceans basemap and add it to the map view
            Map myMap = new Map(Basemap.CreateOceans());
            MyMapView.Map = myMap;

            // Call a function that will create a new feature collection layer from a service query
            GetFeaturesFromQuery();
        }

        private async void GetFeaturesFromQuery()
        {
            try
            {
                // Create a service feature table to get features from
                ServiceFeatureTable featTable = new ServiceFeatureTable(new Uri(FeatureLayerUrl));

                // Create a query to get all features in the table
                QueryParameters queryParams = new QueryParameters
                {
                    WhereClause = "1=1"
                };

                // Query the table to get all features
                FeatureQueryResult featureResult = await featTable.QueryFeaturesAsync(queryParams);

                // Create a new feature collection table from the result features
                FeatureCollectionTable collectTable = new FeatureCollectionTable(featureResult);

                // Create a feature collection and add the table
                FeatureCollection featCollection = new FeatureCollection();
                featCollection.Tables.Add(collectTable);

                // Create a layer to display the feature collection, add it to the map's operational layers
                FeatureCollectionLayer featCollectionTable = new FeatureCollectionLayer(featCollection);
                MyMapView.Map.OperationalLayers.Add(featCollectionTable);
            }
            catch (Exception e)
            {
                await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK");
            }
        }
    }
}
XAML
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.FeatureCollectionLayerFromQuery.FeatureCollectionLayerFromQuery"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
             xmlns:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime">
  <Grid>
    <esriUI:MapView x:Name="MyMapView"/>
  </Grid>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
AnalyzeViewshedCalculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.
CreateFeatureCollectionLayerCreate a Feature Collection Layer from a Feature Collection Table, and add it to a map.
FeatureCollectionLayerFromQueryCreate a feature collection layer to show a query result from a service feature table. The feature collection is then displayed on a map with a feature collection layer.