Select to view content in your preferred language

IdentifyTask vs. QueryTask

528
7
06-08-2011 07:11 PM
RoyceSimpson
Frequent Contributor
I've got an app where I'm currently using the IdentifyTask to allow the user to click the map and get info about features.  They would like to add functionality to add on a buffer radius to the features that were the target of the Identify and get all features either completely within or completely within/intersecting the buffer boundary. 

I started going down the path of taking the features that were within the Identify tolerance, buffering those, then running a queryTask back on that layer with the resulting buffer.  However, the app in it's current state relies heavily on the "displayField" defined in the MXD being returned in the identifyResult and displayed to the user.  QueryTasks do not return DisplayField values in the results. So that's a Fail.

Then I moved over to trying out the IdentifyTask against the buffer polygon geometry but that doesn't support doing spatial relationship options, such as "completely within".

Do I need to tell my client that they can't have their cake and eat it too or will one of these two options (IdentifyTask or QueryTask) tackle both the bolded requirements above?


For the Flex API Devs... Would it be possible to add the DisplayField value to returned features of a QueryTask in future release of the API?
Tags (2)
0 Kudos
7 Replies
RoyceSimpson
Frequent Contributor
For that matter, is there any way to get at the "DisplayField" as defined in the service mxd other than doing an IdentifyTask -> IdentifyResult?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Royce,

   Sure you can get the DisplayField from the LayerDetails for any layer.

http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/supportClasses/LayerDetails.html
0 Kudos
RoyceSimpson
Frequent Contributor
Royce,

   Sure you can get the DisplayField from the LayerDetails for any layer.

http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/supportClasses/LayerDetails.html


I guess I meant, getting the actual displayField value for a feature.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Royce,

  Once you know what the DisplayField is than you just make sure that it is one of the returned fields in your query... I am not sure what the hangup is?
0 Kudos
RoyceSimpson
Frequent Contributor
Royce,

  Once you know what the DisplayField is than you just make sure that it is one of the returned fields in your query... I am not sure what the hangup is?


Ah, yes, my bad... In the mxd, the "displayfield" is a custom expression... I should be saying "Display Expression"... not "displayField". That Display Expression is a combo of a couple fields. 

IdentifyResult.value returns whatever is defined in that expression.  No way to get at that via QueryTask or any other way... is there?

Sorry, didn't make that clear in the OP.

It's great that you can use custom geometries to base Identify Task on (such as a buffer poly), but not allowing the user to have options like "completely within" or "completely outside" renders IdentifyTask unusable in my case.  And since QueryTask can't get at that "Display Expression" as defined in the mxd, I'm dead in the water there too.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Royce,

  Hmm, Now that makes more sense. Unfortunately I don't know of a way to get the display expression without the identify task.
0 Kudos
RoyceSimpson
Frequent Contributor
Royce,

  Hmm, Now that makes more sense. Unfortunately I don't know of a way to get the display expression without the identify task.


Do you know any way to get IdentifyTask to run against a layer using a poly geometry in any other way besides the "intersecting" relationship (which seems to be the way it's doing it by default)?
0 Kudos