Skip To Content ArcGIS for Developers Sign In Dashboard

UtilityNetwork Class

class Esri::ArcGISRuntime::UtilityNetwork

A utility network. More...

Header: #include <UtilityNetwork>
Since: Esri::ArcGISRuntime 100.6
Inherits: Esri::ArcGISRuntime::Object, Esri::ArcGISRuntime::Loadable, and Esri::ArcGISRuntime::RemoteResource

This class was introduced in Esri::ArcGISRuntime 100.6.

Public Functions

UtilityNetwork(const QUrl &url, Esri::ArcGISRuntime::Map *map, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
UtilityNetwork(const QUrl &url, Esri::ArcGISRuntime::Map *map, QObject *parent = nullptr)
UtilityNetwork(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
UtilityNetwork(const QUrl &url, QObject *parent = nullptr)
virtual ~UtilityNetwork() override
Esri::ArcGISRuntime::TaskWatcher associations(Esri::ArcGISRuntime::UtilityElement *element)
Esri::ArcGISRuntime::TaskWatcher associations(Esri::ArcGISRuntime::UtilityElement *element, Esri::ArcGISRuntime::UtilityAssociationType type)
Esri::ArcGISRuntime::TaskWatcher associations(const Esri::ArcGISRuntime::Envelope &extent)
Esri::ArcGISRuntime::TaskWatcher associations(const Esri::ArcGISRuntime::Envelope &extent, Esri::ArcGISRuntime::UtilityAssociationType type)
Esri::ArcGISRuntime::UtilityElement *createElementWithArcGISFeature(Esri::ArcGISRuntime::ArcGISFeature *arcGISFeature, Esri::ArcGISRuntime::UtilityTerminal *terminal = nullptr, QObject *parent = nullptr)
Esri::ArcGISRuntime::UtilityElement *createElementWithAssetType(Esri::ArcGISRuntime::UtilityAssetType *assetType, const QUuid &globalId, Esri::ArcGISRuntime::UtilityTerminal *terminal = nullptr, QObject *parent = nullptr)
Esri::ArcGISRuntime::UtilityNetworkDefinition *definition() const
Esri::ArcGISRuntime::TaskWatcher featuresForElements(const QList<Esri::ArcGISRuntime::UtilityElement *> &elements)
Esri::ArcGISRuntime::ArcGISFeatureListModel *featuresForElementsResult() const
QString name() const
Esri::ArcGISRuntime::TaskWatcher trace(Esri::ArcGISRuntime::UtilityTraceParameters *traceParameters)
Esri::ArcGISRuntime::UtilityTraceResultListModel *traceResult() const

Reimplemented Public Functions

virtual void cancelLoad() override
virtual Esri::ArcGISRuntime::Credential *credential() const override
virtual void load() override
virtual Esri::ArcGISRuntime::Error loadError() const override
virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
virtual void retryLoad() override
virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
virtual QUrl url() const override

Signals

void associationsCompleted(QUuid taskId, const QList<Esri::ArcGISRuntime::UtilityAssociation *> &associations)
void doneLoading(Esri::ArcGISRuntime::Error loadError)
void featuresForElementsCompleted(QUuid taskId)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
void traceCompleted(QUuid taskId)

Detailed Description

This is the central class for ArcGIS utility network schema information and tracing.

UtilityNetwork follows the Loadable pattern. When it loads, it is populated with the utility network schema. This class provides methods to create UtilityElement objects for the UtilityNetwork.

See also Loadable.

Member Function Documentation

UtilityNetwork::UtilityNetwork(const QUrl &url, Esri::ArcGISRuntime::Map *map, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

Constructor that accepts a URL, a Map, and a Credential.

  • url - The URL of the utility network feature service
  • map - A Map that provides FeatureTables to be reused by the utility network
  • credential - The Credential used to access the service
  • parent - The parent object for this UtilityNetwork (optional)

This constructor is used when creating a UtilityNetwork object from a web map and a credential is needed. It creates a utility network associated with a particular service, using the same ArcGISFeatureTable objects in use by FeatureLayer objects within the map. This lets any UtilityElement or ArcGISFeature objects the UtilityNetwork creates or uses be associated with those existing tables and layers.

UtilityNetwork::UtilityNetwork(const QUrl &url, Esri::ArcGISRuntime::Map *map, QObject *parent = nullptr)

Constructor that accepts a URL of the utility network feature service and a Map.

  • url - The URL of the utility network feature service
  • map - A Map that provides FeatureTables to be reused by the utility network
  • parent - The parent object for this UtilityNetwork (optional)

This constructor is used when creating a UtilityNetwork object from a web map. It creates a utility network associated with a particular service, using the same ArcGISFeatureTable objects in use by FeatureLayer objects within the map. This lets any UtilityElement or ArcGISFeature objects the UtilityNetwork creates or uses be associated with those existing tables and layers.

UtilityNetwork::UtilityNetwork(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

Constructor that accepts a URL of the utility network feature service and a credential.

  • url - The URL of the utility network feature service
  • credential - The Credential used to access the service
  • parent - The parent object for this UtilityNetwork (optional)

UtilityNetwork::UtilityNetwork(const QUrl &url, QObject *parent = nullptr)

Constructor that accepts a URL of the utility network feature service.

  • url - The URL of the utility network feature service.
  • parent - The parent object for this UtilityNetwork (optional)

[signal] void UtilityNetwork::associationsCompleted(QUuid taskId, const QList<Esri::ArcGISRuntime::UtilityAssociation *> &associations)

Signal emitted when an assocations asynchronous task completes.

taskId - The task ID for the asynchronous operation. associations - The returned associations.

The returned UtilityAssociation objects have the UtilityNetwork as its parent.

See also Returned QObjects Parenting.

[signal] void UtilityNetwork::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

loadError - The Error object.

[signal] void UtilityNetwork::featuresForElementsCompleted(QUuid taskId)

Signal emitted after any of the featuresForElements asynchronous tasks completes.

  • taskId - The task ID of the completed asynchronous task

[signal] void UtilityNetwork::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Signal emitted when the load status changes for this object.

See also Loadable.

[signal] void UtilityNetwork::traceCompleted(QUuid taskId)

Signal emitted after a trace asynchronous task completes.

  • taskId - The task ID of the asynchronous task

[override virtual] UtilityNetwork::~UtilityNetwork()

Destructor.

Esri::ArcGISRuntime::TaskWatcher UtilityNetwork::associations(Esri::ArcGISRuntime::UtilityElement *element)

Queries for a list of all UtilityAssociation objects present in the geodatabase for a given element.

Returns a TaskWatcher for the asynchronous operation. Connect to the associationsCompleted signal to know when the task completes.

The result is a list of all associations -- connectivity associations, containment associations, structural attachment associations -- that include the given UtilityElement 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.

This function was introduced in Esri::ArcGISRuntime 100.7.

Esri::ArcGISRuntime::TaskWatcher UtilityNetwork::associations(Esri::ArcGISRuntime::UtilityElement *element, Esri::ArcGISRuntime::UtilityAssociationType type)

Queries for a list of all UtilityAssociation objects of type UtilityAssociationType present in the geodatabase for a given element.

Returns a TaskWatcher for the asynchronous operation. Connect to the associationsCompleted signal to know when the task completes.

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.

This function was introduced in Esri::ArcGISRuntime 100.7.

Esri::ArcGISRuntime::TaskWatcher UtilityNetwork::associations(const Esri::ArcGISRuntime::Envelope &extent)

Queries for a list of all UtilityAssociation objects (with their geometry) present in the geodatabase for a given Envelope.

Returns a TaskWatcher for the asynchronous operation. Connect to the associationsCompleted signal to know when the task completes.

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.

  • extent - The Envelope that defines the area for which associations to return.

This function was introduced in Esri::ArcGISRuntime 100.8.

Esri::ArcGISRuntime::TaskWatcher UtilityNetwork::associations(const Esri::ArcGISRuntime::Envelope &extent, Esri::ArcGISRuntime::UtilityAssociationType type)

Queries for a list of all UtilityAssociation objects (with their geometry) of type UtilityAssociationType present in the geodatabase for a given Envelope.

Returns a TaskWatcher for the asynchronous operation. Connect to the associationsCompleted signal to know when the task completes.

Containment associations are not returned because no geometric relationship is defined between a container and its contents; consider using UtilityNetwork::associations(element, type) 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.

This function was introduced in Esri::ArcGISRuntime 100.8.

[override virtual] void UtilityNetwork::cancelLoad()

Reimplements: Loadable::cancelLoad().

See Loadable.

Esri::ArcGISRuntime::UtilityElement *UtilityNetwork::createElementWithArcGISFeature(Esri::ArcGISRuntime::ArcGISFeature *arcGISFeature, Esri::ArcGISRuntime::UtilityTerminal *terminal = nullptr, QObject *parent = nullptr)

Creates a UtilityElement from an ArcGISFeature and an optional UtilityTerminal.

If a UtilityTerminal is not supplied, and if the feature's UtilityAssetType supports a UtilityTerminalConfiguration, a default UtilityTerminal will be assigned.

Esri::ArcGISRuntime::UtilityElement *UtilityNetwork::createElementWithAssetType(Esri::ArcGISRuntime::UtilityAssetType *assetType, const QUuid &globalId, Esri::ArcGISRuntime::UtilityTerminal *terminal = nullptr, QObject *parent = nullptr)

Creates a UtilityElement from a UtilityAssetType, a global ID of a feature, and an optional UtilityTerminal.

  • assetType - The UtilityAssetType of the feature from which this feature element is created
  • globalId - The GlobalID of the feature from which this feature element is created
  • terminal - The UtilityTerminal (optional).
  • parent - The parent object of the returned UtilityElement (optional).

If a UtilityTerminal is not supplied, and if the feature's UtilityAssetType supports a UtilityTerminalConfiguration, a default UtilityTerminal will be assigned.

[override virtual] Esri::ArcGISRuntime::Credential *UtilityNetwork::credential() const

Reimplements: RemoteResource::credential() const.

Returns the security credential used to access the utility network.

Note: Only applicable if using an online service that is secured.

Esri::ArcGISRuntime::UtilityNetworkDefinition *UtilityNetwork::definition() const

Returns the definition of the utility network.

The definition contains metadata about the associated utility network feature service.

Esri::ArcGISRuntime::TaskWatcher UtilityNetwork::featuresForElements(const QList<Esri::ArcGISRuntime::UtilityElement *> &elements)

Creates a list of LoadStatus::Loaded ArcGISFeature objects where each object in the list corresponds to an item in the list of UtilityElement objects

The returned UtilityElement objects each have the UtilityNetwork object as their parent.

See also Returned QObjects Parenting.

Esri::ArcGISRuntime::ArcGISFeatureListModel *UtilityNetwork::featuresForElementsResult() const

Returns the list model of features that is the result of the featuresForElements task

The result list model will contain loaded ArcGISFeature objects corresponding to the collection of UtilityElement objects used in the task.

[override virtual] void UtilityNetwork::load()

Reimplements: Loadable::load().

See Loadable.

[override virtual] Esri::ArcGISRuntime::Error UtilityNetwork::loadError() const

Reimplements: Loadable::loadError() const.

See Loadable.

[override virtual] Esri::ArcGISRuntime::LoadStatus UtilityNetwork::loadStatus() const

Reimplements: Loadable::loadStatus() const.

See Loadable.

QString UtilityNetwork::name() const

Returns the name of the UtilityNetwork.

This function was introduced in Esri::ArcGISRuntime 100.8.

[override virtual] Esri::ArcGISRuntime::RequestConfiguration UtilityNetwork::requestConfiguration() const

Reimplements: RemoteResource::requestConfiguration() const.

Returns the RequestConfiguration in use by this task.

See also setRequestConfiguration().

[override virtual] void UtilityNetwork::retryLoad()

Reimplements: Loadable::retryLoad().

See Loadable.

[override virtual] void UtilityNetwork::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration)

Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

Sets the configuration parameters used for network requests sent by this task to requestConfiguration.

See also requestConfiguration().

Esri::ArcGISRuntime::TaskWatcher UtilityNetwork::trace(Esri::ArcGISRuntime::UtilityTraceParameters *traceParameters)

Begins a trace using the supplied trace parameters.

Returns a task that runs a trace and returns a list of UtilityTraceResult objects when the trace finishes.

Esri::ArcGISRuntime::UtilityTraceResultListModel *UtilityNetwork::traceResult() const

Returns the list model of UtilityTraceResult.

See also trace.

[override virtual] QUrl UtilityNetwork::url() const

Reimplements: RemoteResource::url() const.

Returns the URL to the feature service utility network that was specified in the constructor.


Feedback on this topic?