Skip To Content ArcGIS for Developers Sign In Dashboard

ServiceAreaTask Class


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

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

Public Functions

ServiceAreaTask(const QString &databasePath, const QString &networkName, QObject *parent = nullptr)
ServiceAreaTask(const QUrl &url, Credential *credential, QObject *parent = nullptr)
ServiceAreaTask(const QUrl &url, QObject *parent = nullptr)
ServiceAreaTask(TransportationNetworkDataset *transportationNetworkDataset, QObject *parent = nullptr)
TaskWatcher createDefaultParameters()
ServiceAreaTaskInfo serviceAreaTaskInfo() const
TaskWatcher solveServiceArea(const ServiceAreaParameters &serviceAreaParameters)
TransportationNetworkDataset *transportationNetworkDataset() const

Reimplemented Public Functions

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


void createDefaultParametersCompleted(QUuid taskId, Esri::ArcGISRuntime::ServiceAreaParameters defaultParameters)
void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)
void solveServiceAreaCompleted(QUuid taskId, Esri::ArcGISRuntime::ServiceAreaResult serviceAreaResult)

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

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

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

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, Credential *credential, QObject *parent = nullptr)

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

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

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

ServiceAreaTask::ServiceAreaTask(TransportationNetworkDataset *transportationNetworkDataset, QObject *parent = nullptr)

Constructor that takes a transportationNetworkDataset with an optional parent.

This function was introduced in Esri::ArcGISRuntime 100.2.



[virtual] void ServiceAreaTask::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

TaskWatcher ServiceAreaTask::createDefaultParameters()

Creates default service area parameters from the service.

The createDefaultParametersCompleted signal emits when the operation is complete, giving access to the resulting ServiceAreaParameters.

[signal] void ServiceAreaTask::createDefaultParametersCompleted(QUuid taskId, Esri::ArcGISRuntime::ServiceAreaParameters defaultParameters)

Signal emitted after the createDefaultParameters asynchronous method completes.

  • taskId - The task ID of the asynchronous task.
  • defaultParameters - The generated default ServiceAreaParameters.

[virtual] Credential *ServiceAreaTask::credential() const

Reimplemented from RemoteResource::credential().

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

[virtual] void ServiceAreaTask::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error ServiceAreaTask::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus ServiceAreaTask::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

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

Signal emitted when the load status changes for this object.

See also Loadable.

[virtual] RequestConfiguration ServiceAreaTask::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this task.

See also setRequestConfiguration().

[virtual] void ServiceAreaTask::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

ServiceAreaTaskInfo ServiceAreaTask::serviceAreaTaskInfo() const

Returns the ServiceAreaTaskInfo for this ServiceAreaTask.

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

[virtual] void ServiceAreaTask::setRequestConfiguration(const RequestConfiguration &requestConfiguration)

Reimplemented from RemoteResource::setRequestConfiguration().

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

See also requestConfiguration().

TaskWatcher ServiceAreaTask::solveServiceArea(const ServiceAreaParameters &serviceAreaParameters)

Solves a service area with the given serviceAreaParameters.

The solveServiceAreaCompleted signal emits when the operation is complete, giving access to the ServiceAreaResult.

[signal] void ServiceAreaTask::solveServiceAreaCompleted(QUuid taskId, Esri::ArcGISRuntime::ServiceAreaResult serviceAreaResult)

Signal emitted after the solveServiceArea asynchronous method completes.

  • taskId - The task ID of the asynchronous task.
  • serviceAreaResult - The generated ServiceAreaResult.

TransportationNetworkDataset *ServiceAreaTask::transportationNetworkDataset() const

Returns the TransportationNetworkDataset used to construct this ServiceAreaTask.

This function was introduced in Esri::ArcGISRuntime 100.2.

[virtual] QUrl ServiceAreaTask::url() const

Reimplemented from RemoteResource::url().

Returns the URL to the online service.

Only applicable to online service area.

Feedback on this topic?