ServiceAreaTask Class

  • ServiceAreaTask
  • class Esri::ArcGISRuntime::ServiceAreaTask

    A task to compute areas that can be serviced (reached) from a given location. More...

    Header: #include <ServiceAreaTask.h>
    Since: Esri::ArcGISRuntime 100.1
    Inherits: Esri::ArcGISRuntime::Object, Esri::ArcGISRuntime::ApiKeyResource, Esri::ArcGISRuntime::Loadable, and Esri::ArcGISRuntime::RemoteResource

    Public Functions

    ServiceAreaTask(const QString &databasePath, const QString &networkName, QObject *parent = nullptr)
    ServiceAreaTask(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    ServiceAreaTask(const QUrl &url, QObject *parent = nullptr)
    ServiceAreaTask(Esri::ArcGISRuntime::TransportationNetworkDataset *transportationNetworkDataset, QObject *parent = nullptr)
    virtual ~ServiceAreaTask() override
    QFuture<Esri::ArcGISRuntime::ServiceAreaParameters> createDefaultParametersAsync()
    Esri::ArcGISRuntime::ServiceAreaTaskInfo serviceAreaTaskInfo() const
    QFuture<Esri::ArcGISRuntime::ServiceAreaResult> solveServiceAreaAsync(const Esri::ArcGISRuntime::ServiceAreaParameters &serviceAreaParameters)
    Esri::ArcGISRuntime::TransportationNetworkDataset *transportationNetworkDataset() const

    Reimplemented Public Functions

    virtual QString apiKey() const override
    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 setApiKey(const QString &apiKey) override
    virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
    virtual QUrl url() const override

    Signals

    void doneLoading(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

    A ServiceAreaTask calculates areas that can be serviced (reached) from a given location. A network service area is a region that encompasses all street locations that can be accessed within a given distance or travel time from one or more facilities. For instance, the 10-minute service area for a facility includes all the street locations that can be reached within 10 minutes from that facility.

    The service area task works in an online connected scenario by using a transportation network that is published to ArcGIS Server as an online Network Analyst service area service. Esri also provides ready-to-use services, such as the Directions and Routing Services, which require authentication with an ArcGIS organizational account. In connected scenarios, provide a URL to the REST endpoint of the service, along with any necessary credentials.

    See also Loadable and Service Area REST API documentation.

    Member Function Documentation

    [since Esri::ArcGISRuntime 100.2] ServiceAreaTask::ServiceAreaTask(const QString &databasePath, const QString &networkName, QObject *parent = nullptr)

    Constructor that takes a databasePath and networkName, with an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.2.

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

    Constructor that takes a url to a secured NA service endpoint and a credential, with an optional parent.

    [explicit] ServiceAreaTask::ServiceAreaTask(const QUrl &url, QObject *parent = nullptr)

    Constructor that takes a url to an NA service endpoint with an optional parent.

    [explicit, since Esri::ArcGISRuntime 100.2] ServiceAreaTask::ServiceAreaTask(Esri::ArcGISRuntime::TransportationNetworkDataset *transportationNetworkDataset, QObject *parent = nullptr)

    Constructor that takes a transportationNetworkDataset with an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    [override virtual] ServiceAreaTask::~ServiceAreaTask()

    Destructor.

    [override virtual, since Esri::ArcGISRuntime 100.10] QString ServiceAreaTask::apiKey() const

    Reimplements: ApiKeyResource::apiKey() const.

    Returns the API key. See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also setApiKey().

    [override virtual] void ServiceAreaTask::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    See Loadable.

    [since Esri::ArcGISRuntime 200.2] QFuture<Esri::ArcGISRuntime::ServiceAreaParameters> ServiceAreaTask::createDefaultParametersAsync()

    Creates default service area parameters from the service. Retrieves the default parameters as defined by the service. This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.2.

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

    Reimplements: RemoteResource::credential() const.

    Returns the security credential used to access the service area service.

    Only applicable if using an online service that is secured.

    [signal] void ServiceAreaTask::doneLoading(const Esri::ArcGISRuntime::Error &loadError)

    Signal emitted when this object is done loading.

    • loadError - Details about any error that may have occurred.

    Note: If there is a load error it will also be emitted on the errorOccurred signal.

    See also Loadable and Object.

    [override virtual] void ServiceAreaTask::load()

    Reimplements: Loadable::load().

    See Loadable.

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

    Reimplements: Loadable::loadError() const.

    See Loadable.

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

    Reimplements: Loadable::loadStatus() const.

    See Loadable.

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

    Signal emitted when the load status changes for this object.

    See also Loadable.

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

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration in use by this task.

    See also setRequestConfiguration().

    [override virtual] void ServiceAreaTask::retryLoad()

    Reimplements: Loadable::retryLoad().

    See Loadable.

    Esri::ArcGISRuntime::ServiceAreaTaskInfo ServiceAreaTask::serviceAreaTaskInfo() const

    Returns the ServiceAreaTaskInfo for this ServiceAreaTask.

    Wait until this ServiceAreaTask is finished loading before attempting to obtain the ServiceAreaTaskInfo.

    [override virtual, since Esri::ArcGISRuntime 100.10] void ServiceAreaTask::setApiKey(const QString &apiKey)

    Reimplements: ApiKeyResource::setApiKey(const QString &apiKey).

    Sets the API key to apiKey. See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also apiKey().

    [override virtual] void ServiceAreaTask::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().

    [since Esri::ArcGISRuntime 200.2] QFuture<Esri::ArcGISRuntime::ServiceAreaResult> ServiceAreaTask::solveServiceAreaAsync(const Esri::ArcGISRuntime::ServiceAreaParameters &serviceAreaParameters)

    Solves a service area passing in a parameters object.

    • serviceAreaParameters - The service area parameters.

    Executes the ServiceAreaParameters defined for this ServiceAreaTask and returns a ServiceAreaResult containing the results. This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    [since Esri::ArcGISRuntime 100.2] Esri::ArcGISRuntime::TransportationNetworkDataset *ServiceAreaTask::transportationNetworkDataset() const

    Returns the TransportationNetworkDataset used to construct this ServiceAreaTask.

    This function was introduced in Esri::ArcGISRuntime 100.2.

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

    Reimplements: RemoteResource::url() const.

    Returns the URL to the online service.

    Only applicable to online service area.

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