Skip To Content ArcGIS for Developers Sign In Dashboard

GeoprocessingTask Class

(Esri::ArcGISRuntime::GeoprocessingTask)

GeoprocessingTask is used to run a geoprocessing task that is published as a web service. More...

Header: #include <GeoprocessingTask>
Since: Esri::ArcGISRuntime 100.0
Inherits: Object, Loadable, and RemoteResource

Public Functions

GeoprocessingTask(const QUrl &url, QObject *parent = nullptr)
GeoprocessingTask(const QUrl &url, Credential *credential, QObject *parent = nullptr)
~GeoprocessingTask()
TaskWatcher createDefaultParameters()
GeoprocessingJob *createJob(const GeoprocessingParameters &parameters)
GeoprocessingTaskInfo geoprocessingTaskInfo() 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

Signals

void createDefaultParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::GeoprocessingParameters &parameters)
void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

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

GeoprocessingTask is used to run a geoprocessing task that is published as a web service.

GeoprocessingTask is the main component when running geoprocessing tasks. The task can be published through ArcGIS Server, or through Local Server on the platforms that support it, using either synchronous execute or asynchronous submit execution type. When GeoprocessingParameters is created to pass into createJob, it is important to match its executionType to the value on the service.

  1. Create a GeoprocessingTask using the full URL to the target geoprocessing task endpoint.
  2. Create a GeoprocessingParameters providing corresponding GeoprocessingExecutionType.
  3. Create the necessary GeoprocessingParameters and add them to GeoprocessingParameters::inputs, where key is the name of the parameter and value is created parameter.
  4. Set environmental variables on GeoprocessingParameters if needed, such as GeoprocessingParameters::isReturnZ or GeoprocessingParameters::outputSpatialReference.
  5. Create a GeoprocessingJob with createJob.
  6. Start listening for status and message changes using the GeoprocessingJob::jobStatusChanged signal.
  7. Run targeted geoprocessing tool using GeoprocessingJob::start which sets GeoprocessingResult when finished.
  8. Handle returned values accordingly. Access output parameters through GeoprocessingResult::outputs QMap where key is the name of the output parameter and the value is returned parameter. If used geoprocessing service is configured to use result map service, GeoprocessingResult::mapImageLayer might be created for you.

See also Loadable.

Member Function Documentation

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

Constructor that accepts a URL (url) and an optional parent.

GeoprocessingTask::GeoprocessingTask(const QUrl &url, Credential *credential, QObject *parent = nullptr)

Constructor that accepts a URL (url), credential and an optional parent.

  • url - The URL of the Geoprocessing service.
  • credential - The credential.
  • parent - The parent object for this GeoprocessingTask (optional).

This function was introduced in Esri::ArcGISRuntime 100.1.

GeoprocessingTask::~GeoprocessingTask()

Destructor.

[virtual] void GeoprocessingTask::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

This function was introduced in Esri::ArcGISRuntime 100.1.

TaskWatcher GeoprocessingTask::createDefaultParameters()

Creates default geoprocessing parameters from the service.

The createDefaultParametersCompleted signal will emit once the operation is complete, giving access to the resulting GeoprocessingParameters.

This function was introduced in Esri::ArcGISRuntime 100.1.

[signal] void GeoprocessingTask::createDefaultParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::GeoprocessingParameters &parameters)

Signal emitted after the createDefaultParameters asynchronous method completes.

  • taskId - The task ID of the asynchronous task.
  • parameters - The generated default parameters for the GeoprocessingTask.

This function was introduced in Esri::ArcGISRuntime 100.1.

GeoprocessingJob *GeoprocessingTask::createJob(const GeoprocessingParameters &parameters)

Creates and returns a GeoprocessingJob populated with a set of task parameters.

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

Reimplemented from RemoteResource::credential().

Returns the security credential used to access this GeoprocessingTask.

Only applicable if the service is secured.

This function was introduced in Esri::ArcGISRuntime 100.1.

[signal] void GeoprocessingTask::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.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also Loadable and Object.

GeoprocessingTaskInfo GeoprocessingTask::geoprocessingTaskInfo() const

Returns GeoprocessingTaskInfo about the GeoprocessingTask.

Wait until the GeoprocessingTask is doneLoading before attempting to obtain the GeoprocessingTaskInfo.

This function was introduced in Esri::ArcGISRuntime 100.1.

[virtual] void GeoprocessingTask::load()

Reimplemented from Loadable::load().

See Loadable.

This function was introduced in Esri::ArcGISRuntime 100.1.

[virtual] Error GeoprocessingTask::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

This function was introduced in Esri::ArcGISRuntime 100.1.

[virtual] LoadStatus GeoprocessingTask::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

This function was introduced in Esri::ArcGISRuntime 100.1.

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

Signal emitted when the load status changes for this object.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also Loadable.

[virtual] RequestConfiguration GeoprocessingTask::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this task.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setRequestConfiguration().

[virtual] void GeoprocessingTask::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

This function was introduced in Esri::ArcGISRuntime 100.1.

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

Reimplemented from RemoteResource::setRequestConfiguration().

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

This function was introduced in Esri::ArcGISRuntime 100.1.

See also requestConfiguration().

[virtual] QUrl GeoprocessingTask::url() const

Reimplemented from RemoteResource::url().

Returns the URL of this GeoprocessingTask.


Feedback on this topic?