UtilityNetwork Class

  • UtilityNetwork
  • class Esri::ArcGISRuntime::UtilityNetwork

    A utility network. More...

    Header: #include <UtilityNetwork.h>
    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
    Esri::ArcGISRuntime::Geodatabase *geodatabase() const
    QString name() const
    Esri::ArcGISRuntime::TaskWatcher queryNamedTraceConfigurations(Esri::ArcGISRuntime::UtilityNamedTraceConfigurationQueryParameters *queryParameters)
    Esri::ArcGISRuntime::ServiceGeodatabase *serviceGeodatabase() 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 queryNamedTraceConfigurationsCompleted(QUuid taskId, const QList<Esri::ArcGISRuntime::UtilityNamedTraceConfiguration *> &utilityNamedTraceConfigurationResults)
    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 their parent.

    This function was introduced in Esri::ArcGISRuntime 100.7.

    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::queryNamedTraceConfigurationsCompleted(QUuid taskId, const QList<Esri::ArcGISRuntime::UtilityNamedTraceConfiguration *> &utilityNamedTraceConfigurationResults)

    Signal emitted after a queryNamedTraceConfigurations asynchronous task completes.

    The returned UtilityNamedTraceConfiguration objects have the UtilityNetwork as their parent.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also Returned QObjects Parenting.

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

    Esri::ArcGISRuntime::Geodatabase *UtilityNetwork::geodatabase() const

    Returns the Geodatabase that contains this UtilityNetwork.

    The Geodatabase that contains this UtilityNetwork and is also used by the GeodatabaseFeatureTable in UtilityNetworkDefinition::networkSources.

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

    This property has a value when the UtilityNetwork is retrieved from a Geodatabase; otherwise, when created using any of the constructors, this property is nullptr.

    Note that calling Geodatabase::close on a Geodatabase that contains this UtilityNetwork will render this UtilityNetwork unusable. An attempt to create an element, get associations, get features from elements, or perform a trace after this Geodatabase is closed will fail with ErrorType::GeodatabaseDatabaseClosed.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    [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 property is empty when UtilityNetwork is not loaded or UtilityNetwork is not retrieved from a Geodatabase.

    This function was introduced in Esri::ArcGISRuntime 100.8.

    Esri::ArcGISRuntime::TaskWatcher UtilityNetwork::queryNamedTraceConfigurations(Esri::ArcGISRuntime::UtilityNamedTraceConfigurationQueryParameters *queryParameters)

    Returns a list of UtilityNamedTraceConfiguration from the utility network.

    • queryParameters - Optional query parameter to filter the results.

    Returns a TaskWatcher for the asynchronous operation.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also UtilityNamedTraceConfigurationQueryParameters.

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

    Esri::ArcGISRuntime::ServiceGeodatabase *UtilityNetwork::serviceGeodatabase() const

    Returns the ServiceGeodatabase of the UtilityNetwork The ServiceGeodatabase used by the ServiceFeatureTable in UtilityNetworkDefinition::networkSources.

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

    This property is nullptr until the UtilityNetwork is loaded. The Map that was used to create this UtilityNetwork provides this ServiceGeodatabase. When no matching ServiceGeodatabase is found in the Map, this UtilityNetwork will create and load a ServiceGeodatabase connected to the default version in FeatureServiceSessionType::Transient mode.

    Note that calling ServiceGeodatabase::close on a ServiceGeodatabase that is used by a UtilityNetwork will render this UtilityNetwork unusable. An attempt to create an element, get associations, get features from elements, or perform a trace after this ServiceGeodatabase is closed will fail with Error::code 3078, indicating GeodatabaseDatabaseClosed.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    [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 Watcher that runs a trace and returns a list of UtilityTraceResult

    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 of the UtilityNetwork.

    This property is empty when UtilityNetwork is retrieved from a Geodatabase.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.