FeatureTable Class
Base class for classes that represent a table of features. More...
Header: | #include <FeatureTable.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::Object, Esri::ArcGISRuntime::Loadable, and Esri::ArcGISRuntime::PopupSource |
Inherited By: | Esri::ArcGISRuntime::ArcGISFeatureTable, Esri::ArcGISRuntime::FeatureCollectionTable, Esri::ArcGISRuntime::GeoPackageFeatureTable, Esri::ArcGISRuntime::OgcFeatureCollectionTable, Esri::ArcGISRuntime::ShapefileFeatureTable, and Esri::ArcGISRuntime::WfsFeatureTable |
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 ¶meters) |
Esri::ArcGISRuntime::TaskWatcher | queryFeatureCount(const Esri::ArcGISRuntime::QueryParameters ¶meters) |
Esri::ArcGISRuntime::TaskWatcher | queryFeatures(const Esri::ArcGISRuntime::QueryParameters ¶meters) |
Esri::ArcGISRuntime::TaskWatcher | queryStatistics(const Esri::ArcGISRuntime::StatisticsQueryParameters ¶meters) |
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(const QUuid &taskId, bool success) |
void | addFeaturesCompleted(const QUuid &taskId, bool success) |
void | deleteFeatureCompleted(const QUuid &taskId, bool success) |
void | deleteFeaturesCompleted(const QUuid &taskId, bool success) |
void | doneLoading(const Esri::ArcGISRuntime::Error &loadError) |
void | loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus) |
void | queryExtentCompleted(const QUuid &taskId, const Esri::ArcGISRuntime::Envelope &envelope) |
void | queryFeatureCountCompleted(const QUuid &taskId, quint64 count) |
void | queryFeaturesCompleted(const QUuid &taskId, Esri::ArcGISRuntime::FeatureQueryResult *featureQueryResult) |
void | queryStatisticsCompleted(const QUuid &taskId, Esri::ArcGISRuntime::StatisticsQueryResult *statisticsQueryResult) |
void | updateFeatureCompleted(const QUuid &taskId, bool success) |
void | updateFeaturesCompleted(const 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.
Member Function Documentation
[signal]
void FeatureTable::addFeatureCompleted (const 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 (const 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 (const 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 (const 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 (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.
[signal]
void FeatureTable::loadStatusChanged (Esri::ArcGISRuntime::LoadStatus loadStatus )
Signal emitted when the load status changes for this object.
- loadStatus - The LoadStatus.
See also Loadable.
[signal, since Esri::ArcGISRuntime 100.2]
void FeatureTable::queryExtentCompleted (const 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, since Esri::ArcGISRuntime 100.2]
void FeatureTable::queryFeatureCountCompleted (const 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 (const 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, since Esri::ArcGISRuntime 100.2]
void FeatureTable::queryStatisticsCompleted (const 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 (const 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 (const 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.
Adding a feature that contains a Geometry causes the geometry to become simplified. This may change a single part geometry to a multipart geometry, or round off X, Y, Z, and M coordinate values that are above the resolution set by the SpatialReference.
Adding a feature to a GeodatabaseFeatureTable in a stand-alone mobile geodatabase created with ArcGIS Pro is not supported when the table participates in a controller dataset, such as a utility network or parcel fabric. Use canAdd to determine if this operation is allowed.
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.
Adding a feature that contains a Geometry causes the geometry to become simplified. This may change a single-part geometry to a multipart geometry, or round off x, y, z, and m-coordinate values that are above the resolution set by the SpatialReference.
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.
Deleting a feature from a GeodatabaseFeatureTable in a stand-alone mobile geodatabase created with ArcGIS Pro is not supported when the table participates in a controller dataset, such as a utility network or parcel fabric. Use FeatureTable::canDelete to determine if this operation is allowed.
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.
[since Esri::ArcGISRuntime 100.3]
QString FeatureTable::displayName () const
Returns a user-friendly name that can be displayed in the UI (for example, in a Table of Contents).
If the table is displayed with a FeatureLayer, the FeatureTable::displayName is used as the FeatureLayer::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.
[since Esri::ArcGISRuntime 100.2]
bool FeatureTable::hasM () const
Returns true
if the dataset contains m-values.
This function was introduced in Esri::ArcGISRuntime 100.2.
[since 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, since Esri::ArcGISRuntime 100.1]
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.
[since Esri::ArcGISRuntime 100.7]
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, since Esri::ArcGISRuntime 100.1]
Esri::ArcGISRuntime::PopupDefinition *FeatureTable::popupDefinition () const
Reimplements: PopupSource::popupDefinition() const.
See PopupSource.
This function was introduced in Esri::ArcGISRuntime 100.1.
See also setPopupDefinition().
[since Esri::ArcGISRuntime 100.2]
Esri::ArcGISRuntime::TaskWatcher FeatureTable::queryExtent (const Esri::ArcGISRuntime::QueryParameters ¶meters)
Determines the minimum bounding envelope that contains features satisfying the provided query parameters.
- parameters - The parameters of the query.
If no features meet the query criteria, an empty envelope is returned.
This method returns a TaskWatcher for the asynchronous operation.
This function was introduced in Esri::ArcGISRuntime 100.2.
See also FeatureServiceSessionType.
[since Esri::ArcGISRuntime 100.2]
Esri::ArcGISRuntime::TaskWatcher FeatureTable::queryFeatureCount (const Esri::ArcGISRuntime::QueryParameters ¶meters)
Determines the count of features that satisfy the provided query parameters.
A task that represents the asynchronous query of feature count. The value of the task result contains a qint64.
This function was introduced in Esri::ArcGISRuntime 100.2.
Esri::ArcGISRuntime::TaskWatcher FeatureTable::queryFeatures (const Esri::ArcGISRuntime::QueryParameters ¶meters)
Queries for features in this FeatureTable using the provided parameters, and returns a TaskWatcher for the asynchronous task.
[since Esri::ArcGISRuntime 100.2]
Esri::ArcGISRuntime::TaskWatcher FeatureTable::queryStatistics (const Esri::ArcGISRuntime::StatisticsQueryParameters ¶meters)
Queries for statistics in this FeatureTable using the provided parameters and an asynchronous task.
A task that represents the asynchronous query statistics operation. The value of the task result contains a StatisticsQueryResult object.
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.
[since Esri::ArcGISRuntime 100.3]
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, since Esri::ArcGISRuntime 100.1]
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, since Esri::ArcGISRuntime 100.1]
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 table.
A spatial reference defines how the coordinates of a feature's Geometry correspond to locations in the real world. For more information see the SpatialReference class or the Spatial references documentation.
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.
Updating a feature that contains a Geometry causes the geometry to become simplified. This may change a single-part geometry to a multipart geometry, or round off x, y, z, and m-coordinate values that are above the resolution set by the SpatialReference.
Updating a feature from a GeodatabaseFeatureTable in a stand-alone mobile geodatabase created with ArcGIS Pro is not supported when the table participates in a controller dataset, such as a utility network or parcel fabric. Use FeatureTable::canUpdate to determine if this operation is allowed.
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.