Skip to content

OgcFeatureCollectionTable Class

  • OgcFeatureCollectionTable
  • class Esri::ArcGISRuntime::OgcFeatureCollectionTable

    An OGC API - Features feature-collection table. More...

    Header: #include <OgcFeatureCollectionTable.h>
    Since: Esri::ArcGISRuntime 100.9
    Inherits: Esri::ArcGISRuntime::FeatureTable and Esri::ArcGISRuntime::RemoteResource

    Public Functions

    OgcFeatureCollectionTable(Esri::ArcGISRuntime::OgcFeatureCollectionInfo *featureCollectionInfo, QObject *parent = nullptr)
    OgcFeatureCollectionTable(const QUrl &url, const QString &collectionId, QObject *parent = nullptr)
    virtual ~OgcFeatureCollectionTable() override
    Esri::ArcGISRuntime::OgcFeatureCollectionInfo *featureCollectionInfo() const
    Esri::ArcGISRuntime::FeatureRequestMode featureRequestMode() const
    (since Esri::ArcGISRuntime 200.2) QFuture<Esri::ArcGISRuntime::FeatureQueryResult *> populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters &parameters, bool clearCache, const QStringList &outFields, QObject *parent = nullptr)
    (since Esri::ArcGISRuntime 200.6) QFuture<Esri::ArcGISRuntime::FeatureQueryResult *> populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters &parameters, bool clearCache, const QStringList &outFields, const QString &queryLanguage, QObject *parent = nullptr)
    void setFeatureRequestMode(Esri::ArcGISRuntime::FeatureRequestMode featureRequestMode)

    Reimplemented Public Functions

    (since Esri::ArcGISRuntime 100.13, deprecated) virtual Esri::ArcGISRuntime::Credential *credential() const override
    (since Esri::ArcGISRuntime 100.13, deprecated) virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
    (since Esri::ArcGISRuntime 100.13, deprecated) virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
    virtual QUrl url() const override

    Detailed Description

    To display data from an OGC feature collection table in a FeatureLayer use the FeatureLayer::FeatureLayer(Esri::ArcGISRuntime::FeatureTable*, QObject*) constructor where the OgcFeatureCollectionTable is the parameter that is passed into the constructor. Note: The OgcFeatureCollectionTable should not be confused with FeatureCollectionTable which is used as an input to create a FeatureCollection.

    This API provides building blocks for manipulating OGC Features on the Web. For more information about the OGC API Features specification, see the documents: OGC API - Features - Part 1 and OGC API - Features - Part 2.

    The class includes two important pieces: the featureRequestMode property and the populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters&, bool, const QStringList&, QObject*) methods. Only the FeatureRequestMode::ManualCache mode is supported. This means that one of the populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters&, bool, const QStringList&, QObject*) methods must be called to populate, query, and return features from the service.

    For the QueryParameters::whereClause used by the populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters&, bool, const QStringList&, QObject*) methods, you can put any CQL2-TEXT or CQL2-JSON string as defined in the document Common Query Language (CQL2). Use the populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters&, bool, const QStringList&, const QString&, QObject*) method to explicitly specify the query language of the QueryParameters::whereClause.

    When populating or updating a local table from an OGC service, you can now request features in a specified SpatialReference (also referred to as SRS in ArcGIS or CRS in OGC). This leverages the power of the server to return features in the same spatial reference as your map rather than having to re-project them on the client.

    This class supports loading and querying of features from a non-spatial OGC feature collection table.

    Relevant samples:

    Member Function Documentation

    [explicit] OgcFeatureCollectionTable::OgcFeatureCollectionTable(Esri::ArcGISRuntime::OgcFeatureCollectionInfo *featureCollectionInfo, QObject *parent = nullptr)

    Creates a new OGC API - Features feature-collection table.

    OgcFeatureCollectionTable::OgcFeatureCollectionTable(const QUrl &url, const QString &collectionId, QObject *parent = nullptr)

    Creates a new OGC API - Features feature-collection table.

    • url - The URL of the OGC API - Features service landing page that contains the feature collection.
    • collectionId - The unique identifier for the collection from the service.
    • parent - The optional parent QObject.

    [override virtual noexcept] OgcFeatureCollectionTable::~OgcFeatureCollectionTable()

    Destructor.

    Esri::ArcGISRuntime::OgcFeatureCollectionInfo *OgcFeatureCollectionTable::featureCollectionInfo() const

    Returns the OGC API - Features feature-collection metadata, which includes id, title, and description.

    Esri::ArcGISRuntime::FeatureRequestMode OgcFeatureCollectionTable::featureRequestMode() const

    Returns the mode defining when features are requested from the service.

    You must set the feature request mode to FeatureRequestMode::ManualCache before attempting to populate the table using populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters&, bool, const QStringList&, QObject*).

    See also setFeatureRequestMode().

    [since Esri::ArcGISRuntime 200.2] QFuture<Esri::ArcGISRuntime::FeatureQueryResult *> OgcFeatureCollectionTable::populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters &parameters, bool clearCache, const QStringList &outFields, QObject *parent = nullptr)

    Populate the OGC API - Features feature collection table with the results of a query.

    • parameters - Parameters that define how features are returned from the service.
    • clearCache - If true, clears existing table data before populating it with features returned from the service.
    • outFields - A QStringList.
    • parent - The optional parent QObject

    Use the default (empty) QueryParameters to get all features from the service. Specifying an empty QStringList for outfields will result in the default set of outfields being used. Spatial queries (those that specify geometries) must use the Intersects spatial relationship.

    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.6] QFuture<Esri::ArcGISRuntime::FeatureQueryResult *> OgcFeatureCollectionTable::populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters &parameters, bool clearCache, const QStringList &outFields, const QString &queryLanguage, QObject *parent = nullptr)

    Populate the OGC API - Features feature collection table with the results of a query.

    • parameters - Parameters that define how features are returned from the service.
    • clearCache - If true, clears existing table data before populating it with features returned from the service.
    • outFields - A QList containing QString.
    • queryLanguage - The query language that the QueryParameters::whereClause is written in.
    • parent - The optional parent QObject.

    Populates the OgcFeatureCollectionTable with features from the service that match the query parameters. Use the default (empty) QueryParameters to get all features from the service. Specifying nullptr or an empty QList for outfields will result in the default set of outfields being used. Spatial queries (those that specify geometries) must use the Intersects spatial relationship.

    Some OGC feature sources allow for query expressions to be written in different languages. The queryLanguage parameter allows you to explicitly specify the language of the QueryParameters::whereClause for the OGC feature query. The value of this parameter may be 'CQL2-TEXT', 'CQL2-JSON', or any other language supported by the target server. For OGC feature services the default language is `CQL2-TEXT`. For more information, refer to the OGC specification OGC API - Features - Part3. The default value is an empty string, indicating that the QueryParameters::whereClause uses the default language for the source.

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

    See also populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters&, bool, const QStringList&, QObject*).

    void OgcFeatureCollectionTable::setFeatureRequestMode(Esri::ArcGISRuntime::FeatureRequestMode featureRequestMode)

    Sets the featureRequestMode to featureRequestMode.

    Note: Your code must set this to FeatureRequestMode::ManualCache before the table is loaded. FeatureRequestMode::ManualCache is the only mode supported in the current release. The default value of FeatureRequestMode::OnInteractionCache will be supported in a future release and will continue to be the default value.

    See also featureRequestMode.

    [override virtual] QUrl OgcFeatureCollectionTable::url() const

    Reimplements: RemoteResource::url() const.

    Returns the URL of the OGC API - Features service landing page.

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