ArcGIS Runtime SDK for iOS: AGSUtilityNetwork Class Reference
ArcGIS Runtime SDK for iOS  100.9
AGSUtilityNetwork Class Reference

Description

A utility network.

This is the central class for utility network schema information and tracing. AGSUtilityNetwork follows the AGSLoadable pattern. When it loads, it is populated with the utility network schema. This class provides methods to create AGSUtilityElement objects for the AGSUtilityNetwork.

Since
100.6
Inheritance diagram for AGSUtilityNetwork:
AGSLoadableBase <AGSRemoteResource> AGSObject <AGSLoadable>

Instance Methods

(id< AGSCancelable >) - associationsWithElement:completion:
 
(id< AGSCancelable >) - associationsWithElement:type:completion:
 
(id< AGSCancelable >) - associationsWithExtent:completion:
 
(id< AGSCancelable >) - associationsWithExtent:type:completion:
 
(void) - cancelLoad
 
(nullable AGSUtilityElement *) - createElementWithAssetType:globalID:
 
(nullable AGSUtilityElement *) - createElementWithAssetType:globalID:terminal:
 
(nullable AGSUtilityElement *) - createElementWithFeature:
 
(nullable AGSUtilityElement *) - createElementWithFeature:terminal:
 
(id< AGSCancelable >) - featuresForElements:completion:
 
(instancetype) - initWithURL:
 
(instancetype) - initWithURL:map:
 
(void) - loadWithCompletion:
 
(void) - retryLoadWithCompletion:
 
(id< AGSCancelable >) - traceWithParameters:completion:
 

Class Methods

(instancetype) + utilityNetworkWithURL:
 
(instancetype) + utilityNetworkWithURL:map:
 

Properties

AGSCredentialcredential
 
AGSUtilityNetworkDefinitiondefinition
 
NSError * loadError
 
AGSLoadStatus loadStatus
 
NSString * name
 
AGSRequestConfigurationrequestConfiguration
 
NSURL * URL
 

Method Documentation

§ associationsWithElement:completion:()

- (id<AGSCancelable>) associationsWithElement: (AGSUtilityElement *)  element
completion: (void(^)(NSArray< AGSUtilityAssociation * > *__nullable result, NSError *__nullable error))  completion 

Returns a list of all AGSUtilityAssociation objects present in the geodatabase for a given AGSUtilityElement. The result is a list of all associations – connectivity associations, containment associations, structural attachment associations – that include the given AGSUtilityElement object. The method does not return a complete picture of connectivity; features that are connected by geometric coincidence are not returned. Note that the list returned can contain associations that have not yet been validated and are therefore not yet included in the topological index.

Parameters
elementThe AGSUtilityElement whose associations are to be returned.
completionBlock that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
Returns
An operation which can be canceled.
Since
100.7

§ associationsWithElement:type:completion:()

- (id<AGSCancelable>) associationsWithElement: (AGSUtilityElement *)  element
type: (AGSUtilityAssociationType type
completion: (void(^)(NSArray< AGSUtilityAssociation * > *__nullable result, NSError *__nullable error))  completion 

Returns a list of all AGSUtilityAssociation objects of type AGSUtilityAssociationType present in the geodatabase for a given AGSUtilityElement. The method does not return a complete picture of connectivity; features that are connected by geometric coincidence are not returned. Note that the list returned can contain associations that have not yet been validated and are therefore not yet included in the topological index.

Parameters
elementThe AGSUtilityElement whose associations are to be returned.
typeThe AGSUtilityAssociationType of associations to return.
completionBlock that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
Returns
An operation which can be canceled.
Since
100.7

§ associationsWithExtent:completion:()

- (id<AGSCancelable>) associationsWithExtent: (AGSEnvelope *)  extent
completion: (void(^)(NSArray< AGSUtilityAssociation * > *__nullable result, NSError *__nullable error))  completion 

Returns a list of all AGSUtilityAssociation objects (with their geometry) present in the geodatabase for a given AGSEnvelope. The result is a list of connectivity and structural attachment associations. Containment associations are not returned because no geometric relationship is defined between a container and its contents. The method does not return a complete picture of connectivity; features that are connected by geometric coincidence are not returned. Note that the list returned can contain associations that have not yet been validated and are therefore not yet included in the topological index.

Parameters
extentThe AGSEnvelope that defines the area for which associations to return.
completionBlock that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
Returns
An operation which can be canceled.
Since
100.8

§ associationsWithExtent:type:completion:()

- (id<AGSCancelable>) associationsWithExtent: (AGSEnvelope *)  extent
type: (AGSUtilityAssociationType type
completion: (void(^)(NSArray< AGSUtilityAssociation * > *__nullable result, NSError *__nullable error))  completion 

Returns a list of all AGSUtilityAssociation objects (with their geometry) of type AGSUtilityAssociationType present in the geodatabase for a given AGSEnvelope. Containment associations are not returned because no geometric relationship is defined between a container and its contents; consider using associationsWithElement:type:completion: instead. The method does not return a complete picture of connectivity; features that are connected by geometric coincidence are not returned. Note that the list returned can contain associations that have not yet been validated and are therefore not yet included in the topological index.

Parameters
extentThe AGSEnvelope that defines the area for which associations to return.
typeThe AGSUtilityAssociationType of associations to return.
completionBlock that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
Returns
An operation which can be canceled.
Since
100.8

§ cancelLoad()

- (void) cancelLoad
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

Since
100

§ createElementWithAssetType:globalID:()

- (nullable AGSUtilityElement *) createElementWithAssetType: (AGSUtilityAssetType *)  assetType
globalID: (NSUUID *)  globalID 

Creates an AGSUtilityElement from an AGSUtilityAssetType and a GlobalID. If the AGSUtilityAssetType supports an AGSUtilityTerminalConfiguration, a default AGSUtilityTerminal will be assigned.

Parameters
assetTypeThe AGSUtilityAssetType of the feature from which this feature element is created
globalIDThe GlobalID of the feature from which this feature element is created
Returns
A new AGSUtilityElement object
Since
100.7

§ createElementWithAssetType:globalID:terminal:()

- (nullable AGSUtilityElement *) createElementWithAssetType: (AGSUtilityAssetType *)  assetType
globalID: (NSUUID *)  globalID
terminal: (nullable AGSUtilityTerminal *)  terminal 

Creates an AGSUtilityElement from an AGSUtilityAssetType, a GlobalID, and an optional AGSUtilityTerminal. If the optional AGSUtilityTerminal is not supplied, and the AGSUtilityAssetType supports an AGSUtilityTerminalConfiguration, a default AGSUtilityTerminal will be assigned.

Parameters
assetTypeThe AGSUtilityAssetType of the feature from which this feature element is created
globalIDThe GlobalID of the feature from which this feature element is created
terminalThe AGSUtilityTerminal
Returns
A new AGSUtilityElement object
Since
100.6

§ createElementWithFeature:()

- (nullable AGSUtilityElement *) createElementWithFeature: (AGSArcGISFeature *)  feature

Creates an AGSUtilityElement from a feature If the feature's AGSUtilityAssetType supports an AGSUtilityTerminalConfiguration, a default AGSUtilityTerminal will be assigned.

Parameters
featureThe AGSArcGISFeature from which the feature element is created
Returns
A new AGSUtilityElement object
Since
100.7

§ createElementWithFeature:terminal:()

- (nullable AGSUtilityElement *) createElementWithFeature: (AGSArcGISFeature *)  feature
terminal: (nullable AGSUtilityTerminal *)  terminal 

Creates an AGSUtilityElement from a feature and an optional AGSUtilityTerminal. If the optional AGSUtilityTerminal is not supplied, and the feature's AGSUtilityAssetType supports an AGSUtilityTerminalConfiguration, a default AGSUtilityTerminal will be assigned.

Parameters
featureThe AGSArcGISFeature from which the feature element is created
terminalThe AGSUtilityTerminal
Returns
A new AGSUtilityElement object
Since
100.6

§ featuresForElements:completion:()

- (id<AGSCancelable>) featuresForElements: (NSArray< AGSUtilityElement * > *)  elements
completion: (void(^)(NSArray< AGSArcGISFeature * > *__nullable result, NSError *__nullable error))  completion 

Gets an array of loaded AGSArcGISFeature objects that each correspond to one of an array of AGSUtilityElement objects

Parameters
elementsThe array of utility elements used to find corresponding features
completionBlock that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated.
Returns
An operation which can be canceled.
Since
100.6

§ initWithURL:()

- (instancetype) initWithURL: (NSURL *)  URL

Creates an AGSUtilityNetwork using the URL to the feature service

Parameters
URLThe URL to the feature service
Since
100.6

§ initWithURL:map:()

- (instancetype) initWithURL: (NSURL *)  URL
map: (AGSMap *)  map 

Creates a utility network with the URL to the feature service and a map Creates a utility network associated with a particular service, using the same AGSArcGISFeatureTable objects in use by AGSFeatureLayer objects within the map. This lets any AGSUtilityElement or AGSArcGISFeature objects the AGSUtilityNetwork creates or uses be associated with those existing tables and layers. Usually used when instantiating an AGSUtilityNetwork object from a web map.

Parameters
URLThe URL to the Feature Service
mapA Map that provides FeatureTables to be reused by the utility network
Since
100.6

§ loadWithCompletion:()

- (void) loadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
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.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100
See also
- cancelLoad to cancel loading
- retryLoadWithCompletion: to force reload

§ retryLoadWithCompletion:()

- (void) retryLoadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:

  1. you didn't have network connectivity earlier when it failed and you want to retry now that you have connectivity
  2. the server was down earlier when it failed and you want to retry
  3. the request is taking too long and you want to cancel it and retry, in which case you will first call cancelLoad and then this method

If 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.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100

§ utilityNetworkWithURL:()

+ (instancetype) utilityNetworkWithURL: (NSURL *)  URL

Creates an AGSUtilityNetwork using the URL to the feature service

Parameters
URLThe URL to the feature service
Since
100.6

§ utilityNetworkWithURL:map:()

+ (instancetype) utilityNetworkWithURL: (NSURL *)  URL
map: (AGSMap *)  map 

Creates a utility network with the URL to the feature service and a map Creates a utility network associated with a particular service, using the same AGSArcGISFeatureTable objects in use by AGSFeatureLayer objects within the map. This lets any AGSUtilityElement or AGSArcGISFeature objects the AGSUtilityNetwork creates or uses be associated with those existing tables and layers. Usually used when instantiating an AGSUtilityNetwork object from a web map.

Parameters
URLThe URL to the Feature Service
mapA Map that provides FeatureTables to be reused by the utility network
Since
100.6

Property Documentation

§ credential

- (AGSCredential*) credential
readwritenonatomicstronginherited

Security credentials to access the remote resource. Only applicable if the resource is secured.

Since
100

§ definition

- (AGSUtilityNetworkDefinition*) definition
readnonatomicstrong

The definition of the AGSUtilityNetwork

See also
AGSUtilityNetworkDefinition
Since
100.6

§ loadError

- (NSError*) loadError
readnonatomicstronginherited

The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.

Since
100

§ loadStatus

- (AGSLoadStatus) loadStatus
readrequirednonatomicassigninherited

Status of the load operation.

Since
100

§ name

- (NSString*) name
readnonatomiccopy

The name of the AGSUtilityNetwork.

Since
100.8

§ requestConfiguration

- (AGSRequestConfiguration*) requestConfiguration
readwritenonatomicstronginherited

The AGSRequestConfiguration object which defines the behavior and policies to use when accessing the remote resource. The default will be nil. If it is nil the [AGSRequestConfiguration globalConfiguration] will be used.

Since
100

§ URL

- (NSURL*) URL
readrequirednonatomicstronginherited

The URL of the remote resource.

Since
100