ArcGIS Runtime SDK for iOS
100.15
|
A geodatabase on disk.
Instances of this class represent a local geodatabase (.geodatabase file) containing geographic datasets. The geodatabase is based on the SQLite database engine.
AGSGeodatabaseSyncTask
to generate and synchronize a geodatabase with a supporting ArcGIS Feature service. Class Methods | |
(id< AGSCancelable >) | + createWithFileURL:completion: |
(instancetype) | + geodatabaseWithFileURL: |
(instancetype) | + geodatabaseWithName: |
Properties | |
NSArray< AGSDomain * > * | domains |
NSURL * | fileURL |
AGSEnvelope * | generateGeodatabaseExtent |
AGSGeometry * | generateGeodatabaseGeometry |
NSArray< AGSGeodatabaseFeatureTable * > * | geodatabaseAnnotationTables |
NSArray< AGSGeodatabaseFeatureTable * > * | geodatabaseDimensionTables |
NSArray< AGSGeodatabaseFeatureTable * > * | geodatabaseFeatureTables |
BOOL | inTransaction |
NSError * | loadError |
AGSLoadStatus | loadStatus |
NSInteger | minServerGeneration |
NSURL * | serviceURL |
BOOL | syncEnabled |
NSUUID * | syncID |
AGSSyncModel | syncModel |
NSArray< AGSUtilityNetwork * > * | utilityNetworks |
- (BOOL) beginTransaction: | (NSError **) | error |
Starts a new transaction on the geodatabase. An error will be provided if another transaction is already active on the geodatabase. A geodatabase cannot be synchronized while a transaction is active.
|
requiredinherited |
Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion:
or retryLoadWithCompletion:
to complete and this will call them all back with the error of NSUserCancelledError
- (void) close |
Close connection to the 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.
- (BOOL) commitTransaction: | (NSError **) | error |
Commits changes in the current transaction to the geodatabase. This will also end the transaction. An error will be provided if a transaction has not been started on the geodatabase.
- (id<AGSCancelable>) createDomainWithDomainDescription: | (AGSDomainDescription *) | domainDescription | |
completion: | (void(^)(AGSDomain *__nullable result, NSError *__nullable error)) | completion | |
Creates a new domain in the geodatabase.
Creating domains is only supported in mobile geodatabases (either created in ArcGIS Pro or via createWithFileURL:completion:
). The AGSFieldType
of the domain cannot be unknown. The domain name must not already exist in the geodatabase. For additional domain name constraints, see AGSDomainDescription::name
.
domainDescription | The description of the domain to create. |
completion | A Block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
- (id<AGSCancelable>) createTableWithTableDescription: | (AGSTableDescription *) | tableDescription | |
completion: | (void(^)(AGSGeodatabaseFeatureTable *__nullable result, NSError *__nullable error)) | completion | |
Creates a new table in the geodatabase.
Creating tables is only supported in mobile geodatabases (either created in ArcGIS Pro or via createWithFileURL:completion:
). The table name must not already exist in the geodatabase. For additional table name constraints, see AGSTableDescription::tableName
.
tableDescription | The description of the table to create. |
completion | A block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
+ (id<AGSCancelable>) createWithFileURL: | (NSURL *) | fileURL | |
completion: | (void(^)(AGSGeodatabase *__nullable result, NSError *__nullable error)) | completion | |
Creates an empty mobile geodatabase at the specified URL.
The URL must be non-empty, available, allow read/write access, and end in ".geodatabase". If any of these restrictions are violated, the task will not succeed and a task error will be set.
fileURL | The URL (including .geodatabase file extension) at which the mobile geodatabase should be created. |
completion | A block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
- (id<AGSCancelable>) deleteDomainWithDomainName: | (NSString *) | domainName | |
completion: | (void(^)(NSError *__nullable error)) | completion | |
Deletes the domain with the specified name from the geodatabase.
Deleting domains is only supported in mobile geodatabases (either created in ArcGIS Pro or via createWithFileURL:completion:
). The domain with the specified name must exist in the geodatabase. The domain must not be in use by any fields in existing tables.
domainName | The name of the domain to delete. |
completion | The error parameter is populated on failure. |
- (id<AGSCancelable>) deleteTableWithTableName: | (NSString *) | tableName | |
completion: | (void(^)(NSError *__nullable error)) | completion | |
Deletes an existing table from the geodatabase.
Deleting tables is only supported in mobile geodatabases (either created in ArcGIS Pro or via createWithFileURL:completion:
). 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.
tableName | The name of the table to delete. |
completion | The error parameter is populated on failure. |
- (void) doCancelLoading |
Never call this method directly. The framework calls this method on a background thread when cancelLoad (AGSLoadable-p)
is called. It is meant to be overriden by subclasses. Subclasses should override this method to cancel loading their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly))
at the end passing in an error representing NSUserCancelledError
.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (void) doStartLoading: | (BOOL) | retrying |
Never call this method directly. The framework calls this method on a background thread when loadWithCompletion: (AGSLoadable-p)
or retryLoadWithCompletion: (AGSLoadable-p)
is called. It is meant to be overriden by subclasses. Subclasses should override this method to load their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly))
upon completion, passing in the error if any.
retrying | flag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p) . |
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (nullable AGSGeodatabaseFeatureTable *) geodatabaseAnnotationTableWithServiceLayerID: | (NSInteger) | serviceLayerID |
Returns a feature table containing annotation features from the geodatabase, as specified by the given feature service layer ID.
serviceLayerID | The service layer ID of the geodatabase feature table containing annotation features. |
- (nullable AGSGeodatabaseFeatureTable *) geodatabaseAnnotationTableWithTableName: | (NSString *) | tableName |
Returns a feature table containing annotation features from the geodatabase, as specified by the given tableName.
tableName | The name of the geodatabase feature table containing annotation. |
- (nullable AGSGeodatabaseFeatureTable *) geodatabaseDimensionTableWithServiceLayerID: | (NSInteger) | serviceLayerID |
Returns a feature table containing dimension features from the geodatabase, as specified by the given feature service layer ID.
serviceLayerID | The service layer ID of the geodatabase feature table containing dimension features. |
- (nullable AGSGeodatabaseFeatureTable *) geodatabaseDimensionTableWithTableName: | (NSString *) | tableName |
Returns a feature table containing dimension features from the geodatabase, as specified by the given tableName
.
tableName | The name of the geodatabase feature table containing dimension. |
- (nullable AGSGeodatabaseFeatureTable *) geodatabaseFeatureTableByServiceLayerID: | (NSInteger) | serviceLayerID |
Returns a feature table from the geodatabase containing point, line or polygon features, as specified by the given feature service layer ID. The ID must match AGSArcGISFeatureLayerInfo::serviceLayerID
serviceLayerID | The service layer ID of the geodatabase feature table. |
- (nullable AGSGeodatabaseFeatureTable *) geodatabaseFeatureTableWithName: | (NSString *) | tableName |
Returns a feature table from the geodatabase containing point, line or polygon features, as specified by the given tableName. If the geodatabase was generated from an ArcGIS Feature service, the name corresponds to a layer in the ArcGIS Feature service (AGSArcGISFeatureLayerInfo::serviceLayerName
)
tableName | The name of the geodatabase feature table. |
+ (instancetype) geodatabaseWithFileURL: | (NSURL *) | fileURL |
Instantiates an existing geodatabase at the given path.
fileURL | to existing geodatabase (including .geodatabase file extension). |
+ (instancetype) geodatabaseWithName: | (NSString *) | name |
Initialize this object with the name of an existing geodatabase (.geodatabase file), excluding the ".geodatabase" extension, within the application bundle or shared documents directory.
name | of the geodatabase (excluding the .geodatabase extension). |
- (BOOL) hasLocalEdits |
Indicates whether the geodatabase has local edits.
For mobile geodatabases created by ArcGIS Pro, this method returns NO
because there is no concept of uploading or applying edits. For tables from mobile geodatabases, use hasLocalEditsSince: (AGSGeodatabaseFeatureTable)
.
- (instancetype) initWithFileURL: | (NSURL *) | fileURL |
Instantiates an existing geodatabase at the given path.
fileURL | to existing geodatabase (including .geodatabase file extension). |
- (instancetype) initWithName: | (NSString *) | name |
Initialize this object with the name of an existing geodatabase (.geodatabase file), excluding the ".geodatabase" extension, within the application bundle or shared documents directory.
name | of the geodatabase (excluding the .geodatabase extension). |
- (void) loadDidFinishWithError: | (nullable NSError *) | error |
Only subclasses should call this method in doStartLoading: (AGSLoadableBase(ForSubclassEyesOnly))
and doCancelLoading (AGSLoadableBase(ForSubclassEyesOnly))
when done loading or failed to load.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
requiredinherited |
Loads data for the object asynchronously. The completion block is invoked upon completion.
You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- cancelLoad
to cancel loading - retryLoadWithCompletion:
to force reload - (void) onLoadStatusChanged |
Never call this method directly. The framework calls this method on a background thread when AGSLoadable::loadStatus
changes is called. Subclasses can optionally implement this to know when their loading status has changed.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
requiredinherited |
Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:
cancelLoad
and then this methodIf the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- (BOOL) rollbackTransaction: | (NSError **) | error |
Discard changes in the current transaction from the geodatabase. This will also end the transaction. An error will be provided if a transaction has not been started on the geodatabase.
- (nullable AGSUtilityNetwork *) utilityNetworkWithName: | (NSString *) | name |
Returns an AGSUtilityNetwork
from the geodatabase with the specified utility network name.
name | The name of the utility network. |
AGSUtilityNetwork
is returned.
|
readnonatomiccopy |
Returns an observable array of the domains that exist in the geodatabase.
The returned array will be empty if the geodatabase itself is not loaded.
|
readnonatomicstrong |
The file URL of the geodatabase.
|
readnonatomicstrong |
The extent used to generate the geodatabase.
AGSGeodatabase::generateGeodatabaseGeometry
. A geodatabase can be generated using geometry including an AGSEnvelope
or an AGSPolygon
- this property will always return the bounding envelope. The AGSGeodatabase::generateGeodatabaseGeometry
property will return the underlying geometry. Provided by category AGSGeodatabase(AGSDeprecated).
|
readnonatomicstrong |
The geometry (for example an AGSEnvelope
or AGSPolygon
) used to generate a sync enabled geodatabase. Edits made to a sync enabled AGSGeodatabase
must intersect the geometry used to generate the geodatabase. If an edit is made outside this extent, or area of interest, it will be rejected. This property will return the geometry which was used to create this geodatabase. For example, if the geodatabase was created using an AGSGenerateGeodatabaseJob
, this property reflects the AGSGenerateGeodatabaseParameters::extent
property. If the geometry was created using an AGSGenerateOfflineMapJob
, this property reflects the AGSGenerateOfflineMapParameters::areaOfInterest
property. If the geodatabase was downloaded as part of an AGSPreplannedMapArea
, this property will match the geometry used by the web map author when the map area was created. If no geometry was used to create the geodatabase (for example if it was authored using ArcGIS Pro), this property may be nil
. This property will also be nil
until the geodatabase is loaded and the AGSGeodatabase::loadStatus
is AGSLoadStatusLoaded
.
|
readnonatomiccopy |
The geodatabase feature tables that contain annotation features. An NSArray
of AGSGeodatabaseFeatureTable
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.
|
readnonatomiccopy |
The geodatabase feature tables that contain dimension features. An array of AGSGeodatabaseFeatureTable
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.
|
readnonatomiccopy |
The geodatabase feature tables that contain geometries such as points, lines or polygons. The results will not include feature tables containing annotation or dimension features. The returned array will be empty if the geodatabase itself is not loaded.
|
readnonatomicassign |
Indicates whether or not a transaction is active in the geodatabase.
|
readnonatomicstronginherited |
The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.
|
readrequirednonatomicassigninherited |
Status of the load operation.
|
readnonatomicassign |
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 are applied to the geodatabase. New changes from the online feature service are synced to the local geodatabase. If the AGSGeodatabase::syncModel
is AGSSyncModelGeodatabase
, the value will indicate the server generation number for the entire geodatabase. If the AGSGeodatabase::syncModel
is AGSSyncModelLayer
, 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 (AGSSyncModelNone
).
This property will be -1 until the geodatabase's AGSLoadable::loadStatus
is AGSLoadStatusLoaded
.
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.
|
readnonatomicstrong |
The geodatabase service URL.
|
readnonatomicassign |
Indicates whether this geodatabase was originally downloaded from a sync-enabled ArGIS feature service. If YES
, its data can be snychronized with the service.
|
readnonatomicstrong |
The sync ID of the geodatabase. Only available if the geodatabase is syncEnabled
. The 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 after it has already been deleted locally using unregisterGeodatabaseWithSyncID:completion: (AGSGeodatabaseSyncTask)
|
readnonatomicassign |
The sync model defining how datasets within this geodatabase can be synchronized with the originating source. Only applicable if this geodatabase was originally downloaded from a sync-enabled ArGIS feature service (syncEnabled
).
|
readnonatomiccopy |
The AGSUtilityNetwork
objects that are packaged within the AGSGeodatabase
.
The returned array will be empty if the geodatabase itself is not loaded or if no utility networks exist in the geodatabase.