Class FeatureCollection
A feature collection represents a lightweight collection of features that can be saved in a map or portal item.
Inheritance
Implements
Namespace: Esri.ArcGISRuntime.Data
Assembly: Esri.ArcGISRuntime.dll
Syntax
public class FeatureCollection : ILoadable
Remarks
A feature collection is typically used to hold features with mixed geometry or unstructured data. The features are stored in feature collection tables, where all the features that belong to a table share the same attribute schema (fields), geometry type, and spatial reference. The feature collection groups these different feature tables together so that you can display and manage them in a single layer.
There are a number of ways to create a feature collection:
- You can build a feature collection in ArcGIS Online by creating a sketch layer and saving it as part of the map. The sketch layer may contain points, lines, polygons, and associated text to describe things in the map. Because they have different schema and geometry types, these features are stored in several distinct feature collection tables.
- You can import features into ArcGIS Online from files, such as CSV or shapefiles, and save them in a separate PortalItem (of type FeatureCollection).
- You can create a FeatureCollection programmatically by constructing an empty FeatureCollectionTable and adding features to the table.
If you need to share the feature collection between several maps or scenes, it is best to store it as a separate portal item. If you need to make frequent (near real-time) edits to features in a collection, consider storing these in a feature service instead, because the feature collection is not refreshed until the map or portal item is reloaded. If features are used by a single map or are not subject to frequent updates, it might be best to store them directly in the map. Edits made to features stored in a map will be saved when the map is saved. Edits made to features stored in a portal item (and loaded into a map, for example) must be explicitly saved to the original portal item.
To render the features in a map or scene, construct a FeatureCollectionLayer using the FeatureCollection and add the layer to the collection of operational layers.
Constructors
Name | Description |
---|---|
FeatureCollection() | Initializes a new instance of the FeatureCollection class. |
FeatureCollection(Item) | Initializes a new instance of the FeatureCollection class. |
FeatureCollection(IEnumerable<FeatureCollectionTable>) | Initializes a new instance of the FeatureCollection class. |
Properties
Name | Description |
---|---|
Item | Gets the ArcGIS Item |
LoadError | Gets the System.Exception associated with the last load error. |
LoadStatus | Gets the load status. |
Tables | Gets the tables in the feature collection. |
Methods
Name | Description |
---|---|
CancelLoad() | Cancel loading metadata for the object. |
FromJson(String) | Serializes this object to a JSON string. |
LoadAsync() | Load the metadata for the object asynchronously. |
RetryLoadAsync() | Loads or retries loading metadata for the object asynchronously. |
SaveAsAsync(ArcGISPortal, PortalFolder, String, String, IEnumerable<String>, RuntimeImage) | Save the FeatureCollection to a new PortalItem. |
SaveAsAsync(ArcGISPortal, PortalFolder, String, String, IEnumerable<String>, RuntimeImage, CancellationToken) | Save the FeatureCollection to a new PortalItem. |
SaveAsync() | Save any changes that have been made to the FeatureCollection to the associated PortalItem. |
SaveAsync(CancellationToken) | Save any changes that have been made to the FeatureCollection to the associated PortalItem. |
ToJson() | Serializes this object to a JSON string. |
Events
Name | Description |
---|---|
Loaded | Event that is raised when the object is done loading. |
LoadStatusChanged | Event that is raised when the LoadStatus property changes. |
See Also
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.6 |
.NET | 100.13 - 200.6 |
.NET Windows | 100.13 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.0 - 200.6 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 200.6 |