Skip To Content ArcGIS for Developers Sign In Dashboard

Geodatabase QML Type

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

Import Statement: import Esri.ArcGISRuntime 100.6
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Properties

Signals

Methods

Detailed Description

The Geodatabase type 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. By default, the Geodatabase type is automatically loaded after instantiated if a path to a geodatabase file was supplied. You can change this default behavior by declaring the autoLoad property as false.

Both the geodatabaseFeatureTablesByTableName and geodatabaseFeatureTablesByLayerId properties may be used with property binding. They are both updated when the Geodatabase has loaded.

// create a feature layer
FeatureLayer {
    // obtain the feature table from the geodatabase by name
    featureTable: gdb.geodatabaseFeatureTablesByTableName["Trailheads"] ?
                      gdb.geodatabaseFeatureTablesByTableName["Trailheads"] :
                      null

    // create the geodatabase
    Geodatabase {
        id: gdb
        path: dataPath + "geodatabase/LA_Trails.geodatabase"

        onErrorChanged: errorMessage = error.message;
    }

    onErrorChanged: errorMessage = error.message;
}

See also Loadable and GeodatabaseFeatureTable.

Property Documentation

autoLoad : bool

Determines if this Geodatabase instance should attempt to automatically load after it has instantiated.

By default this property is true which means a Geodatabase will attempt to load if it has a path to a mobile geodatabase file. It may be useful to declare this property as false in the case you would like to delay the loading of the Geodatabase to be controlled manually at a later time.

This property cannot be set after the Geodatabase has instantiated.


error : Error

Returns the error object (read-only).

See also Loadable and Error.


generateGeodatabaseExtent : Envelope

Returns the extent used to generate the geodatabase (read-only).

This property is populated after the geodatabase loads.


geodatabaseAnnotationTables : list<GeodatabaseFeatureTable>

Returns a list of geodatabase annotation feature tables in the mobile geodatabase (read-only).

You can add one of the annotation feature tables instances from the list to a feature layer to display the features on a map. Or, you can open feature tables directly to work with their data.

This property is populated after the geodatabase loads.

This QML property was introduced in Esri::ArcGISRuntime 100.6.


geodatabaseAnnotationTablesByLayerId : jsobject

Returns a map of geodatabase annotation feature tables with the service layer ID as the key (read-only).

This property is populated after the geodatabase loads.


geodatabaseAnnotationTablesByTableName : jsobject

Returns a map of geodatabase annotation feature tables with the table name as the key (read-only).

This property is populated after the geodatabase loads.


geodatabaseFeatureTables : list<GeodatabaseFeatureTable>

Returns a list of geodatabase feature tables in the mobile geodatabase (read-only).

You can add one of the feature tables instances from the list to a feature layer to display the features on a map. Or, you can open feature tables directly to work with their data.

This property is populated after the geodatabase loads.


geodatabaseFeatureTablesByLayerId : jsobject

Returns a map of geodatabase feature tables with the service layer ID as the key (read-only).

This property is populated after the geodatabase loads.


geodatabaseFeatureTablesByTableName : jsobject

Returns a map of geodatabase feature tables with the table name as the key (read-only).

This property is populated after the geodatabase loads.


hasLocalEdits : bool

Returns whether the geodatabase has local edits (read-only).

This property is populated after the geodatabase loads.


inTransaction : bool

Returns whether a transaction is currently active on the geodatabase (read-only).

This QML property was introduced in Esri.ArcGISRuntime 100.3.


loadError : Error

Returns the load error (read-only).

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable.


loadStatus : Enums.LoadStatus

Returns the load status code of this Loadable object (read-only).

See also Enums.LoadStatus and Loadable.


minServerGeneration : string

The minimum server generation number for the geodatabase (read-only).

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 Enums.SyncModelGeodatabase, the value will indicate the server generation number for the entire geodatabase. If the syncModel is Enums.SyncModelLayer, 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 (Enums.SyncModelNone).

This property will be -1 until the geodatabase is Enums.LoadStatusLoaded.

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.

Note: The underlying Runtime property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.

This QML property was introduced in Esri.ArcGISRuntime 100.6.

See also GeodatabaseSyncTask::importGeodatabaseDelta and minServerGenerationAsInt.


minServerGenerationAsInt : double

The same as minServerGeneration but represented as an integer type (read-only).

Note: The underlying Runtime property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.

This QML property was introduced in Esri.ArcGISRuntime 100.6.


path : url

The path to the mobile geodatabase file.

You cannot set the path to the geodatabase after the instance is already loaded.


serviceUrl : url

Returns the URL of the service that was the source of this geodatabase (read-only).

This property is populated after the geodatabase loads.


syncEnabled : bool

Returns whether sync is enabled for the geodatabase (read-only).

This property is populated after the geodatabase loads.


syncId : string

Returns the sync ID of the geodatabase (read-only).

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 string will be empty if there is an error or if this is not a sync enabled geodatabase or the geodatabase is not loaded.

This QML property was introduced in Esri.ArcGISRuntime 100.2.

See also GeodatabaseSyncTask.


syncModel : Enums.SyncModel

Returns the geodatabase's supported sync model (read-only).

This property is populated after the geodatabase loads.

See also Enums.SyncModel.


Signal Documentation

autoLoadChanged()

Emitted when the autoLoad property changes.


generateGeodatabaseExtentChanged()

Emitted when the generateGeodatabaseExtent property changes.


geodatabaseAnnotationTablesByLayerIdChanged()

Emitted when the geodatabaseAnnotationTablesByLayerId property changes.


geodatabaseAnnotationTablesByTableNameChanged()

Emitted when the geodatabaseAnnotationTablesByTableName property changes.


geodatabaseAnnotationTablesChanged()

Emitted when the geodatabaseAnnotationTables property changes.


geodatabaseFeatureTablesByLayerIdChanged()

Emitted when the geodatabaseFeatureTablesByLayerId property changes.


geodatabaseFeatureTablesByTableNameChanged()

Emitted when the geodatabaseFeatureTablesByTableName property changes.


geodatabaseFeatureTablesChanged()

Emitted when the geodatabaseFeatureTables property changes.


hasLocalEditsChanged()

Emitted when the hasLocalEdits property changes.


inTransactionChanged()

Emitted when the inTransaction property changes.

This QML signal was introduced in Esri.ArcGISRuntime 100.3.


loadErrorChanged()

Emitted when the loadError property of this Geodatabase changes.

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable and Object.


loadStatusChanged()

Emitted when the loadStatus property changes.

See also Loadable.


minServerGenerationAsIntChanged()

Emitted when the minServerGenerationAsInt property changes.

This QML signal was introduced in Esri.ArcGISRuntime 100.6.


minServerGenerationChanged()

Emitted when the minServerGeneration property changes.

This QML signal was introduced in Esri.ArcGISRuntime 100.6.


pathChanged()

Emitted when the path property changes.


serviceUrlChanged()

Emitted when the serviceUrl property changes.


syncEnabledChanged()

Emitted when the syncEnabled property changes.


syncIdChanged()

Emitted when the syncId property changes.


syncModelChanged()

Emitted when the syncModel property changes.


Method Documentation

void 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 QML method was introduced in Esri.ArcGISRuntime 100.3.


void 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 QML method was introduced in Esri.ArcGISRuntime 100.1.


void commitTransaction()

Commits the current transaction on the geodatabase.

This method ends the current transaction and commits the changes.

This QML method was introduced in Esri.ArcGISRuntime 100.3.


void rollbackTransaction()

Rolls back the current transaction on the geodatabase.

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

This QML method was introduced in Esri.ArcGISRuntime 100.3.



Feedback on this topic?