AGSGeoprocessor Class Reference


Description

Instances of this class represent a geoprocessor. Geoprocessor is used to invoke geoprocessing tasks of an ArcGIS Server Geoprocessing Service. Geoprocessing allows you to automate your GIS tasks such as spatial analysis or data management. A Geoprocessing task takes information from the user and existing datasets, applies analytic functions and spatial operators, and derives a new result.

A geoprocessor needs a URL to a REST resource that represents a task in a Geoprocessing service. For example,http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/ProfileService

See also:
What is geoprocessing?
Geoprocessing with ArcGIS Server
Conceptual Doc: Using a Geoprocessor
Sample: Synchronous GP
Sample: Asynchronous GP
Since:
1.0
Inheritance diagram for AGSGeoprocessor:
AGSTask <AGSSecuredResource>

List of all members.

Public Member Functions

(NSOperation *) - checkStatusForJob:
(NSOperation *) - executeWithParameters:
(id) - initWithURL:
(id) - initWithURL:credential:
(NSOperation *) - queryResultData:paramName:
(NSOperation *) - queryResultImage:paramName:imageParams:
(NSOperation *) - queryResultImageLayer:paramName:
(NSOperation *) - submitJobWithParameters:

Static Public Member Functions

(id) + geoprocessorWithURL:
(id) + geoprocessorWithURL:credential:

Properties

AGSCredentialcredential
id< AGSGeoprocessorDelegatedelegate
NSTimeInterval interval
AGSSpatialReferenceoutputSpatialReference
AGSSpatialReferenceprocessSpatialReference
NSURL * URL

Member Function Documentation

- (NSOperation *) checkStatusForJob: (NSString *)  jobId  

This method fires a request for the status of the job designated by jobId. This should only be used if you have previously set the interval to 0 in order to stop constant status updates. The delegate is notified when the status has been successfully retrieved or if an error is encountered.

Parameters:
jobId The id of the job whose status is being requested.
Returns:
NSOperation for the current request.
Since:
1.0
- (NSOperation *) executeWithParameters: (NSArray *)  params  

Executes a geoprocessing task in synchronous mode. The results of the task are returned when the operation finishes. The delegate will be notified when the task completes or encounters an error.

It relies on the Execute Task operation of the REST resource.

Parameters:
params Array of AGSGPParameterValue objects for invoking the task. These input parameters are listed in the parameters section of the geoprocessing task resource in ArcGIS Server REST Services Directory. Their Direction property is set to esriGPParameterDirectionInput.
Returns:
NSOperation for current request.
Since:
1.0
+ (id) geoprocessorWithURL: (NSURL *)  url  

Initialize an autoreleased geoprocessor.

Parameters:
url URL to a geoprocessing service's task.
Returns:
A new, autoreleased, geoprocessor object
Since:
1.0
+ (id) geoprocessorWithURL: (NSURL *)  url
credential: (AGSCredential *)  cred 

Initialize an autoreleased geoprocessor.

Parameters:
url URL to a geoprocessing service's task.
cred AGSCredential used to access the secure resource.
Returns:
A new, autoreleased, geoprocessor object.
Since:
1.0
- (id) initWithURL: (NSURL *)  url  

Initialize the task.

Parameters:
url URL to a task resource in the ArcGIS Server REST Services Directory.
Returns:
A new task object.
Since:
1.0
- (id) initWithURL: (NSURL *)  url
credential: (AGSCredential *)  cred 

Initialize the task with a URL and credential to a secured resource.

Parameters:
url URL to a task resource in the ArcGIS Server REST Services Directory.
cred AGSCredential used to access secure resource.
Returns:
A new task object.
Since:
1.0
- (NSOperation*) queryResultData: (NSString *)  jobId
paramName: (NSString *)  paramName 

Fetch the results of the geoprocessing task. Only relevant for tasks which are executed in asynchronous mode. The delegate is notified when the results are retrieved or encounters an error.

Parameters:
jobId The jobId returned when the geoprocessing task is executed in asynchronous mode.
paramName Name of the output parameter whose value is to be fetched. Output parameters are listed in the parameters section of the geoprocessing task resource in Services Directory. Their Direction property is set to esriGPParameterDirectionOutput.
Returns:
NSOperation for current request.
Since:
1.0
- (NSOperation*) queryResultImage: (NSString *)  jobId
paramName: (NSString *)  paramName
imageParams: (AGSImageParameters *)  imageParams 

Fetch the resulting image of the geoprocessing task when it is associated with a result map service. Only relevant for tasks which are executed in asynchronous mode. The delegate is notified when the result is retrieved or encounters an error.

Parameters:
jobId The jobId returned when the geoprocessing task is executed in asynchronous mode.
paramName Name of the output parameter whose value is to be fetched. Output paramters are listed in the parameters section of the geoprocessing task resource in Services Directory. Their Direction property is set to esriGPParameterDirectionOutput.
imageParams Specifies the properties of the result image.
Returns:
NSOperation for current request.
Since:
1.0
- (NSOperation*) queryResultImageLayer: (NSString *)  jobId
paramName: (NSString *)  paramName 

Fetch the resulting image layer of the geoprocessing task as an AGSGPResultLayer. Only relavent for tasks which are executed in asynchronous mode and are associated with a result map service. The delegate is notified when the result is retrieved or encounters an error.

Parameters:
jobId The jobId returned when the geoprocessing task is executed in asynchronous mode.
paramName Name of the output parameter whose value is to be fetched. Output parameters are listed in the parameters section of the geoprocessing task resource in the Services Directory. Their Direction property is set to esriGPParameterDirectionOutput.
Returns:
NSOperation for current request.
Since:
1.0
- (NSOperation *) submitJobWithParameters: (NSArray *)  params  

Executes a geoprocessing task in asynchronous mode - the operation finishes immediately, even though the task may continue to run on the server. This is commonly referred to as submitting a job. The Geoprocessor regularly polls the server to determine if the job completed. The polling rate is specified by interval. The delegate is notified when the job is submitted, the job completes, or when the job's status is polled.

Parameters:
params Array of AGSGPParameterValue objects for invoking the task. These input parameters are listed in the parameters section of the geoprocessing task resource in Services Directory. Their Direction property is set to esriGPParameterDirectionInput.

It relies on the Submit Job operation of the REST resource.

Returns:
NSOperation for the current submit request.
Since:
1.0

Property Documentation

- (AGSCredential*) credential [read, write, copy, inherited]

The credential to be used to access secured resources.

Since:
1.0

Reimplemented from <AGSSecuredResource>.

- (id<AGSGeoprocessorDelegate>) delegate [read, write, assign]

Delegate to be notified when task completes successfully or encounters an error.

Since:
1.0
- (NSTimeInterval) interval [read, write, assign]

Interval at which to check the status of a geoprocessing task being executed. Only applies to tasks which are executed in asynchronous mode.

Default is 5 seconds, but you should adjust this value in order to minimize the number of times the status is checked. The value you choose will largely depend upon how long your geoprocessing task takes to complete.

If you set the interval to 0, status updates will be suspended. Likewise, if you set the value to non-zero, updates will resume with the new interval.

Since:
1.0
- (AGSSpatialReference*) outputSpatialReference [read, write, retain]

The spatial reference of the result geometries. If not specified, the result geometries are in the same spatial reference as the input geometries. If processSpatialReference is specified and outputSpatialReference is not specified, the result geometries will be returned in processSpatialReference.

Since:
1.0
- (AGSSpatialReference*) processSpatialReference [read, write, retain]

The intermediate spatial reference that the geoprocessing task will use to perform geometric operations. If processSpatialReference is specified and outputSpatialReference is not specified, the result geometries will be returned in processSpatialReference.

Since:
1.0
- (NSURL*) URL [read, copy, inherited]

URL to a task resource in the ArcGIS Server REST Services Directory.

Since:
1.0