Skip To Content ArcGIS for Developers Sign In Dashboard

Geodatabase Class

(Esri::ArcGISRuntime::Geodatabase)

A mobile geodatabase on the local file system. More...

Header: #include <Geodatabase>
Since: Esri::ArcGISRuntime 100.0
Inherits: Object and Loadable

Public Functions

Geodatabase(const QString &path, QObject *parent = nullptr)
~Geodatabase()
void beginTransaction()
void close()
void commitTransaction()
Envelope generateGeodatabaseExtent() const
GeodatabaseFeatureTable *geodatabaseAnnotationTable(const QString &tableName) const
GeodatabaseFeatureTable *geodatabaseAnnotationTable(qint64 serviceLayerId) const
QList<GeodatabaseFeatureTable *> geodatabaseAnnotationTables() const
GeodatabaseFeatureTable *geodatabaseFeatureTable(const QString &tableName) const
GeodatabaseFeatureTable *geodatabaseFeatureTable(qint64 serviceLayerId) const
QList<GeodatabaseFeatureTable *> geodatabaseFeatureTables() const
bool hasLocalEdits() const
bool isInTransaction() const
bool isSyncEnabled() const
qint64 minServerGeneration() const
QString path() const
void rollbackTransaction()
QUrl serviceUrl() const
QUuid syncId() const
SyncModel syncModel() const

Reimplemented Public Functions

virtual void cancelLoad()
virtual void load()
virtual Error loadError() const
virtual LoadStatus loadStatus() const
virtual void retryLoad()

Signals

void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
void transactionStatusChanged(bool isInTransaction)

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

A mobile geodatabase on the local file system.

The Geodatabase class is used for opening and accessing the contents of a mobile geodatabase. A geodatabase is typically an offline copy of data from an ArcGIS service, although it can be created using ArcMap or ArcGIS Pro. The geodatabase contains a number of GeodatabaseFeatureTables. Each GeodatabaseFeatureTable contains attribute data. For spatial features, it also stores the geometry and rendering information. A GeodatabaseFeatureTable can be used to create a feature layer to display on a map.

Geodatabase adopts the loadable pattern; the geodatabase feature tables can be accessed after loaded. See Loadable for more information.

See also GeodatabaseFeatureTable.

Member Function Documentation

Geodatabase::Geodatabase(const QString &path, QObject *parent = nullptr)

Constructs a Geodatabase instance given a path to a geodatabase file with an optional parent.

Constructing a geodatabase from a path to a geodatabase file does not automatically load the geodatabase. You must load it explicitly.

See also load.

Geodatabase::~Geodatabase()

Destructor.

void Geodatabase::beginTransaction()

Starts a transaction on the geodatabase.

This method starts a new transaction on the geodatabase. The transaction fails to begin if another transaction is already active. A geodatabase cannot be synchronized while a transaction is active.

This function was introduced in Esri::ArcGISRuntime 100.3.

[virtual] void Geodatabase::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

void Geodatabase::close()

Closes the Geodatabase by forcefully removing all internal references to it.

This is to allow for deleting a Geodatabase when you're done using it. That can be problematic in some workflows since there can be outstanding references to it and it may be difficult to track and delete them all.

This method is not needed for typical workflows.

The close method has no effect on the loadStatus of the Geodatabase. Once closed, the object cannot be reloaded or used again and the loadStatus is no longer indicative of the state.

Warning: Once close is called the Geodatabase object is in an undefined state and should no longer be used.

This function was introduced in Esri::ArcGISRuntime 100.1.

void Geodatabase::commitTransaction()

Commits the current transaction on the geodatabase.

This method ends the current transaction and commits the changes.

This function was introduced in Esri::ArcGISRuntime 100.3.

[signal] void Geodatabase::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 Geodatabase::generateGeodatabaseExtent() const

Returns the extent used to generate the geodatabase.

GeodatabaseFeatureTable *Geodatabase::geodatabaseAnnotationTable(const QString &tableName) const

Returns the specified geodatabase annotation feature table, given its tableName, from the geodatabase.

GeodatabaseFeatureTable *Geodatabase::geodatabaseAnnotationTable(qint64 serviceLayerId) const

Returns the specified geodatabase annotation feature table, given its serviceLayerId, from the geodatabase.

QList<GeodatabaseFeatureTable *> Geodatabase::geodatabaseAnnotationTables() const

Returns a list of geodatabase annotation feature tables.

This function was introduced in Esri::ArcGISRuntime 100.6.

GeodatabaseFeatureTable *Geodatabase::geodatabaseFeatureTable(const QString &tableName) const

Returns the specified geodatabase feature table, given its tableName, from the geodatabase.

GeodatabaseFeatureTable *Geodatabase::geodatabaseFeatureTable(qint64 serviceLayerId) const

Returns the specified geodatabase feature table, given its serviceLayerId, from the geodatabase.

QList<GeodatabaseFeatureTable *> Geodatabase::geodatabaseFeatureTables() const

Returns a list of geodatabase feature tables in the mobile geodatabase.

Give a geodatabase feature table instance to a FeatureLayer to be added to the map. Or you can load the geodatabase feature table directly to start working with its data.

bool Geodatabase::hasLocalEdits() const

Returns true if the geodatabase has local edits.

bool Geodatabase::isInTransaction() const

Returns whether a transaction is currently active on the geodatabase.

This function was introduced in Esri::ArcGISRuntime 100.3.

bool Geodatabase::isSyncEnabled() const

Returns true if sync is enabled for the mobile geodatabase.

[virtual] void Geodatabase::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error Geodatabase::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus Geodatabase::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

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

Signal emitted when the load status changes for this object.

See also Loadable.

qint64 Geodatabase::minServerGeneration() const

Returns the minimum server generation number for the geodatabase.

Server generation numbers indicate the state of a geodatabase or individual layers with respect to changes which have been synced with the online service. The number increases as new changes from the online feature service are synced to the local geodatabase.

If the syncModel is SyncModel::Geodatabase, the value will indicate the server generation number for the entire geodatabase. If the syncModel is SyncModel::Layer, the value will be the lowest server generation number for all of the layers in the geodatabase. This property will be -1 if the geodatabase does not support sync (SyncModel::None).

This property will be -1 until the geodatabase is LoadStatus::Loaded.

Note that this property is only required when using advanced workflows to manually apply pre-generated changes and not when performing a sync directly against the online service.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also GeodatabaseSyncTask::importGeodatabaseDelta.

QString Geodatabase::path() const

Returns the path to the mobile geodatabase file on disk.

[virtual] void Geodatabase::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

void Geodatabase::rollbackTransaction()

Rolls back the current transaction on the geodatabase.

This method ends the current transaction and discards the changes from the geodatabase.

This function was introduced in Esri::ArcGISRuntime 100.3.

QUrl Geodatabase::serviceUrl() const

Returns the service URL from where the mobile geodatabase was obtained.

QUuid Geodatabase::syncId() const

Returns the sync ID of the geodatabase.

The geodatabase's sync ID is the same as the replica ID described in the REST documentation. This is used by the service that created the geodatabase to uniquely identify it when carrying out sync operations. It can also be used when unregistering the geodatabase if it has already been deleted locally.

Note: The returned QUuid will be null if there is an error or if this is not a sync enabled geodatabase or the geodatabase is not loaded.

This function was introduced in Esri::ArcGISRuntime 100.2.

See also GeodatabaseSyncTask::unregisterGeodatabase.

SyncModel Geodatabase::syncModel() const

Returns the geodatabase's supported sync model.

[signal] void Geodatabase::transactionStatusChanged(bool isInTransaction)

Signal emitted when the transaction status of the geodatabase changes.

  • isInTransaction - Whether a transaction is currently active on a geodatabase.

This function was introduced in Esri::ArcGISRuntime 100.3.


Feedback on this topic?