classification

693
4
02-26-2011 11:06 AM
ThaoNguyen
New Contributor II
arcgis desktop api has classify classes that return values based on classification type (e.g. equal interval, quantile, natural breaks).
Are there such classes in wpf api that I can use?  If not, how can I know the algorithms that arcgis used for those classifications?  We would like to get the same algorithms so that the values of the wpf map matched with the desktop map.

Thanks!
0 Kudos
4 Replies
JenniferNery
Esri Regular Contributor
0 Kudos
ThaoNguyen
New Contributor II
I believe you are referring to this http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Classifying_numerical_fields_for_gradu....

Using Web API's you can use the same symbology defined in your service or you may overwrite with your own ClassBreaksRenderer as shown in two following examples:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RenderersXAML
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerRendering

Here's more documentation about it: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ClassBreak...


The examples given are not quite what I'm looking for.  In these examples, I'm supposed to know my class break values while I don't have those values yet.  I'm looking for a class that I can pass in a bunch of data, classification class number and method (e.g. quantile), and I want to get back the breaks values.  Just like in the first link, Breaks Values are what I want.
For instance, using arcgis desktop apis, we could do something like below:
IClassify classify = ClassifyInstance;
IClassifyGEN classifyGEN = classify as IClassifyGEN;
classifyGEN.Classify(doubleArrayValues, longArrayFrequencies, ref NumClasses);
double[] breaks = classifyGEN.ClassBreaks as double[];

IClassifyGEN is arcgis class.
breaks values are what I want, it will give me a list of generated values.

Thanks for the info though.  It may help me in future.
0 Kudos
JenniferNery
Esri Regular Contributor
As far as I know you need to set up the map document with class breaks renderer to have access to these values in the web API. There is no interface with method that will return the classes based on provided data and method of classification like in ArcGISDesktop.
0 Kudos
DaveRabrun
New Contributor
I had to do something similar in a previous project. If you want all the calculations done from the client, you'll have to implement the algorithms for Equal Interval, Equal Area and Natural Breaks yourself, there is alot of pseudocode online to do this.

But, If you implement the algorithms yourself, you probably won't be able to simulate the exact classifications you'd get from  ArcGIS Desktop.

Maybe if you made a webservice with a "Classify"  function which takes the (doubleArrayValues, longArrayFrequencies, ref NumClasses) parameters, you could then have the server use the ArcGIS Desktop API and then via the webservice send back the breaks to the client layer's ClassBreaksRender.
0 Kudos