;

Geodatabase Class

  • Geodatabase
  • class Esri::ArcGISRuntime::Geodatabase

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

    Header: #include <Geodatabase>
    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::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 *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 doneLoading(Esri::ArcGISRuntime::Error loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
    void transactionStatusChanged(bool isInTransaction)

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

    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 the specified geodatabase annotation feature table, given its tableName, from the geodatabase.

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

    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.

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