Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I run the following code:

IClassify classify = new NaturalBreaksClass();
ITableHistogram tableHistogram = new BasicTableHistogramClass();
IBasicHistogram basicHistogram = tableHistogram as IBasicHistogram;
tableHistogram.Table = table;
tableHistogram.Field = fieldName;
if ( !string.IsNullOrEmpty( normName ) ) tableHistogram.NormField = normName;
object dataFrequency;
object dataValues;
basicHistogram.GetHistogram( out dataValues, out dataFrequency );
double[] data = dataValues as double[];
int[] freq = dataFrequency as int[];
classify.SetHistogramData( data, freq );

but when I examine the classify object SetHistogramData() appears to have done nothing despite the fact that I can clearly see over 2000 items in both the data and freq arrays.

I can read the values from the array directly and set them in the ClassBreaksRenderer using set_Break() but if that is the correct way then why should I call SetHistogramData() at all? What does SetHistogramData do?

share|improve this question
    
Not sure if this has anything to do with your problem, but in general if you are working with an interface named ISomeInterface and see another interface named ISomeInterfaceGEN, then you should use the GEN interface with .NET. In this case IClassifyGEN. –  Kirk Kuykendall Nov 7 '11 at 19:44
    
I totally get that after spending the whole day reading everything I could about classification. If I had not read this in the help for the NaturalBreaksClass Class I would have come to that conclusion sooner: This classification only uses the IClassify interface, so there is nothing to set up other than calling IClassify::SetHistogramData. The ESRI documentation presumes you can tell six things apart that have the same name and that you were arm and arm with Noah when he stepped from the Ark. Without this site I'd be in Davy Jones locker. –  Chaz Nov 7 '11 at 22:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.