FeatureCollection Class

(Esri::ArcGISRuntime::FeatureCollection)

A container for a collection of FeatureCollectionTables. More...

Header: #include <FeatureCollection>
Since: Esri::ArcGISRuntime 100.0
Inherits: Object, Loadable, and JsonSerializable

Public Functions

FeatureCollection(QObject *parent = nullptr)
FeatureCollection(Item *item, QObject *parent = nullptr)
FeatureCollection(const QList<FeatureCollectionTable *> &featureCollectionTables, QObject *parent = nullptr)
~FeatureCollection()
Item *item() const
QUuid save()
QUuid saveAs(Portal *portal, const QString &title, const QStringList &tags, const PortalFolder &folder = PortalFolder(), const QString &description = QString(), const QByteArray &thumbnailBytes = QByteArray())
FeatureCollectionTableListModel *tables() const

Reimplemented Public Functions

virtual void cancelLoad()
virtual void load()
virtual Error loadError() const
virtual LoadStatus loadStatus() const
virtual void retryLoad()
virtual QString toJson() const
virtual QJsonObject unknownJson() const
virtual QJsonObject unsupportedJson() const

Signals

void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
void saveAsCompleted(QUuid taskId, bool succeeded)
void saveCompleted(QUuid taskId, bool succeeded)

Static Public Members

FeatureCollection *fromJson(const QString &json, QObject *parent = nullptr)
  • 10 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

A container for a collection of FeatureCollectionTables.

Represents a collection of features, usually contained in a web map (by-value) or portal item (by-reference). The features are stored in a FeatureCollection as a collection of FeatureCollectionTables. Use this object to maintain and serialize collections of features to and from JSON, and to save them to and load them from portal items.

Member Function Documentation

FeatureCollection::FeatureCollection(QObject *parent = nullptr)

Default constructor that accepts an optional parent.

FeatureCollection::FeatureCollection(Item *item, QObject *parent = nullptr)

Constructor that accepts a portal item (item) and an optional parent.

FeatureCollection::FeatureCollection(const QList<FeatureCollectionTable *> &featureCollectionTables, QObject *parent = nullptr)

Constructor that accepts a list of FeatureCollectionTables (featureCollectionTables) and an optional parent.

FeatureCollection::~FeatureCollection()

Destructor.

[virtual] void FeatureCollection::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

[signal] void FeatureCollection::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

  • loadError - Details about any error that may have occurred.

Note: If there is a load error it will also be emitted on the errorOccurred signal.

See also Loadable and Object.

[static] FeatureCollection *FeatureCollection::fromJson(const QString &json, QObject *parent = nullptr)

Creates a new FeatureCollection from its JSON representation.

  • json - The JSON text.
  • parent - The parent QObject (optional).

Item *FeatureCollection::item() const

Gets the item used to create this FeatureCollection.

[virtual] void FeatureCollection::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error FeatureCollection::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus FeatureCollection::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

[signal] void FeatureCollection::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Signal emitted when the loadStatus property changes.

See also Loadable.

[virtual] void FeatureCollection::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

QUuid FeatureCollection::save()

Saves any changes that have been made to the FeatureCollection to the associated PortalItem.

The FeatureCollection must have been constructed using the PortalItem constructor to associate it with a PortalItem object, or must have been previously saved using saveAs.

Updates the FeatureCollection content data on the portal and also updates the portal item properties stored on the portal to match those stored within the FeatureCollection's PortalItem object.

If the portal associated with the item is not loaded, it will be loaded automatically. If the portal requires a credential that has not been supplied, it should be loaded before calling this function.

The FeatureCollection must be loaded to call this function. Calling this function will not force the FeatureCollection to start loading. If the FeatureCollection is not already associated with a PortalItem, calling save will emit errorOccurred.

This function was introduced in Esri::ArcGISRuntime 100.1.

QUuid FeatureCollection::saveAs(Portal *portal, const QString &title, const QStringList &tags, const PortalFolder &folder = PortalFolder(), const QString &description = QString(), const QByteArray &thumbnailBytes = QByteArray())

Saves the FeatureCollection to a new PortalItem.

The FeatureCollection does not need to be associated with an existing PortalItem object. Updates the FeatureCollection content data on the portal, and updates the portal item properties stored on the portal to match those stored within the FeatureCollection's PortalItem object.

The FeatureCollection must be loaded to call this function. Calling this function will not force the FeatureCollection to start loading.

Note: If the FeatureCollection was already associated with a PortalItem object (either because the FeatureCollection was created using a PortalItem or was previously saved), that object will be replaced with a new PortalItem, effectively duplicating the FeatureCollection on the portal.

This function was introduced in Esri::ArcGISRuntime 100.1.

[signal] void FeatureCollection::saveAsCompleted(QUuid taskId, bool succeeded)

Signal emitted when the saveAs operation is completed.

  • taskId - The task ID for the asynchronous operation.
  • succeeded - Whether the operation was successful.

[signal] void FeatureCollection::saveCompleted(QUuid taskId, bool succeeded)

Signal emitted when the save operation is completed.

  • taskId - The task ID for the asynchronous operation.
  • succeeded - Whether the operation was successful.

FeatureCollectionTableListModel *FeatureCollection::tables() const

Returns the list model of tables in this FeatureCollection.

[virtual] QString FeatureCollection::toJson() const

Reimplemented from JsonSerializable::toJson().

Returns this FeatureCollection as JSON.

[virtual] QJsonObject FeatureCollection::unknownJson() const

Reimplemented from JsonSerializable::unknownJson().

Gets unknown JSON data from the source JSON.

Unknown JSON data consists of values that are in the source JSON but not parsed by ArcGIS Runtime.

See also JsonSerializable.

[virtual] QJsonObject FeatureCollection::unsupportedJson() const

Reimplemented from JsonSerializable::unsupportedJson().

Gets the unsupported JSON data from the source JSON.

Unsupported JSON data consists of values that are supported by web maps, but are not exposed through the ArcGIS Runtime API.

See also JsonSerializable.


Feedback on this topic?