Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer

Create a Geoprocessing Service Job

Source:R/geoprocessing-class.R
gp_job.Rd

Thearc_gp_job class is used to interact with Geoprocessing Services inArcGIS Online and Enterprise.

Usage

new_gp_job(base_url, params=list(), token=arc_token())

Arguments

base_url

the URL of the job service (without/submitJob)

params

a named list where each element is a scalar character

token

defaultarc_token(). The token to be used with the job.

Value

An object of classarc_gp_job.

Details

Thearc_gp_job uses S7 classes for the job request parameters and job statusviaarc_form_params() andarc_job_status() respectively. Importantly,arc_form_params() ensures that parameters provided to a geoprocessingservice are all character scalars as required by the form body.

See also

Other geoprocessing:arc_form_params(),arc_job_status(),gp_params

Public fields

base_url

the URL of the job service (without/submitJob)

id

the ID of the started job.NULLself$start() has not been called.

Active bindings

params

returns an S7 object of classarc_form_params (seearc_form_params()) the list can be accessed viaself$params@params.

status

returns the status of the geoprocessing job as an S7 object of classgp_job_status (seearc_job_status()) by querying the/jobs/{job-id} endpoint.

results

returns the current results of the job by querying the/jobs/{job-id}/results endpoint.

Methods


Methodnew()

Usage

arc_gp_job$new(base_url,  params=list(),  result_fn=NULL,  token=arc_token(),  error_call=rlang::caller_call())

Arguments

base_url

the URL of the job service (without/submitJob)

params

a named list where each element is a scalar character

result_fn

DefaultNULL. An optional function to apply to the results JSON. By default parses results usingRcppSimdJson::fparse().

token

defaultarc_token(). The token to be used with the job.

error_call

defaultrlang::caller_call() the calling environment.


Methodstart()

Starts the job by calling the/submitJob endpoint. This also sets the public fieldid.

Usage

arc_gp_job$start()


Methodcancel()

Cancels a job by calling the/cancel endpoint.

Usage

arc_gp_job$cancel()


Methodawait()

Waits for job completion and returns results.

Usage

arc_gp_job$await(interval=0.1, verbose=FALSE)

Arguments

interval

polling interval in seconds (default 0.1)

verbose

whether to print status messages (default FALSE)


Methodclone()

The objects of this class are cloneable with this method.

Usage

arc_gp_job$clone(deep=FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

url<-paste0("https://logistics.arcgis.com/arcgis/","rest/services/World/ServiceAreas/","GPServer/GenerateServiceAreas")job<-new_gp_job(url,list(f="json"))job#> <arc_gp_job>#> Job ID: not initiated#> Status: not started#> Resource: /GenerateServiceAreas#> Params:#> • f# extract params S7 classparams<-job$paramsparams#> <arcgisutils::arc_form_params>#>  @ params:List of 1#>  .. $ f: chr "json"# view underlying listparams@params#> $f#> [1] "json"#>

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


[8]ページ先頭

©2009-2025 Movatter.jp