| arc_gp_job | R Documentation |
The arc_gp_job class is used to interact with Geoprocessing Services in
ArcGIS Online and Enterprise.
new_gp_job(base_url, params = list(), token = arc_token())
base_url |
the URL of the job service (without |
params |
a named list where each element is a scalar character |
token |
default |
The arc_gp_job uses S7 classes for the job request parameters and job status
via arc_form_params() and arc_job_status() respectively. Importantly,
arc_form_params() ensures that parameters provided to a geoprocessing
service are all character scalars as required by the form body.
An object of class arc_gp_job.
from_url(url, token = arc_token())Create a GP Job object from an existing job URL
base_urlthe URL of the job service (without /submitJob)
idthe ID of the started job. NULL self$start() has not been called.
paramsreturns an S7 object of class arc_form_params (see arc_form_params()) the list can be accessed via self$params@params.
statusreturns the status of the geoprocessing job as an S7 object of class gp_job_status (see arc_job_status()) by querying the /jobs/{job-id} endpoint.
resultsreturns the current results of the job by querying the /jobs/{job-id}/results endpoint.
new()arc_gp_job$new( base_url, params = list(), result_fn = NULL, token = arc_token(), error_call = rlang::caller_call() )
base_urlthe URL of the job service (without /submitJob)
paramsa named list where each element is a scalar character
result_fnDefault NULL. An optional function to apply to the results JSON. By default parses results using RcppSimdJson::fparse().
tokendefault arc_token(). The token to be used with the job.
error_calldefault rlang::caller_call() the calling environment.
start()Starts the job by calling the /submitJob endpoint. This also sets the public field id.
arc_gp_job$start()
cancel()Cancels a job by calling the /cancel endpoint.
arc_gp_job$cancel()
await()Waits for job completion and returns results.
arc_gp_job$await(interval = 0.1, verbose = FALSE)
intervalpolling interval in seconds (default 0.1)
verbosewhether to print status messages (default FALSE)
clone()The objects of this class are cloneable with this method.
arc_gp_job$clone(deep = FALSE)
deepWhether to make a deep clone.
Other geoprocessing:
arc_form_params(),
arc_job_status(),
gp_job_from_url(),
gp_params
url <- paste0(
"https://logistics.arcgis.com/arcgis/",
"rest/services/World/ServiceAreas/",
"GPServer/GenerateServiceAreas"
)
job <- new_gp_job(url, list(f = "json"))
job
# extract params S7 class
params <- job$params
params
# view underlying list
params@params
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.