FeatureCollection Class

FeatureCollectionTables."> FeatureCollection Class | ArcGISQtCpp
  • FeatureCollection
  • class Esri::ArcGISRuntime::FeatureCollection

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

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

    Public Functions

    FeatureCollection(QObject *parent = nullptr)
    FeatureCollection(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
    FeatureCollection(const QList<Esri::ArcGISRuntime::FeatureCollectionTable *> &featureCollectionTables, QObject *parent = nullptr)
    virtual ~FeatureCollection() override
    Esri::ArcGISRuntime::Item *item() const
    QFuture<void> saveAsAsync(Esri::ArcGISRuntime::Portal *portal, const QString &title, const QStringList &tags, const Esri::ArcGISRuntime::PortalFolder &folder = PortalFolder(), const QString &description = QString(), const QByteArray &thumbnailBytes = QByteArray())
    QFuture<void> saveAsync()
    Esri::ArcGISRuntime::FeatureCollectionTableListModel *tables() const

    Reimplemented Public Functions

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

    Signals

    void doneLoading(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Static Public Members

    Esri::ArcGISRuntime::FeatureCollection *fromJson(const QString &json, QObject *parent = nullptr)

    Detailed Description

    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

    [explicit] FeatureCollection::FeatureCollection(QObject *parent = nullptr)

    Default constructor that accepts an optional parent.

    [explicit] FeatureCollection::FeatureCollection(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)

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

    [explicit] FeatureCollection::FeatureCollection(const QList<Esri::ArcGISRuntime::FeatureCollectionTable *> &featureCollectionTables, QObject *parent = nullptr)

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

    [override virtual] FeatureCollection::~FeatureCollection()

    Destructor.

    [override virtual] void FeatureCollection::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    See Loadable.

    [signal] void FeatureCollection::doneLoading(const 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] Esri::ArcGISRuntime::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).

    Esri::ArcGISRuntime::Item *FeatureCollection::item() const

    Gets the item used to create this FeatureCollection.

    [override virtual] void FeatureCollection::load()

    Reimplements: Loadable::load().

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::Error FeatureCollection::loadError() const

    Reimplements: Loadable::loadError() const.

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::LoadStatus FeatureCollection::loadStatus() const

    Reimplements: Loadable::loadStatus() const.

    See Loadable.

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

    Signal emitted when the loadStatus property changes.

    See also Loadable.

    [override virtual] void FeatureCollection::retryLoad()

    Reimplements: Loadable::retryLoad().

    See Loadable.

    [since Esri::ArcGISRuntime 200.2] QFuture<void> FeatureCollection::saveAsAsync(Esri::ArcGISRuntime::Portal *portal, const QString &title, const QStringList &tags, const Esri::ArcGISRuntime::PortalFolder &folder = PortalFolder(), const QString &description = QString(), const QByteArray &thumbnailBytes = QByteArray())

    Starts an asynchronous operation to save the FeatureCollection to a new PortalItem.

    Once completed, item will be populated with the new portal item. Note that if the feature collection already has a valid item property (either because the feature collection was created using an item or was previously saved), that property will be replaced with a new item, effectively duplicating the feature collection on the portal.

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

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    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 method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    [since Esri::ArcGISRuntime 200.2] QFuture<void> FeatureCollection::saveAsync()

    Starts an asynchronous operation to save any changes that have been made to the FeatureCollection to the associated PortalItem.

    The feature collection must have a valid item property and if the operation was successful the item will be updated with the feature collection. A feature collection has a valid item property if it was created using FeatureCollection or has been previously saved as a new item.

    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 set an error with the associated {QFuture}.

    Canceling the QFuture will not stop this operation from completing, though the QFuture will report that it is canceled and the completion handler will not be called.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    Esri::ArcGISRuntime::FeatureCollectionTableListModel *FeatureCollection::tables() const

    Returns the list model of tables in this FeatureCollection.

    [override virtual] QString FeatureCollection::toJson() const

    Reimplements: JsonSerializable::toJson() const.

    Returns this FeatureCollection as JSON.

    [override virtual] QJsonObject FeatureCollection::unknownJson() const

    Reimplements: JsonSerializable::unknownJson() const.

    Gets unknown JSON data from the source JSON.

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

    See also JsonSerializable.

    [override virtual] QJsonObject FeatureCollection::unsupportedJson() const

    Reimplements: JsonSerializable::unsupportedJson() const.

    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 this API.

    See also JsonSerializable.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.