Select to view content in your preferred language

Get Unique

826
3
12-07-2010 03:37 AM
PaulHuppé
Deactivated User
Hi,

With the query task, is there a way to ask for a list of unique values like you can do in ArcMap's query builder?

Paul
0 Kudos
3 Replies
PaulHuppé
Deactivated User
Unless there is a better way, I am currently looping through the results to find the unique values.
0 Kudos
JenniferNery
Esri Regular Contributor
The REST API accepts the following parameters http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/query.html therefore "select distinct" is not possible.

You would have to do this through maybe a LINQ query once you have the results back.
You can do something like the following in the Query_ExecuteCompleted event handler:

var graphics = (from g in e.FeatureSet.Features
select g).Distinct();
CODE]
0 Kudos
PaulHuppé
Deactivated User
Thanks Jennifer.
Paul
0 Kudos