Geodatabase

A mobile geodatabase containing geographic data and non-spatial tables. Geodatabase is used to open and access the contents of a mobile geodatabase (.geodatabase file) that can contain geographic features, non-spatial tabular data, and data such as attachments, utility networks, field domain definitions, contingent values, and relationships between layers/tables.

Geodatabases can contain one or more geodatabase feature tables. You can create a layer from a GeodatabaseFeatureTable tables, as follows:

You can generate a mobile geodatabase file from an ArcGIS feature service and downloaded it to a device using offline workflows offered by the com.arcgismaps.tasks.geodatabase.GeodatabaseSyncTask and the com.arcgismaps.tasks.offlinemaptask.OfflineMapTask. Apps can then operate offline to view and edit the features in these geodatabases. If the geodatabases are enabled for synchronization with the original feature service, edits can be synchronized when connectivity is restored.

Mobile geodatabase files can also be created with ArcGIS Pro. These geodatabases can be used offline but they do not support synchronization with the original feature service. See Build offline applications for more information.

For editing workflows that use a mobile geodatabase, you can use geodatabase transactions to manage a set of edits (transaction). If you start a transaction with Geodatabase.beginTransaction, you can control when edits are committed (saved) as a single unit using Geodatabase.commitTransaction. If you decide to discard the edits you can use Geodatabase.rollbackTransaction. If the app unexpectedly disconnects from the geodatabase, any active transaction will be rolled back. If the app crashes, or the user closes the app without saving edits, the transaction will be rolled back and the edits discarded.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(path: String)

Creates a Geodatabase with the name of an existing geodatabase file. If the specified path points to a stand-alone mobile geodatabase created with ArcGIS Pro and contains a controller dataset, such as a utility network or parcel fabric, the feature tables on this geodatabase are read-only. The presence of utility networks can be checked using Geodatabase.utilityNetworks.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

A collection of GeodatabaseFeatureTable from the geodatabase that contain annotation features. The collection is empty if the geodatabase is not loaded.

Link copied to clipboard

A collection of GeodatabaseFeatureTable from the geodatabase that contain dimension features. The collection is empty if the geodatabase is not loaded.

Link copied to clipboard
val domains: StateFlow<List<Domain>>

A collection of the domains that exist in the geodatabase. The collection will be empty if the geodatabase is not loaded.

Link copied to clipboard

A collection of GeodatabaseFeatureTable from the geodatabase that contain geometries, such as points, lines or polygons. Feature tables in this array are read-only when the geodatabase is a stand-alone mobile geodatabase created with ArcGIS Pro and tables participate in a controller dataset, such as a utility network or parcel fabric. The presence of utility networks can be checked using Geodatabase.utilityNetworks.

Link copied to clipboard

The geometry that was used to generate the sync-enabled geodatabase. If the geodatabase was created using the com.arcgismaps.tasks.geodatabase.GenerateGeodatabaseJob, the geometry matches the com.arcgismaps.tasks.geodatabase.GenerateGeodatabaseParameters.extent. If the geodatabase was created using the com.arcgismaps.tasks.offlinemaptask.GenerateOfflineMapJob, the geometry reflects the com.arcgismaps.tasks.offlinemaptask.GenerateOfflineMapParameters.areaOfInterest. If the geodatabase was downloaded as part of a com.arcgismaps.tasks.offlinemaptask.PreplannedMapArea, this property will match the geometry used by the web map author when the offline map area was created. See Build offline applications for more information on taking data offline.

Link copied to clipboard
val isInTransaction: StateFlow<Boolean>

True if a transaction is active on the geodatabase, false otherwise. A transaction manages a series of geodatabase edits as a single unit of work. You can start a transaction by calling Geodatabase.beginTransaction. All edits made after this call are part of the transaction.

Link copied to clipboard

True if the geodatabase was originally downloaded from a sync-enabled ArcGIS feature service, false otherwise. A sync-enabled geodatabase can be requested from an ArcGIS feature service using the com.arcgismaps.tasks.geodatabase.GenerateGeodatabaseJob or the com.arcgismaps.tasks.offlinemaptask.GenerateOfflineMapJob. It can also be downloaded as part of a com.arcgismaps.tasks.offlinemaptask.PreplannedMapArea. See com.arcgismaps.tasks.geodatabase.GeodatabaseSyncTask and com.arcgismaps.tasks.offlinemaptask.OfflineMapTask for more information.

Link copied to clipboard

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.

Link copied to clipboard

The path to the geodatabase.

Link copied to clipboard

The service URL from which the geodatabase was obtained.

Link copied to clipboard
val syncId: Guid?

The sync ID of the geodatabase. Sync ID is available if Geodatabase.isSyncEnabled is true. The sync ID is the same as the replica ID described in the REST documentation. It is used by the geodatabase's service to uniquely identify the geodatabase when carrying out sync operations. It is also used to unregister the geodatabase using the GeodatabaseSyncTask.unregisterGeodatabaseAsync(GUID).

Link copied to clipboard

The sync model defining how datasets within the geodatabase are synchronized with the originating ArcGIS feature service. Sync model only applies to the geodatabase if Geodatabase.isSyncEnabled is true.

Link copied to clipboard

The collection of com.arcgismaps.utilitynetworks.UtilityNetwork objects that are packaged within the Geodatabase. The collection will be empty if the geodatabase is not loaded or if no utility networks exist in the geodatabase.

Inherited properties

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Functions

Link copied to clipboard

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.

Link copied to clipboard
fun close()

Closes the connection to the geodatabase. You should stop using the geodatabase before you close it. For example, you should terminate geodatabase synchronization, remove feature layers from maps, and release the feature tables. Any attempt to access the geodatabase after it is closed will fail, resulting in an error. After closing a geodatabase, you can delete the geodatabase file from the device.

Link copied to clipboard

Commits the edits in the transaction to the geodatabase. Commits the edits in the current transaction to the geodatabase. This will also end the transaction. An error will be thrown if a transaction has not been started on the geodatabase.

Link copied to clipboard
suspend fun createDomain(domainDescription: DomainDescription): Result<Domain>

Creates a new domain in the geodatabase. You can create a new domain in a mobile geodatabase that was created in ArcGIS Pro or using Geodatabase.create. The domain description can be a CodedValueDomainDescription or a RangeDomainDescription.

Link copied to clipboard

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

Link copied to clipboard
suspend fun deleteDomain(domainName: String): Result<Unit>

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

Link copied to clipboard
suspend fun deleteTable(tableName: String): Result<Unit>

Deletes an existing table from the geodatabase. Deleting tables is only supported in mobile geodatabases created in ArcGIS Pro or using Geodatabase.create. Attempting further use of a deleted table, such as rendering it in a feature layer or querying it, may result in errors.

Link copied to clipboard

Gets a feature table containing annotation features from the geodatabase, as specified by the given feature service layer ID. The service layer ID must match the com.arcgismaps.arcgisservices.ArcGISFeatureLayerInfo.serviceLayerId.

Gets a feature table containing annotation features from the geodatabase, as specified by the given tableName.

Link copied to clipboard

Gets a feature table containing dimension features from the geodatabase, as specified by the given feature service layer ID. The service layer ID must match the com.arcgismaps.arcgisservices.ArcGISFeatureLayerInfo.serviceLayerId.

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

Link copied to clipboard

Gets a feature table from the geodatabase containing point, line or polygon features, as specified by the given feature service layer ID. The feature table returned is read-only when the geodatabase is a stand-alone mobile geodatabase created with ArcGIS Pro and the table participates in a controller dataset, such as a utility network or parcel fabric. The presence of utility networks can be checked using Geodatabase.utilityNetworks.

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

Link copied to clipboard
fun getUtilityNetwork(utilityNetworkName: String): UtilityNetwork?

Gets an com.arcgismaps.utilitynetworks.UtilityNetwork from the geodatabase with the specified utility network name.

Link copied to clipboard

True if the geodatabase has local edits, false otherwise. If the geodatabase was created by ArcGIS Pro, this method returns false because there is no concept of uploading or applying edits. If you want to determine which tables have local edits, examine GeodatabaseFeatureTable.hasLocalEditsSince.

Link copied to clipboard

Rollback the edits in the transaction from the geodatabase. Discards the edits in the current transaction from the geodatabase. This will also end the transaction. An error will be thrown if a transaction has not been started on the geodatabase.

Inherited functions

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.