FeatureCollection class final

A feature collection represents a lightweight collection of features that can be saved in a map or portal item.

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 PortalItemType.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.

Implemented types
Mixed in types

Constructors

FeatureCollection()
Create a feature collection object.
factory
FeatureCollection.fromJson(Map<String, dynamic> json)
factory
FeatureCollection.fromJsonString(String jsonString)
factory
FeatureCollection.withItem(Item item)
Creates a feature collection object from a PortalItem.
factory
FeatureCollection.withTables(List<FeatureCollectionTable> tables)
Creates a feature collection object from a set of feature collection tables.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
item Item?
The item the feature collection has been created from.
getter/setter pair
loadError ArcGISException?
The load error.
no setterinherited
loadStatus LoadStatus
The load status.
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
tables List<FeatureCollectionTable>
The feature collection tables of a feature collection.
no setter

Methods

cancelLoad() → void
Cancels loading metadata for the object.
inherited
load() Future<void>
Loads the metadata for the object asynchronously.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retryLoad() Future<void>
Loads or retries loading metadata for the object asynchronously.
inherited
toJson() Map<String, dynamic>
Returns a JSON representation of this Object in the data type used by jsonDecode.
inherited
toJsonString() String
Returns a JSON representation of this Object as a String.
override
toString() String
A string representation of this object.
inherited

Operators

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