ArcGIS Runtime SDK for iOS: AGSUtilityNetwork Class Reference
ArcGIS Runtime SDK for iOS  100.15
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:
 
(void) - doCancelLoading
 
(void) - doStartLoading:
 
(id< AGSCancelable >) - featuresForElements:completion:
 
(instancetype) - initWithURL:
 
(instancetype) - initWithURL:map:
 
(void) - loadDidFinishWithError:
 
(void) - loadWithCompletion:
 
(void) - onLoadStatusChanged
 
(id< AGSCancelable >) - queryNamedTraceConfigurationsWithQueryParameters:completion:
 
(void) - retryLoadWithCompletion:
 
(id< AGSCancelable >) - traceWithParameters:completion:
 

Class Methods

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

Properties

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

Method Documentation

◆ associationsWithElement:completion:

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

Finds all AGSUtilityAssociation objects present in the geodatabase for a given AGSUtilityElement object . 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 

Finds all AGSUtilityAssociation objects of type AGSUtilityAssociationType present in the geodatabase for a 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.
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 

Finds all AGSUtilityAssociation objects (with their geometry) present in the geodatabase for a given AGSEnvelope object. 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 

Finds all AGSUtilityAssociation objects (with their geometry) of type AGSUtilityAssociationType present in the geodatabase for a given AGSEnvelope object. 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 object from an AGSUtilityAssetType object and a GlobalID. If the AGSUtilityAssetType object supports an AGSUtilityTerminalConfiguration, a default AGSUtilityTerminal will be assigned.

Parameters
assetTypeThe AGSUtilityAssetType object 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 object from an AGSUtilityAssetType, a GlobalID, and an optional AGSUtilityTerminal object. If the optional AGSUtilityTerminal object is not supplied, and the AGSUtilityAssetType object supports an AGSUtilityTerminalConfiguration, a default AGSUtilityTerminal will be assigned.

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

◆ createElementWithFeature:

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

Creates an AGSUtilityElement object 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 object 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 object from which the feature element is created.
terminalThe AGSUtilityTerminal object.
Returns
A new AGSUtilityElement object
Since
100.6

◆ doCancelLoading

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

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ doStartLoading:

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

Parameters
retryingflag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p).
Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ 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 object 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. This AGSUtilityNetwork will be added to AGSMap::utilityNetworks.

Parameters
URLThe URL to the feature service.
mapA map that provides feature tables to be reused by the utility network.
Since
100.6

◆ loadDidFinishWithError:

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

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ 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

◆ onLoadStatusChanged

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

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ queryNamedTraceConfigurationsWithQueryParameters:completion:

- (id<AGSCancelable>) queryNamedTraceConfigurationsWithQueryParameters: (nullable AGSUtilityNamedTraceConfigurationQueryParameters *)  queryParameters
completion: (void(^)(NSArray< AGSUtilityNamedTraceConfiguration * > *_Nullable result, NSError *_Nullable error))  completion 

Queries for an array of AGSUtilityNamedTraceConfiguration objects from the utility network.

Parameters
queryParametersOptional query parameter to filter the results.
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.
See also
AGSUtilityNamedTraceConfigurationQueryParameters
Since
100.11

◆ 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 object using the URL to the feature service.

Parameters
URLThe URL to the feature service.
Returns
A new utility network.
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. This AGSUtilityNetwork will be added to AGSMap::utilityNetworks.

Parameters
URLThe URL to the feature service.
mapA map that provides feature tables to be reused by the utility network.
Returns
A new 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 object.

See also
AGSUtilityNetworkDefinition
Since
100.6

◆ geodatabase

- (AGSGeodatabase*) geodatabase
readnonatomicweak

The AGSGeodatabase object that contains this AGSUtilityNetwork object.

The AGSGeodatabase object that contains this AGSUtilityNetwork object and is also used by the AGSGeodatabaseFeatureTable object in the AGSUtilityNetworkDefinition::networkSources property.

Use this property to manage transactions, sync edits, or access tables participating in this AGSUtilityNetwork object.

This property has a value when the AGSUtilityNetwork object is retrieved from an AGSGeodatabase object; otherwise, when created using any of the constructors, this property is nil.

Note that calling close (AGSGeodatabase) on an AGSGeodatabase object that contains this AGSUtilityNetwork object will render this AGSUtilityNetwork object unusable. Any attempt to create an element, get associations, get features from elements, or perform a trace after this AGSGeodatabase object is closed will fail with AGSErrorCodeGDBDatabaseClosed.

Since
100.11

◆ 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 object. This property is empty when the AGSUtilityNetwork object is not loaded or AGSUtilityNetwork is not retrieved from an AGSGeodatabase object.

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

◆ serviceGeodatabase

- (AGSServiceGeodatabase*) serviceGeodatabase
readnonatomicstrong

The AGSServiceGeodatabase object of this AGSUtilityNetwork object.

The AGSServiceGeodatabase object used by the AGSServiceFeatureTable object in the AGSUtilityNetworkDefinition::networkSources property.

Use this property to switch to a branch version, manage edits, or query related records of tables participating in this AGSUtilityNetwork object.

This property is nil until the AGSUtilityNetwork object is loaded. The AGSMap object that was used to create this AGSUtilityNetwork object provides this AGSServiceGeodatabase object. When no matching AGSServiceGeodatabase object is found in the AGSMap object, this AGSUtilityNetwork object will create and load an AGSServiceGeodatabase object connected to the default version in AGSFeatureServiceSessionTypeTransient mode.

This property is also nil when the AGSUtilityNetwork object is retrieved from an AGSGeodatabase object.

Note that calling closeWithCompletion: (AGSServiceGeodatabase) on an AGSServiceGeodatabase object that is used by an AGSUtilityNetwork object will render this AGSUtilityNetwork object unusable. An attempt to create an element, get associations, get features from elements, or perform a trace after this AGSServiceGeodatabase object is closed will fail with AGSErrorCodeGDBDatabaseClosed.

Since
100.10

◆ URL

- (NSURL*) URL
readrequirednonatomicstronginherited

The URL of the remote resource.

Since
100