Geodatabase

class Geodatabase : Loadable

An object that represents a geodatabase.

Constructors

Link copied to clipboard
fun Geodatabase(path: String)

Create 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.getUtilityNetworks().

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun beginTransaction()

Start a transaction on the geodatabase. Starts a new transaction on the geodatabase. An ErrorType.GeodatabaseTransactionStarted error will be thrown if another transaction is already active on the geodatabase. A geodatabase cannot be synchronized while a transaction is active.

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
fun close()

Close a geodatabase. All use of a geodatabase should cease before closing it. For example: terminate geodatabase synchronization, remove feature layers from maps, and release feature tables. Any attempt to access a geodatabase after it is closed will fail, resulting in an error. After closing a geodatabase, the geodatabase file can be deleted.

Link copied to clipboard
fun commitTransaction()

Commit the current transaction on the geodatabase. Commit changes in the current transaction to the geodatabase. This will also end the transaction. An ErrorType.GeodatabaseTransactionNotStarted 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. 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.getName().

Link copied to clipboard
suspend fun createTable(tableDescription: TableDescription): Result<GeodatabaseFeatureTable>

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.getTableName().

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 (either created in Pro or via Geodatabase.create(String)). 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. Only spatial and non-spatial tables can be deleted.

Link copied to clipboard
fun getAnnotationTable(serviceLayerId: Long): GeodatabaseFeatureTable?

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

fun getAnnotationTable(tableName: String): GeodatabaseFeatureTable?

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

Link copied to clipboard
fun getDimensionTable(serviceLayerId: Long): GeodatabaseFeatureTable?

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

fun getDimensionTable(tableName: String): GeodatabaseFeatureTable?

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

Link copied to clipboard
fun getFeatureTable(serviceLayerId: Long): GeodatabaseFeatureTable?

Returns 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 table participates in a controller dataset, such as a utility network or parcel fabric. The presence of utility networks can be checked using Geodatabase.getUtilityNetworks().

fun getFeatureTable(tableName: String): GeodatabaseFeatureTable?

Returns 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?

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

Link copied to clipboard
fun hasLocalEdits(): Boolean

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

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.

Link copied to clipboard
fun rollbackTransaction()

Rollback the current transaction on the geodatabase. Discard changes in the current transaction from the geodatabase. This will also end the transaction. An ErrorType.GeodatabaseTransactionNotStarted error will be thrown if a transaction has not been started on the geodatabase.

Properties

Link copied to clipboard
val annotationTables: List<GeodatabaseFeatureTable>

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

Link copied to clipboard
val dimensionTables: List<GeodatabaseFeatureTable>

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

Link copied to clipboard
val domains: List<Domain>
Link copied to clipboard
val featureTables: List<GeodatabaseFeatureTable>

The geodatabase feature tables that contain geometries such as points, lines or polygons. A ListImpl of GeodatabaseFeatureTable objects. The results will not include feature tables containing annotation or dimension features. 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.getUtilityNetworks(). The returned array will be empty if the geodatabase itself is not loaded.

Link copied to clipboard
val geometryUsedInGeneration: Geometry?
Link copied to clipboard
val isInTransaction: StateFlow<Boolean>

Whether or not a transaction is active on the geodatabase.

Link copied to clipboard
val isSyncEnabled: Boolean

Checks if sync is enabled for the geodatabase.

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

The load status.

Link copied to clipboard
val minServerGeneration: Long

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
val path: String

The geodatabase path. This method can only be used when the geodatabase is not loaded or has previously failed to load.

Link copied to clipboard
val serviceUrl: String

The geodatabase service URL.

Link copied to clipboard
val syncId: Guid?

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.

Link copied to clipboard
val syncModel: SyncModel

The geodatabase sync model.

Link copied to clipboard
val utilityNetworks: List<UtilityNetwork>

The UtilityNetwork objects that are packaged within the Geodatabase. The returned array will be empty if the geodatabase itself is not loaded or if no utility networks exist in the geodatabase.