GeoprocessingTask Class

  • GeoprocessingTask
  • class Esri::ArcGISRuntime::GeoprocessingTask

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

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

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Functions

    GeoprocessingTask(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    GeoprocessingTask(const QUrl &url, QObject *parent = nullptr)
    virtual ~GeoprocessingTask() override
    Esri::ArcGISRuntime::TaskWatcher createDefaultParameters()
    Esri::ArcGISRuntime::GeoprocessingJob *createJob(const Esri::ArcGISRuntime::GeoprocessingParameters &parameters)
    Esri::ArcGISRuntime::GeoprocessingTaskInfo geoprocessingTaskInfo() 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 createDefaultParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::GeoprocessingParameters &parameters)
    void doneLoading(Esri::ArcGISRuntime::Error loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

    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, Esri::ArcGISRuntime::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(const QUrl &url, QObject *parent = nullptr)

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

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

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

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

    [override virtual] GeoprocessingTask::~GeoprocessingTask()

    Destructor.

    [override virtual] void GeoprocessingTask::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    See Loadable.

    This function was introduced in Esri::ArcGISRuntime 100.1.

    Esri::ArcGISRuntime::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.

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

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

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

    Reimplements: RemoteResource::credential() const.

    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.

    Esri::ArcGISRuntime::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.

    [override virtual] void GeoprocessingTask::load()

    Reimplements: Loadable::load().

    See Loadable.

    This function was introduced in Esri::ArcGISRuntime 100.1.

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

    Reimplements: Loadable::loadError() const.

    See Loadable.

    This function was introduced in Esri::ArcGISRuntime 100.1.

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

    Reimplements: Loadable::loadStatus() const.

    See Loadable.

    This function was introduced in Esri::ArcGISRuntime 100.1.

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

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration in use by this task.

    This function was introduced in Esri::ArcGISRuntime 100.1.

    See also setRequestConfiguration().

    [override virtual] void GeoprocessingTask::retryLoad()

    Reimplements: Loadable::retryLoad().

    See Loadable.

    This function was introduced in Esri::ArcGISRuntime 100.1.

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

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

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

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

    Reimplements: RemoteResource::url() const.

    Returns the URL of this GeoprocessingTask.

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