This task performs structured queries on a layer of ArcGIS Server Map Service, Image Service, or Feature Service. For Map and Feature services, the query can also be performed on a table. Queries can be based on SQL expressions, spatial relationships, or time extents.
A query task needs a URL to a REST resource that represents a layer in a Map, Image, or Feature service. For example, http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5
Public Member Functions | |
(NSOperation *) | - executeFeatureCountWithQuery: |
(NSOperation *) | - executeForIdsWithQuery: |
(NSOperation *) | - executeWithQuery: |
(NSOperation *) | - executeWithRelationshipQuery: |
(id) | - initWithURL: |
(id) | - initWithURL:credential: |
Static Public Member Functions | |
(id) | + queryTaskWithURL: |
(id) | + queryTaskWithURL:credential: |
Properties | |
AGSCredential * | credential |
id< AGSQueryTaskDelegate > | delegate |
NSURL * | URL |
- (NSOperation *) executeFeatureCountWithQuery: | (AGSQuery *) | query |
Executes a query against the layer resource pointed by the url
. It relies on the Query operation of the REST resource.
The query returns only a feature count of records matching the specified criteria.
The delegate will be notified when the operation completes or if an error is encountered.
query | Specifies the criteria for the query. |
NSOperation
for current execute request. - (NSOperation *) executeForIdsWithQuery: | (AGSQuery *) | query |
Executes a query against the layer resource pointed by the url
. It relies on the Query operation of the REST resource.
The query returns only IDs of records matching the specified criteria. This is useful if you want to implement paging for results or if you want to only fetch result details on demand. Unlike executeWithQuery:
, there is no limit on the number of results returned by this query.
The delegate will be notified when the operation completes or if an error is encountered.
query | Specifies the criteria for the query. |
NSOperation
for current execute request. - (NSOperation *) executeWithQuery: | (AGSQuery *) | query |
Executes a query against the layer resource pointed by the url
. It relies on the Query operation of the REST resource.
The query returns records matching the specified criteria. The records could be features, if the service layer represents a layer. Or the records could be simple records (without geometry) if the service layer represents a table. The delegate will be notified when the operation completes or if an error is encountered.
The number of results returned by the query is limited by the service's configuration.
query | Specifies the criteria for the query. |
NSOperation
for current execute request. - (NSOperation *) executeWithRelationshipQuery: | (AGSRelationshipQuery *) | query |
Executes a query against the layer resource pointed by the url
. It relies on the Query Related Records operation of the REST resource.
The query returns records that are related to the given set of features. The related records could be features, if the service layer is related to a layer. Or the related records could be simple records (wihtout geometry) if the service layer is related to a table.
The delegate will be notified when the operation completes or if an error is encountered.
query | Specifies the criteria for the query. |
NSOperation
for current execute request. - (id) initWithURL: | (NSURL *) | url |
Initialize the task.
url | URL to a task resource in the ArcGIS Server REST Services Directory. |
- (id) initWithURL: | (NSURL *) | url | ||
credential: | (AGSCredential *) | cred | ||
Initialize the task with a URL and credential to a secured resource.
url | URL to a task resource in the ArcGIS Server REST Services Directory. | |
cred | AGSCredential used to access secure resource. |
+ (id) queryTaskWithURL: | (NSURL *) | url |
Initialize an autoreleased query task.
url | URL to a layer resource in the ArcGIS Server REST Services Directory. |
+ (id) queryTaskWithURL: | (NSURL *) | url | ||
credential: | (AGSCredential *) | cred | ||
Initialize autoreleased query task.
url | URL to a layer resource in the ArcGIS Server REST Services Directory. | |
cred | AGSCredential used to access the secured service. |
- (AGSCredential*) credential [read, write, copy, inherited] |
The credential to be used to access secured resources.
Reimplemented from <AGSSecuredResource>.
- (id<AGSQueryTaskDelegate>) delegate [read, write, assign] |
Delegate to be notified when the task completes successfully or returns an error.
- (NSURL*) URL [read, copy, inherited] |
URL to a task resource in the ArcGIS Server REST Services Directory.