WfsFeatureTable Class

  • WfsFeatureTable
  • class Esri::ArcGISRuntime::WfsFeatureTable

    A table of features that typically represents real-world objects from an OGC Web Feature Service (WFS) dataset. More...

    Header: #include <WfsFeatureTable.h>
    Since: Esri::ArcGISRuntime 100.5
    Inherits: Esri::ArcGISRuntime::FeatureTable and Esri::ArcGISRuntime::RemoteResource

    Public Functions

    WfsFeatureTable(const Esri::ArcGISRuntime::WfsLayerInfo &layerInfo, QObject *parent = nullptr)
    WfsFeatureTable(const Esri::ArcGISRuntime::WfsLayerInfo &layerInfo, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    WfsFeatureTable(const QUrl &url, const QString &tableName, QObject *parent = nullptr)
    WfsFeatureTable(const QUrl &url, const QString &tableName, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    virtual ~WfsFeatureTable() override
    Esri::ArcGISRuntime::OgcAxisOrder axisOrder() const
    Esri::ArcGISRuntime::FeatureRequestMode featureRequestMode() const
    Esri::ArcGISRuntime::OgcAxisOrder filterAxisOrder() const
    Esri::ArcGISRuntime::WfsLayerInfo layerInfo() const
    QFuture<Esri::ArcGISRuntime::FeatureQueryResult *> populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters &parameters, bool clearCache, const QStringList &outFields, QObject *parent = nullptr)
    QFuture<Esri::ArcGISRuntime::FeatureQueryResult *> populateFromServiceAsync(const QString &xmlRequest, bool clearCache, QObject *parent = nullptr)
    Esri::ArcGISRuntime::SpatialReference preferredSpatialReference() const
    void setAxisOrder(Esri::ArcGISRuntime::OgcAxisOrder axisOrder)
    void setFeatureRequestMode(Esri::ArcGISRuntime::FeatureRequestMode featureRequestMode)
    void setFilterAxisOrder(Esri::ArcGISRuntime::OgcAxisOrder filterAxisOrder)
    void setPreferredSpatialReference(const Esri::ArcGISRuntime::SpatialReference &preferredSpatialReference)

    Reimplemented Public Functions

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

    Detailed Description

    You can create WFS feature table using the URL of an OGC Web Feature Service and a specified layer name. Alternatively, you may connect to a WfsService, obtain its metadata from WfsService::serviceInfo, and discover its available layers using WfsServiceInfo::layerInfos. You can then create a WfsFeatureTable from an individual layer using WfsFeatureTable(const Esri::ArcGISRuntime::WfsLayerInfo&, QObject*).

    When you have created a WFS Feature table, features are not automatically requested. Instead, you must set the WFS Feature table request mode to FeatureRequestMode::ManualCache and then populate the table using populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters&, bool, const QStringList&, QObject*), for example.

    You can visualize features from a WFS feature table using a FeatureLayer but the table does not support editing. See the OGC Web Feature Service standard for more information.

    Member Function Documentation

    [explicit] WfsFeatureTable::WfsFeatureTable(const Esri::ArcGISRuntime::WfsLayerInfo &layerInfo, QObject *parent = nullptr)

    Creates a WFS feature table from WFS layer information.

    [since Esri::ArcGISRuntime 100.13] WfsFeatureTable::WfsFeatureTable(const Esri::ArcGISRuntime::WfsLayerInfo &layerInfo, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

    Constructor that takes a layerInfo and a credential, and an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    WfsFeatureTable::WfsFeatureTable(const QUrl &url, const QString &tableName, QObject *parent = nullptr)

    Creates a WFS feature table from the URL of a WFS Service and a table name.

    • url - The URL of a WFS service.
    • tableName - The name of the layer (feature type) from the WFS service.
    • parent - The optional parent QObject.

    [since Esri::ArcGISRuntime 100.13] WfsFeatureTable::WfsFeatureTable(const QUrl &url, const QString &tableName, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

    Constructor that takes a url, tableName, and an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    [override virtual] WfsFeatureTable::~WfsFeatureTable()

    Destructor

    Esri::ArcGISRuntime::OgcAxisOrder WfsFeatureTable::axisOrder() const

    Returns the axis order, which defines how coordinates are interpreted (x,y or y,x).

    Some WFS services return coordinates in (x,y) order, while others use (y,x) order. Setting this property to OgcAxisOrder::Swap results in all coordinates in geometries being swapped from what was sent by the server. Setting to OgcAxisOrder::NoSwap will cause coordinates to be interpreted as-is. The axis order can be changed on an already-loaded feature table, but the change will only affect future calls to populateFromServiceAsync(const Esri::ArcGISRuntime::QueryParameters&, bool, const QStringList&, QObject*). Features that are already in the table will not be modified/swapped.

    The default value is OgcAxisOrder::Auto. In this mode, the results are optimized using heuristics from popular WFS Servers.

    See also setAxisOrder().

    [override virtual, since Esri::ArcGISRuntime 100.13] Esri::ArcGISRuntime::Credential *WfsFeatureTable::credential() const

    Reimplements: RemoteResource::credential() const.

    Returns the security credentials to access the remote resource.

    Only applicable if the resource is secured.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    Esri::ArcGISRuntime::FeatureRequestMode WfsFeatureTable::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().

    Esri::ArcGISRuntime::OgcAxisOrder WfsFeatureTable::filterAxisOrder() const

    Returns the filter axis order, which determines how coordinates are ordered when sent to the server as part of spatial queries.

    Some WFS services expect coordinates to be sent in (x,y) order, while others use (y,x). Use OgcAxisOrder::Swap to send coordinates in (y,x) order and OGCAxisOrder.noSwap to use (x,y) order.

    The default value is OgcAxisOrder::Auto. This indicates that the axis order will be based on the OGC standard specification, version, and spatial reference.

    See also setFilterAxisOrder().

    Esri::ArcGISRuntime::WfsLayerInfo WfsFeatureTable::layerInfo() const

    Returns the metadata describing the WFS layer, such as name and description.

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

    Populates the WFS feature table using the query parameters.

    • parameters - Options for controlling the operation.
    • clearCache - If true, the existing table data is cleared before it is populated with the query result.
    • outFields - A QList of field names.
    • parent - The optional parent QObject.

    Use the default (empty) QueryParameters to get all features from the service. If you specify a nullptr or an empty collection for outfields, then the default set of outfields are used.

    WFS is compatible with a subset of possible queries defined by QueryParameters. The QueryParameters::whereClause only works when the table is backed by a service powered by a GeoServer. Spatial queries (those that specify geometries) must use the SpatialRelationship::Intersects spatial relationship.

    You must ensure that the featureRequestMode is set to FeatureRequestMode::ManualCache before attempting to populate the table.

    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<Esri::ArcGISRuntime::FeatureQueryResult *> WfsFeatureTable::populateFromServiceAsync(const QString &xmlRequest, bool clearCache, QObject *parent = nullptr)

    Populate the table using an XML query.

    • xmlRequest - An XML string representing the complete GetFeature request including but not limited to filters, joins, and aliases.
    • clearCache - If true, clears existing table data before populating with the query result.
    • parent - An optional parent.

    The schema of the query result must match or be a subset of the schema of the table. The XML query must be made against the same feature type represented by the WFS feature table.

    You must ensure that the featureRequestMode is set to FeatureRequestMode::ManualCache before attempting to populate the table.

    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::SpatialReference WfsFeatureTable::preferredSpatialReference() const

    Returns the preferred spatial reference for the WFS feature table.

    If the service does not provide a preferred spatial reference, or you have not set it explicitly, then the table will fail to load. The preferred spatial reference cannot be changed once the table is loaded.

    Set the preferred spatial reference to match the map or scene's spatial reference to avoid the automatic reprojection of features.

    See also setPreferredSpatialReference().

    [override virtual, since Esri::ArcGISRuntime 100.13] Esri::ArcGISRuntime::RequestConfiguration WfsFeatureTable::requestConfiguration() const

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration used to customize the request to this RemoteResource.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    See also setRequestConfiguration().

    void WfsFeatureTable::setAxisOrder(Esri::ArcGISRuntime::OgcAxisOrder axisOrder)

    Sets the axisOrder to axisOrder.

    See also axisOrder.

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

    Sets the featureRequestMode to featureRequestMode.

    See also featureRequestMode.

    void WfsFeatureTable::setFilterAxisOrder(Esri::ArcGISRuntime::OgcAxisOrder filterAxisOrder)

    Sets the filterAxisOrder to filterAxisOrder.

    See also filterAxisOrder.

    void WfsFeatureTable::setPreferredSpatialReference(const Esri::ArcGISRuntime::SpatialReference &preferredSpatialReference)

    Sets the preferredSpatialReference to preferredSpatialReference.

    See also preferredSpatialReference.

    [override virtual, since Esri::ArcGISRuntime 100.13] void WfsFeatureTable::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration)

    Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

    Sets the RequestConfiguration, which is used to customize the request to this RemoteResource, to requestConfiguration.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    See also requestConfiguration().

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

    Reimplements: RemoteResource::url() const.

    Returns the URL of the WFS feature table.

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