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:
A com.arcgismaps.mapping.layers.FeatureLayer from any table returned by Geodatabase.featureTables that contains point, polyline, or polygon features. Check that FeatureTable.hasGeometry is true.
An com.arcgismaps.mapping.layers.AnnotationLayer from any table returned by Geodatabase.annotationTables.
A com.arcgismaps.mapping.layers.DimensionLayer from any table returned by Geodatabase.dimensionTables.
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
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.
Properties
A collection of GeodatabaseFeatureTable from the geodatabase that contain annotation features. The collection is empty if the geodatabase is not loaded.
A collection of GeodatabaseFeatureTable from the geodatabase that contain dimension features. The collection is empty if the geodatabase is not loaded.
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.
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.
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.
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.
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.
The service URL from which the geodatabase was obtained.
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).
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.
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.
Functions
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Gets an com.arcgismaps.utilitynetworks.UtilityNetwork from the geodatabase with the specified utility network name.
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.
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.