private void button1_Click(object sender, EventArgs e)
{
// button2.PerformClick();
// Thread.Sleep(5000);
int classCount = 200000;
ITableHistogram tableHistogram;
IBasicHistogram basicHistogram;
ITable table;
IGeoFeatureLayer geoFeatureLayer;
geoFeatureLayer = getGeoLayer("beijing");
ILayer layer = geoFeatureLayer as ILayer;
table = layer as ITable;
tableHistogram = new BasicTableHistogramClass();
tableHistogram.Table = table;
tableHistogram.Field = "daxiao";
basicHistogram = tableHistogram as IBasicHistogram;
object values;
object frequencys;
basicHistogram.GetHistogram(out values, out frequencys);
IClassifyGEN classifyGEN = new QuantileClass();
classifyGEN.Classify(values, frequencys, ref classCount);
double[] classes;
classes = classifyGEN.ClassBreaks as double[];
IEnumColors enumColors = CreateAlgorithmicColorRamp(classes.Length).Colors;
IColor color;
IClassBreaksRenderer classBreaksRenderer = new ClassBreaksRendererClass();
classBreaksRenderer.Field = "daxiao";
//classBreaksRenderer.BreakCount = classCount;
classBreaksRenderer.BreakCount = classCount;
classBreaksRenderer.SortClassesAscending = true;
// ISimpleFillSymbol simpleFillSymbol;//原来填充
ISimpleMarkerSymbol simpleMarkerSymbol;
for (int i = 0; i < classes.Length - 1; i++)
{
color = enumColors.Next();
//simpleFillSymbol = new SimpleFillSymbolClass();//原来填充
simpleMarkerSymbol = new SimpleMarkerSymbolClass();
// simpleFillSymbol.Color = color;//原来填充
simpleMarkerSymbol.Color = color;
// simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;//原来填充
simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSSquare;
simpleMarkerSymbol.Size = 1;
// classBreaksRenderer.set_Symbol(i, simpleFillSymbol as ISymbol);//原来填充
classBreaksRenderer.set_Symbol(i, simpleMarkerSymbol as ISymbol);
classBreaksRenderer.set_Break(i, classes[i]);
}
if (geoFeatureLayer != null)
{
geoFeatureLayer.Renderer = classBreaksRenderer as IFeatureRenderer;
}
label1.Visible = true;
label2.Visible = true;
label3.Visible = true;
//this.axMapControl1.ActiveView.Refresh();
//axTOCControl1.Update();
}
{
// button2.PerformClick();
// Thread.Sleep(5000);
int classCount = 200000;
ITableHistogram tableHistogram;
IBasicHistogram basicHistogram;
ITable table;
IGeoFeatureLayer geoFeatureLayer;
geoFeatureLayer = getGeoLayer("beijing");
ILayer layer = geoFeatureLayer as ILayer;
table = layer as ITable;
tableHistogram = new BasicTableHistogramClass();
tableHistogram.Table = table;
tableHistogram.Field = "daxiao";
basicHistogram = tableHistogram as IBasicHistogram;
object values;
object frequencys;
basicHistogram.GetHistogram(out values, out frequencys);
IClassifyGEN classifyGEN = new QuantileClass();
classifyGEN.Classify(values, frequencys, ref classCount);
double[] classes;
classes = classifyGEN.ClassBreaks as double[];
IEnumColors enumColors = CreateAlgorithmicColorRamp(classes.Length).Colors;
IColor color;
IClassBreaksRenderer classBreaksRenderer = new ClassBreaksRendererClass();
classBreaksRenderer.Field = "daxiao";
//classBreaksRenderer.BreakCount = classCount;
classBreaksRenderer.BreakCount = classCount;
classBreaksRenderer.SortClassesAscending = true;
// ISimpleFillSymbol simpleFillSymbol;//原来填充
ISimpleMarkerSymbol simpleMarkerSymbol;
for (int i = 0; i < classes.Length - 1; i++)
{
color = enumColors.Next();
//simpleFillSymbol = new SimpleFillSymbolClass();//原来填充
simpleMarkerSymbol = new SimpleMarkerSymbolClass();
// simpleFillSymbol.Color = color;//原来填充
simpleMarkerSymbol.Color = color;
// simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;//原来填充
simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSSquare;
simpleMarkerSymbol.Size = 1;
// classBreaksRenderer.set_Symbol(i, simpleFillSymbol as ISymbol);//原来填充
classBreaksRenderer.set_Symbol(i, simpleMarkerSymbol as ISymbol);
classBreaksRenderer.set_Break(i, classes[i]);
}
if (geoFeatureLayer != null)
{
geoFeatureLayer.Renderer = classBreaksRenderer as IFeatureRenderer;
}
label1.Visible = true;
label2.Visible = true;
label3.Visible = true;
//this.axMapControl1.ActiveView.Refresh();
//axTOCControl1.Update();
}