ArcGIS Runtime SDK for iOS
100.15
|
An AGSFeature
object stored in an AGSArcGISFeatureTable
object.
An AGSArcGISFeature
object can contain:
A feature's attribute values can be changed, but attribute definitions cannot be added, deleted, or modified. If you create an AGSServiceFeatureTable
object from the URL of a feature service, features in the table are initially in one of the following states:
NaN
The initial state of features is determined by the feature request mode of the table. For important details, see AGSFeatureRequestMode
.By default, a query on AGSArcGISFeature
objects in a minimum state will return them in the same state. To access all attributes (or the m-values) of features returned by a query, you must load the features.
You can do one of the following:
loadWithCompletion: (AGSLoadable-p)
on each feature loadOrRefreshFeatures:completion: (AGSServiceFeatureTable)
and pass an array of features to be loaded queryFeaturesWithParameters:queryFeatureFields:completion: (AGSServiceFeatureTable)
with the constant AGSQueryFeatureFieldsLoadAll
, which returns all features in a fully loaded state For more information, see the class description for AGSServiceFeatureTable
. Instance Methods | |
(id< AGSCancelable >) | - addAttachmentWithName:contentType:data:completion: |
(void) | - cancelLoad |
(id< AGSCancelable >) | - deleteAttachment:completion: |
(id< AGSCancelable >) | - deleteAttachments:completion: |
(nullable AGSFeatureSubtype *) | - featureSubtype |
(id< AGSCancelable >) | - fetchAttachmentsWithCompletion: |
(void) | - loadWithCompletion: |
(BOOL) | - refresh |
(BOOL) | - refreshObjectID |
(void) | - relateToFeature: |
(void) | - relateToFeature:relationshipInfo: |
(void) | - retryLoadWithCompletion: |
(void) | - unrelateToFeature: |
(id< AGSCancelable >) | - updateAttachment:name:contentType:data:completion: |
Properties | |
NSMutableDictionary< NSString *, id > * | attributes |
BOOL | canEditAttachments |
BOOL | canUpdateGeometry |
AGSFeatureTable * | featureTable |
AGSGeometry * | geometry |
NSError * | loadError |
AGSLoadStatus | loadStatus |
|
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
- (nullable AGSFeatureSubtype *) featureSubtype |
Gets the corresponding AGSFeatureSubtype
for this feature If this feature belongs to an AGSArcGISFeatureTable
that defines an AGSArcGISFeatureTable::subtypeField
, an AGSFeatureSubtype
that matches AGSFeatureSubtype::code
with this feature's attribute value for subtype field is returned; otherwise, this will return nil
.
AGSFeatureSubtype
for this feature. - (id<AGSCancelable>) fetchAttachmentsWithCompletion: | (nullable void(^)(NSArray< AGSAttachment * > *__nullable result, NSError *__nullable error)) | completion |
Fetch information about attachments that belong to this feature. Attachments are in descending order based on their ID.
completion | A block that is called when the operation is complete. The attachments are passed in as an array of AGSAttachment objects. |
AGSFeatureServiceSessionType
|
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 - (BOOL) refresh |
Resets the attributes and geometry to the values in the data source. This will discards any in-memory changes to the feature that have not been applied to the table, and reloads the feature geometry and all attributes.
- (BOOL) refreshObjectID |
Refreshes the ObjectID and GlobalID attributes of this feature by fetching them again from the geodatabase on disk. This is useful when you create a new feature and add it to the service but still keep holding on to the original reference you got when you created the feature. The original reference does not automatically get the new IDs it was assigned by the service. You can call this method to update the reference with the new IDs.
YES
if the object id and/or global id was changed to a permanent id, NO
if the id was already a permanent value or none was available. refresh (AGSFeature)
instead. - (void) relateToFeature: | (AGSArcGISFeature *) | feature |
Relates this feature to the provided feature if their owning feature tables are related (see relatedTables (AGSArcGISFeatureTable)
). The relationship between the features is established by updating the destination feature's attribute on which the relationship is based.
addFeature:completion: (AGSFeatureTable)
or updateFeature:completion: (AGSFeatureTable)
to finish relating the features. After committing the change, you can use validateRelationshipConstraintsForFeature:completion: (AGSArcGISFeatureTable)
to check if any relationship constraints have been violated.If the relationship is keyed on an Object ID or Global ID, and the origin feature in this call has been newly created and added to a service feature table, you must first call applyEditsWithCompletion: (AGSServiceFeatureTable)
after the feature is added and then refresh (AGSFeature)
to obtain the new Object ID and Global ID generated by the service for the origin feature. If this is not done, then the destination feature will end up referring to an outdated ID and will not be considered related.
feature | that this feature needs to be related to |
- (void) relateToFeature: | (AGSArcGISFeature *) | feature | |
relationshipInfo: | (nullable AGSRelationshipInfo *) | relationshipInfo | |
Relates this feature to the provided feature if their owning feature tables are related through the specified relationship (see relatedTablesWithRelationshipInfo: (AGSArcGISFeatureTable)
). The relationship between the features is established by updating the destination feature's attribute on which the relationship is based.
addFeature:completion: (AGSFeatureTable)
or updateFeature:completion: (AGSFeatureTable)
to finish relating the features. After committing the change, you can use validateRelationshipConstraintsForFeature:completion: (AGSArcGISFeatureTable)
to check if any relationship constraints have been violated.If the relationship is keyed on an Object ID or Global ID, and the origin feature in this call has been newly created and added to a service feature table, you must first call applyEditsWithCompletion: (AGSServiceFeatureTable)
after the feature is added and then refresh (AGSFeature)
to obtain the new Object ID and Global ID generated by the service for the origin feature. If this is not done, then the destination feature will end up referring to an outdated ID and will not be considered related.
feature | that this feature needs to be related to |
relationshipInfo | specifying how to relate the features |
|
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. |
- (void) unrelateToFeature: | (AGSArcGISFeature *) | feature |
Unrelates this feature to the provided feature
addFeature:completion: (AGSFeatureTable)
or updateFeature:completion: (AGSFeatureTable)
to finish unrelating the features. After committing the change, you can use validateRelationshipConstraintsForFeature:completion: (AGSArcGISFeatureTable)
to check if any relationship constraints have been violated.feature | that this feature needs to be unrelated to |
|
readnonatomicstronginherited |
A dictionary containing all the attributes. Attribute types supported are NSNull, NSString, NSDate, and NSNumber. Other attribute types will be ignored.
|
readnonatomicassign |
Indicates whether the feature's attachments can be edited.
|
readnonatomicassign |
Indicates whether the feature's geometry can be updated.
|
readnonatomicweakinherited |
The dataset that this feature belongs to.
|
readwritenonatomicstronginherited |
The geometry that defines shape and location.
|
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.