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 GeodatabaseSyncTask and the 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[https://developers.arcgis.com/documentation/mapping-apis-and-services/offline/] for more information.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(path: String)

Creates a geodatabase object with the given path. 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 GenerateGeodatabaseJob, the geometry matches the GenerateGeodatabaseParameters.extent. If the geodatabase was created using the GenerateOfflineMapJob, the geometry reflects the GenerateOfflineMapParameters.areaOfInterest. If the geodatabase was downloaded as part of a PreplannedMapArea, this property will match the geometry used by the web map author when the offline map area was created. See Build offline applications[https://developers.arcgis.com/documentation/mapping-apis-and-services/offline/] 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 GenerateGeodatabaseJob or the GenerateOfflineMapJob. It can also be downloaded as part of a PreplannedMapArea. See GeodatabaseSyncTask and 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 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. Transactions must be started and stopped on a single thread of execution.

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

Creates a new domain in the geodatabase. Creating domains is only supported in mobile geodatabases (either created in Pro or via Geodatabase.create(String)). The FieldType of the domain cannot be unknown. The domain name must not already exist in the geodatabase. For additional domain name constraints, see DomainDescription.name.

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(String)). 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(String)). 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(String). 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 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 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 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(Instant).

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. Transactions must be started and stopped on a single thread of execution.

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.