Skip To Content ArcGIS for Developers Sign In Dashboard

FeatureTable Class

class Esri::ArcGISRuntime::FeatureTable

Base class for classes that represent a table of features. More...

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

virtual ~FeatureTable() override
Esri::ArcGISRuntime::TaskWatcher addFeature(Esri::ArcGISRuntime::Feature *feature)
Esri::ArcGISRuntime::TaskWatcher addFeatures(const QList<Esri::ArcGISRuntime::Feature *> &features)
bool canAdd() const
bool canDelete(Esri::ArcGISRuntime::Feature *feature) const
bool canEditGeometry() const
bool canUpdate(Esri::ArcGISRuntime::Feature *feature) const
Esri::ArcGISRuntime::Feature *createFeature(QObject *parent = nullptr) const
Esri::ArcGISRuntime::Feature *createFeature(const QVariantMap &attributes, const Esri::ArcGISRuntime::Geometry &geometry, QObject *parent = nullptr) const
Esri::ArcGISRuntime::TaskWatcher deleteFeature(Esri::ArcGISRuntime::Feature *feature)
Esri::ArcGISRuntime::TaskWatcher deleteFeatures(const QList<Esri::ArcGISRuntime::Feature *> &features)
QString displayName() const
Esri::ArcGISRuntime::Envelope extent() const
Esri::ArcGISRuntime::FeatureTableType featureTableType() const
Esri::ArcGISRuntime::Field field(const QString &fieldName) const
QList<Esri::ArcGISRuntime::Field> fields() const
Esri::ArcGISRuntime::GeometryType geometryType() const
bool hasGeometry() const
bool hasM() const
bool hasZ() const
bool isEditable() const
Esri::ArcGISRuntime::Layer *layer() const
qint64 numberOfFeatures() const
Esri::ArcGISRuntime::TaskWatcher queryExtent(const Esri::ArcGISRuntime::QueryParameters &parameters)
Esri::ArcGISRuntime::TaskWatcher queryFeatureCount(const Esri::ArcGISRuntime::QueryParameters &parameters)
Esri::ArcGISRuntime::TaskWatcher queryFeatures(const Esri::ArcGISRuntime::QueryParameters &parameters)
Esri::ArcGISRuntime::TaskWatcher queryStatistics(const Esri::ArcGISRuntime::StatisticsQueryParameters &parameters)
void setDisplayName(const QString &displayName)
Esri::ArcGISRuntime::SpatialReference spatialReference() const
QString tableName() const
Esri::ArcGISRuntime::TaskWatcher updateFeature(Esri::ArcGISRuntime::Feature *feature)
Esri::ArcGISRuntime::TaskWatcher updateFeatures(const QList<Esri::ArcGISRuntime::Feature *> &features)

Reimplemented Public Functions

virtual void cancelLoad() override
virtual bool isPopupEnabled() const override
virtual void load() override
virtual Esri::ArcGISRuntime::Error loadError() const override
virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
virtual Esri::ArcGISRuntime::PopupDefinition *popupDefinition() const override
virtual void retryLoad() override
virtual void setPopupDefinition(Esri::ArcGISRuntime::PopupDefinition *popupDefinition) override
virtual void setPopupEnabled(bool popupEnabled) override

Signals

void addFeatureCompleted(QUuid taskId, bool success)
void addFeaturesCompleted(QUuid taskId, bool success)
void deleteFeatureCompleted(QUuid taskId, bool success)
void deleteFeaturesCompleted(QUuid taskId, bool success)
void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
void queryExtentCompleted(QUuid taskId, const Esri::ArcGISRuntime::Envelope &envelope)
void queryFeatureCountCompleted(QUuid taskId, quint64 count)
void queryFeaturesCompleted(QUuid taskId, Esri::ArcGISRuntime::FeatureQueryResult *featureQueryResult)
void queryStatisticsCompleted(QUuid taskId, Esri::ArcGISRuntime::StatisticsQueryResult *statisticsQueryResult)
void updateFeatureCompleted(QUuid taskId, bool success)
void updateFeaturesCompleted(QUuid taskId, bool success)

Detailed Description

A FeatureTable defines a set of Fields, a GeometryType and a SpatialReference. A FeatureTable can also represent non-spatial data that has no GeometryType or SpatialReference. FeatureTables have a fixed schema.

You can query the FeatureTable using attribute or spatial criteria, and if permitted, edit the data. If the dataset contains geographic features you can display them on a map using a FeatureLayer. To do so, create the FeatureLayer from the FeatureTable and add it to a Map.

In a MVC architecture, the FeatureLayer is the view, while the FeatureTable is the model. Use the FeatureLayer to manipulate how the data displays on the map. For example, you can manipulate the opacity of the layer, turn labels on or off, and set a different Renderer through the FeatureLayer. The FeatureTable contains the data, and can be used for querying or editing the data.

// connect to the mouse clicked signal on the MapQuickView
connect(m_mapView, &MapQuickView::mouseClicked, this, [this](QMouseEvent& mouseEvent)
{
  // obtain the map point
  const double screenX = mouseEvent.x();
  const double screenY = mouseEvent.y();
  Point newPoint = m_mapView->screenToLocation(screenX, screenY);

  // create the feature attributes
  QMap<QString, QVariant> featureAttributes;
  featureAttributes.insert("typdamage", "Minor");
  featureAttributes.insert("primcause", "Earthquake");

  // create a new feature and add it to the feature table
  Feature* feature = m_featureTable->createFeature(featureAttributes, newPoint, this);
  m_featureTable->addFeature(feature);
});

Member Function Documentation

[signal] void FeatureTable::addFeatureCompleted(QUuid taskId, bool success)

Signal emitted when a feature has been added to this feature table.

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

[signal] void FeatureTable::addFeaturesCompleted(QUuid taskId, bool success)

Signal emitted when features have been added to this feature table.

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

[signal] void FeatureTable::deleteFeatureCompleted(QUuid taskId, bool success)

Signal emitted when a feature has been deleted from this feature table.

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

[signal] void FeatureTable::deleteFeaturesCompleted(QUuid taskId, bool success)

Signal emitted when features have been deleted from this feature table.

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

[signal] void FeatureTable::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.

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

Signal emitted when the load status changes for this object.

See also Loadable.

[signal] void FeatureTable::queryExtentCompleted(QUuid taskId, const Esri::ArcGISRuntime::Envelope &envelope)

Signal emitted when extent have been queried in this feature table.

  • taskId - The task ID for the asynchronous operation.
  • envelope - The minimum bounding envelope that contains features satisfying the provided query parameters.

This function was introduced in Esri::ArcGISRuntime 100.2.

[signal] void FeatureTable::queryFeatureCountCompleted(QUuid taskId, quint64 count)

Signal emitted when feature count have been queried in this feature table.

  • taskId - The task ID for the asynchronous operation.
  • count - The count of features that satisfy the provided query parameters.

This function was introduced in Esri::ArcGISRuntime 100.2.

[signal] void FeatureTable::queryFeaturesCompleted(QUuid taskId, Esri::ArcGISRuntime::FeatureQueryResult *featureQueryResult)

Signal emitted when features have been queried in this feature table.

  • taskId - The task ID for the asynchronous operation.
  • featureQueryResult - A feature query result containing an iterator pointing to the queried features.

The returned FeatureQueryResult object has the FeatureTable as its parent.

See also Returned QObjects Parenting.

[signal] void FeatureTable::queryStatisticsCompleted(QUuid taskId, Esri::ArcGISRuntime::StatisticsQueryResult *statisticsQueryResult)

Signal emitted when statistics have been queried in this feature table.

  • taskId - The task ID for the asynchronous operation.
  • statisticsQueryResult - A statistics query result containing an iterator pointing to the queried statistics.

The returned StatisticsQueryResult object has the FeatureTable as its parent.

This function was introduced in Esri::ArcGISRuntime 100.2.

See also Returned QObjects Parenting.

[signal] void FeatureTable::updateFeatureCompleted(QUuid taskId, bool success)

Signal emitted when a feature has been updated in this feature table.

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

[signal] void FeatureTable::updateFeaturesCompleted(QUuid taskId, bool success)

Signal emitted when features have been updated in this feature table.

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

[override virtual] FeatureTable::~FeatureTable()

Destructor.

Esri::ArcGISRuntime::TaskWatcher FeatureTable::addFeature(Esri::ArcGISRuntime::Feature *feature)

Adds a new feature to the feature table and returns a TaskWatcher for the asynchronous operation.

Esri::ArcGISRuntime::TaskWatcher FeatureTable::addFeatures(const QList<Esri::ArcGISRuntime::Feature *> &features)

Adds new features to the feature table and returns a TaskWatcher for the asynchronous operation.

bool FeatureTable::canAdd() const

Returns true if the feature table allows adding new features.

The result of this method accounts for the table's attachment and geometry capabilites, and ownership-based access control. This method does not consider the app's current license level.

bool FeatureTable::canDelete(Esri::ArcGISRuntime::Feature *feature) const

Returns true if the provided feature can be deleted from the table.

The result of this method accounts for the table's attachment and geometry capabilites, and ownership-based access control. This method does not consider the app's current license level.

bool FeatureTable::canEditGeometry() const

Returns true if the feature table allows editing a feature's geometry.

The result of this method accounts for the table's ownership-based access control. This method does not consider the app's current license level.

bool FeatureTable::canUpdate(Esri::ArcGISRuntime::Feature *feature) const

Returns true if the provided feature can be updated in the table.

The result of this method accounts for the table's attachment and geometry capabilites, and ownership-based access control. This method does not consider the app's current license level.

[override virtual] void FeatureTable::cancelLoad()

Reimplements: Loadable::cancelLoad().

See Loadable.

Esri::ArcGISRuntime::Feature *FeatureTable::createFeature(QObject *parent = nullptr) const

Creates and returns a new, empty feature with an optional parent.

Note: The new feature is only available in memory at this point. It is not commited to the dataset and will need to be explicitly added.

See also addFeature().

Esri::ArcGISRuntime::Feature *FeatureTable::createFeature(const QVariantMap &attributes, const Esri::ArcGISRuntime::Geometry &geometry, QObject *parent = nullptr) const

Creates and returns a new feature with the provided attributes and geometry, with an optional parent.

Note: The new feature is only available in memory at this point. It is not commited to the dataset and will need to be explicitly added.

See also addFeature().

Esri::ArcGISRuntime::TaskWatcher FeatureTable::deleteFeature(Esri::ArcGISRuntime::Feature *feature)

Deletes a feature from the feature table and returns a TaskWatcher for the asynchronous operation.

Esri::ArcGISRuntime::TaskWatcher FeatureTable::deleteFeatures(const QList<Esri::ArcGISRuntime::Feature *> &features)

Deletes features from the feature table and returns a TaskWatcher for the asynchronous operation.

QString FeatureTable::displayName() const

Returns the table's display name.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also setDisplayName().

Esri::ArcGISRuntime::Envelope FeatureTable::extent() const

Returns the extent of the dataset.

For ServiceFeatureTable if the feature request mode is FeatureRequestMode::OnInteractionCache or FeatureRequestMode::OnInteractionNoCache this property returns the services extent. If the mode is FeatureRequestMode::ManualCache or for GeodatabaseFeatureTable this property will return the extent of the cached table.

Esri::ArcGISRuntime::FeatureTableType FeatureTable::featureTableType() const

Returns the type of feature table.

Esri::ArcGISRuntime::Field FeatureTable::field(const QString &fieldName) const

Returns a Field object describing the field corresponding to the provided fieldName.

QList<Esri::ArcGISRuntime::Field> FeatureTable::fields() const

Returns a list of Field objects representing the fields in the dataset.

Esri::ArcGISRuntime::GeometryType FeatureTable::geometryType() const

Returns the type of geometry used by geographic features.

All geometries in each feature table share the same geometry type.

Only valid if hasGeometry() is true.

bool FeatureTable::hasGeometry() const

Returns true if the dataset contains a geometry field.

If true, the dataset contains geographic features. If false, the dataset contains non-spatial records, similar to a database table.

bool FeatureTable::hasM() const

Returns true if the dataset contains m-values.

This function was introduced in Esri::ArcGISRuntime 100.2.

bool FeatureTable::hasZ() const

Returns true if the dataset contains z-values.

This function was introduced in Esri::ArcGISRuntime 100.2.

bool FeatureTable::isEditable() const

Returns true if the dataset can be edited.

For details on which fine-grained editing capabilites are supported, refer to canUpdate() and canDelete().

[override virtual] bool FeatureTable::isPopupEnabled() const

Reimplements: PopupSource::isPopupEnabled() const.

Returns whether the Popup is enabled on the PopupSource.

This function was introduced in Esri::ArcGISRuntime 100.1.

Esri::ArcGISRuntime::Layer *FeatureTable::layer() const

Returns the layer this table is associated with or created from, if any.

This property can be an AnnotationLayer, a FeatureLayer, or nullptr if this table is not associated with any layer. This property is populated when the layer is created from the FeatureTable.

This function was introduced in Esri::ArcGISRuntime 100.7.

[override virtual] void FeatureTable::load()

Reimplements: Loadable::load().

See Loadable.

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

Reimplements: Loadable::loadError() const.

See Loadable.

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

Reimplements: Loadable::loadStatus() const.

See Loadable.

qint64 FeatureTable::numberOfFeatures() const

Returns the total number of features or records in the dataset.

[override virtual] Esri::ArcGISRuntime::PopupDefinition *FeatureTable::popupDefinition() const

Reimplements: PopupSource::popupDefinition() const.

See PopupSource.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setPopupDefinition().

Esri::ArcGISRuntime::TaskWatcher FeatureTable::queryExtent(const Esri::ArcGISRuntime::QueryParameters &parameters)

Determines the minimum bounding envelope that contains features satisfying the provided query parameters.

This function was introduced in Esri::ArcGISRuntime 100.2.

Esri::ArcGISRuntime::TaskWatcher FeatureTable::queryFeatureCount(const Esri::ArcGISRuntime::QueryParameters &parameters)

Determines the count of features that satisfy the provided query parameters.

This function was introduced in Esri::ArcGISRuntime 100.2.

Esri::ArcGISRuntime::TaskWatcher FeatureTable::queryFeatures(const Esri::ArcGISRuntime::QueryParameters &parameters)

Queries for features in this FeatureTable using the provided parameters, and returns a TaskWatcher for the asynchronous task.

Esri::ArcGISRuntime::TaskWatcher FeatureTable::queryStatistics(const Esri::ArcGISRuntime::StatisticsQueryParameters &parameters)

Queries for statistics in this FeatureTable using the provided parameters and an asynchronous task.

The queryStatisticsCompleted signal emits when the operation is complete. The results are then available through StatisticsQueryResult.

This function was introduced in Esri::ArcGISRuntime 100.2.

[override virtual] void FeatureTable::retryLoad()

Reimplements: Loadable::retryLoad().

See Loadable.

void FeatureTable::setDisplayName(const QString &displayName)

Sets the table's display name to displayName.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also displayName().

[override virtual] void FeatureTable::setPopupDefinition(Esri::ArcGISRuntime::PopupDefinition *popupDefinition)

Reimplements: PopupSource::setPopupDefinition(Esri::ArcGISRuntime::PopupDefinition *popupDefinition).

Sets the popup definition to popupDefinition.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also popupDefinition() and PopupSource.

[override virtual] void FeatureTable::setPopupEnabled(bool popupEnabled)

Reimplements: PopupSource::setPopupEnabled(bool popupEnabled).

Sets whether the PopupSource is enabled to popupEnabled.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also isPopupEnabled() and PopupSource.

Esri::ArcGISRuntime::SpatialReference FeatureTable::spatialReference() const

Returns the spatial reference of the features in the dataset.

QString FeatureTable::tableName() const

Returns the name of the dataset.

Esri::ArcGISRuntime::TaskWatcher FeatureTable::updateFeature(Esri::ArcGISRuntime::Feature *feature)

Updates a feature in the feature table and returns a TaskWatcher for the asynchronous operation.

Esri::ArcGISRuntime::TaskWatcher FeatureTable::updateFeatures(const QList<Esri::ArcGISRuntime::Feature *> &features)

Updates features in the feature table and returns a TaskWatcher for the asynchronous operation.


Feedback on this topic?