Geodatabase Class

  • Geodatabase
  • class Esri::ArcGISRuntime::Geodatabase

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

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

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Functions

    Geodatabase(const QString &path, QObject *parent = nullptr)
    virtual ~Geodatabase() override
    void beginTransaction()
    void close()
    void commitTransaction()
    Esri::ArcGISRuntime::TaskWatcher createDomain(Esri::ArcGISRuntime::DomainDescription *domainDescription)
    Esri::ArcGISRuntime::TaskWatcher createTable(Esri::ArcGISRuntime::TableDescription *tableDescription)
    Esri::ArcGISRuntime::TaskWatcher deleteDomain(const QString &domainName)
    Esri::ArcGISRuntime::TaskWatcher deleteTable(const QString &tableName)
    QList<Esri::ArcGISRuntime::Domain> domains() const
    Esri::ArcGISRuntime::Geometry generateGeodatabaseGeometry() const
    Esri::ArcGISRuntime::GeodatabaseFeatureTable *geodatabaseAnnotationTable(const QString &tableName) const
    Esri::ArcGISRuntime::GeodatabaseFeatureTable *geodatabaseAnnotationTable(qint64 serviceLayerId) const
    QList<Esri::ArcGISRuntime::GeodatabaseFeatureTable *> geodatabaseAnnotationTables() const
    Esri::ArcGISRuntime::GeodatabaseFeatureTable *geodatabaseDimensionTable(qint64 serviceLayerId) const
    Esri::ArcGISRuntime::GeodatabaseFeatureTable *geodatabaseDimensionTable(const QString &tableName) const
    QList<Esri::ArcGISRuntime::GeodatabaseFeatureTable *> geodatabaseDimensionTables() const
    Esri::ArcGISRuntime::GeodatabaseFeatureTable *geodatabaseFeatureTable(const QString &tableName) const
    Esri::ArcGISRuntime::GeodatabaseFeatureTable *geodatabaseFeatureTable(qint64 serviceLayerId) const
    QList<Esri::ArcGISRuntime::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
    Esri::ArcGISRuntime::SyncModel syncModel() const
    Esri::ArcGISRuntime::UtilityNetwork *utilityNetwork(const QString &utilityNetworkName) const
    QList<Esri::ArcGISRuntime::UtilityNetwork *> utilityNetworks() const

    Reimplemented Public Functions

    virtual void cancelLoad() override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual void retryLoad() override

    Signals

    void createCompleted(QUuid taskId, Esri::ArcGISRuntime::Geodatabase *geodatabaseResult)
    void createDomainCompleted(QUuid taskId, const Esri::ArcGISRuntime::Domain &domain)
    void createTableCompleted(QUuid taskId, Esri::ArcGISRuntime::GeodatabaseFeatureTable *geodatabaseFeatureTableResult)
    void deleteDomainCompleted(QUuid taskId)
    void deleteTableCompleted(QUuid taskId)
    void doneLoading(Esri::ArcGISRuntime::Error loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
    void transactionStatusChanged(bool isInTransaction)

    Static Public Members

    Esri::ArcGISRuntime::TaskWatcher create(const QString &path)
    Esri::ArcGISRuntime::Geodatabase *instance()

    Detailed Description

    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.

    [signal] void Geodatabase::createCompleted(QUuid taskId, Esri::ArcGISRuntime::Geodatabase *geodatabaseResult)

    Signal emitted when the create(QString) operation completes.

    • taskId - The task ID of the asynchronous operation.
    • geodatabaseResult - The geodatabase created.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    See also Returned QObjects Parenting.

    [signal] void Geodatabase::createDomainCompleted(QUuid taskId, const Esri::ArcGISRuntime::Domain &domain)

    Signal emitted when the createDomain(DomainDescription*) operation completes.

    • taskId - The task ID of the asynchronous operation.
    • domain - The newly created domain.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    [signal] void Geodatabase::createTableCompleted(QUuid taskId, Esri::ArcGISRuntime::GeodatabaseFeatureTable *geodatabaseFeatureTableResult)

    Signal emitted when the createTable(TableDescription) operation completes.

    • taskId - The task ID of the asynchronous operation.
    • geodatabaseFeatureTableResult - The geodatabase feature table created.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    See also Returned QObjects Parenting.

    [signal] void Geodatabase::deleteDomainCompleted(QUuid taskId)

    Signal emitted when the deleteDomain(QString) operation completes.

    • taskId - The task ID of the asynchronous operation.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    [signal] void Geodatabase::deleteTableCompleted(QUuid taskId)

    Signal emitted when the deleteTable(QString) operation completes.

    • taskId - The task ID of the asynchronous operation.

    This function was introduced in Esri::ArcGISRuntime 100.14.

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

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

    Signal emitted when the load status changes for this object.

    See also Loadable.

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

    [override virtual] 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.

    [override virtual] void Geodatabase::cancelLoad()

    Reimplements: 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.

    [static] Esri::ArcGISRuntime::TaskWatcher Geodatabase::create(const QString &path)

    Returns an empty mobile geodatabase at the specified path.

    • path - The path at which the mobile geodatabase should be created.

    The path must be non-empty, available, allow read/write access, and end in ".geodatabase". If any of these restrictions are violated, the task will not succeed and a task error will be set. This method returns a TaskWatcher for the asynchronous operation.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    Esri::ArcGISRuntime::TaskWatcher Geodatabase::createDomain(Esri::ArcGISRuntime::DomainDescription *domainDescription)

    Returns a new domain in the geodatabase.

    • domainDescription - The description of the domain to create.

    Creating domains is only supported in mobile geodatabases (either created in Pro or via create(QString)). The domain name must not already exist in the geodatabase.

    This method returns a TaskWatcher for the asynchronous operation.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    Esri::ArcGISRuntime::TaskWatcher Geodatabase::createTable(Esri::ArcGISRuntime::TableDescription *tableDescription)

    Returns a new table in the geodatabase.

    • tableDescription - The description of the table to create.

    Creating tables is only supported in mobile geodatabases (either created in Pro or via create(QString)). The table name must not already exist in the geodatabase. For additional table name constraints, see TableDescription::tableName.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    Esri::ArcGISRuntime::TaskWatcher Geodatabase::deleteDomain(const QString &domainName)

    Deletes the domain with the specified name from the geodatabase.

    • domainName - The name of the domain to delete.

    Deleting domains is only supported in mobile geodatabases (either created in Pro or via create(QString)). The domain with the specified name must exist in the geodatabase. The domain must not be in use by any fields in existing tables.

    This method returns a TaskWatcher for the asynchronous operation.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    Esri::ArcGISRuntime::TaskWatcher Geodatabase::deleteTable(const QString &tableName)

    Returns deletes an existing table from the geodatabase.

    • tableName - The name of the table to delete.

    Deleting tables is only supported in mobile geodatabases (either created in Pro or via create(QString)). A table with the specified name must exist in the geodatabase. Attempting further use of a deleted table, such as rendering it in a feature layer or querying it, may result in errors.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    QList<Esri::ArcGISRuntime::Domain> Geodatabase::domains() const

    Returns a QList of the domains that exist in the geodatabase.

    The returned QList will be empty if the geodatabase itself is not loaded.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    Esri::ArcGISRuntime::Geometry Geodatabase::generateGeodatabaseGeometry() const

    The geometry used to generate a sync-enabled geodatabase.

    A geodatabase can be generated using geometries including an Envelope or a Polygon. This property will return the underlying Geometry.

    Edits made to a sync-enabled Geodatabase must intersect the geometry used to generate the geodatabase. If an edit is made outside this extent, or area of interest, it will be rejected.

    If the geodatabase was created using GenerateGeodatabaseJob, this property reflects the GenerateGeodatabaseParameters::extent property. If the geometry was created using GenerateOfflineMapJob, this property reflects the GenerateOfflineMapParameters::areaOfInterest property. If the geodatabase was downloaded as part of a PreplannedMapArea, this property matches the geometry used by the web map author when creating the map area. If no geometry was used to create the geodatabase (for example if it was authored using ArcGIS Pro), this property may be an empty Geometry.

    This property is empty until the geodatabase is loaded.

    This function was introduced in Esri::ArcGISRuntime 100.7.

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

    Returns a feature table from the geodatabase containing point, line or polygon features, as specified by its tableName, from the geodatabase.

    If the specified table contains annotation or dimension feature data, then no table is returned.

    Esri::ArcGISRuntime::GeodatabaseFeatureTable *Geodatabase::geodatabaseAnnotationTable(qint64 serviceLayerId) const

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

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

    Returns a list of geodatabase annotation feature tables.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    Esri::ArcGISRuntime::GeodatabaseFeatureTable *Geodatabase::geodatabaseDimensionTable(qint64 serviceLayerId) const

    Returns a feature table containing dimension features from the geodatabase, as specified by the given feature service layer ID.

    • serviceLayerId - The service layer ID of the geodatabase feature table containing dimension features.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    Esri::ArcGISRuntime::GeodatabaseFeatureTable *Geodatabase::geodatabaseDimensionTable(const QString &tableName) const

    Returns a feature table containing dimension features from the geodatabase, as specified by the given tableName.

    • tableName - The name of the geodatabase feature table containing dimension.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    QList<Esri::ArcGISRuntime::GeodatabaseFeatureTable *> Geodatabase::geodatabaseDimensionTables() const

    Returns the geodatabase feature tables that contain dimension features in a QList of GeodatabaseFeatureTable objects

    The results will not include feature tables that contain geometries such as points, lines, polygons, or annotation features. The returned array will be empty if the geodatabase itself is not loaded.

    This function was introduced in Esri::ArcGISRuntime 100.13.

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

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

    Esri::ArcGISRuntime::GeodatabaseFeatureTable *Geodatabase::geodatabaseFeatureTable(qint64 serviceLayerId) const

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

    QList<Esri::ArcGISRuntime::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.

    The results will not include feature tables containing annotation or dimension features.

    bool Geodatabase::hasLocalEdits() const

    Returns true if the geodatabase has local edits.

    For mobile geodatabases created by ArcGIS Pro, this method returns false because there is no concept of uploading or applying edits. For tables from mobile geodatabases, use GeodatabaseFeatureTable::hasLocalEditsSince.

    [static] Esri::ArcGISRuntime::Geodatabase *Geodatabase::instance()

    Returns an instance of the Geodatabase singleton.

    The instance is used to connect to the Object::errorOccurred, and createCompleted signal. You do not need to obtain the instance to call the static methods on the Geodatabase.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    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.

    [override virtual] void Geodatabase::load()

    Reimplements: Loadable::load().

    See Loadable.

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

    Reimplements: Loadable::loadError() const.

    See Loadable.

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

    Reimplements: Loadable::loadStatus() const.

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

    [override virtual] void Geodatabase::retryLoad()

    Reimplements: 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.

    Esri::ArcGISRuntime::SyncModel Geodatabase::syncModel() const

    Returns the geodatabase's supported sync model.

    Esri::ArcGISRuntime::UtilityNetwork *Geodatabase::utilityNetwork(const QString &utilityNetworkName) const

    Returns a UtilityNetwork from the geodatabase with the specified utility network name.

    • utilityNetworkName - The name of the utility network.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    QList<Esri::ArcGISRuntime::UtilityNetwork *> Geodatabase::utilityNetworks() const

    Returns the UtilityNetwork objects that are packaged within the Geodatabase.

    The returned QList will be empty if the geodatabase itself is not loaded or if no utility networks exist in the geodatabase.

    This function was introduced in Esri::ArcGISRuntime 100.11.

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