Skip To Content ArcGIS for Developers Sign In Dashboard

FeatureTable Class

(Esri::ArcGISRuntime::FeatureTable)

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

Public Functions

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

Reimplemented Public Functions

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

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)

Additional Inherited Members

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

Detailed Description

Base class for classes that represent a table of features.

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

FeatureTable::~FeatureTable()

Destructor.

TaskWatcher FeatureTable::addFeature(Feature *feature)

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

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

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

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

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

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

[virtual] void FeatureTable::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

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().

Feature *FeatureTable::createFeature(const QVariantMap &attributes, const 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().

TaskWatcher FeatureTable::deleteFeature(Feature *feature)

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

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

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

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

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

QString FeatureTable::displayName() const

Returns the table's display name.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also setDisplayName().

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

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.

FeatureLayer *FeatureTable::featureLayer() const

Returns the feature layer created with this table, if any.

FeatureTableType FeatureTable::featureTableType() const

Returns the type of feature table.

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

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

QList<Field> FeatureTable::fields() const

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

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().

[virtual] bool FeatureTable::isPopupEnabled() const

Reimplemented from PopupSource::isPopupEnabled().

See PopupSource.

This function was introduced in Esri::ArcGISRuntime 100.1.

[virtual] void FeatureTable::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error FeatureTable::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus FeatureTable::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

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

Signal emitted when the load status changes for this object.

See also Loadable.

qint64 FeatureTable::numberOfFeatures() const

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

[virtual] PopupDefinition *FeatureTable::popupDefinition() const

Reimplemented from PopupSource::popupDefinition().

See PopupSource.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setPopupDefinition().

TaskWatcher FeatureTable::queryExtent(const QueryParameters &parameters)

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

This function was introduced in Esri::ArcGISRuntime 100.2.

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

TaskWatcher FeatureTable::queryFeatureCount(const QueryParameters &parameters)

Determines the count of features that satisfy 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.

TaskWatcher FeatureTable::queryFeatures(const QueryParameters &parameters)

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

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

TaskWatcher FeatureTable::queryStatistics(const 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.

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

[virtual] void FeatureTable::retryLoad()

Reimplemented from 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().

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

Reimplemented from PopupSource::setPopupDefinition().

Sets the popup definition to popupDefinition.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also popupDefinition() and PopupSource.

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

Reimplemented from PopupSource::setPopupEnabled().

Sets whether the PopupSource is enabled to popupEnabled.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also isPopupEnabled() and PopupSource.

SpatialReference FeatureTable::spatialReference() const

Returns the spatial reference of the features in the dataset.

QString FeatureTable::tableName() const

Returns the name of the dataset.

TaskWatcher FeatureTable::updateFeature(Feature *feature)

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

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

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

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

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

Feedback on this topic?