版权声明:欢迎评论和转载,转载请注明来源。 https://blog.csdn.net/zy332719794/article/details/9175991
矢量符号化(渲染)类型
要素符号化类型 | 描述 | |
1 | SimpleRender | 简单符号化 |
2 | UniqueValueRender | 唯一值符号化 |
3 | BiUniqueValueRender | 双变量唯一值符号化 |
4 | ChartRender | 图表符号化 |
5 | ClassBreaksRenderer | 分类等级符号化 |
6 | DotDensityRenderer | 点密度符号化 |
7 | ProportionalSymbolRenderer | 根据属性值设置符号大小进行符号化 |
8 | ScaleDependentRenderer | 依比例尺符号化 |
9 | RepresentationRenderer | 制图表达符号化 |
10 | CoTrackSymbologyRenderer(TrackingAnalyst) | 轨迹符号化(应用于TrackingAnaylyst扩展模块) |
11 | NAStopRenderer(NetworkAnalyst) | 停止符号化(应用于网络分析扩展模块) |
12 | FeatureVertexRenderer(SurveyExt) | 要素定点符号化(应用于测量分析扩展模块) |
13 | SharedEdgeRenderer(EditorExt) | 用于绘制拓扑元素 |
14 | CoTrackSymbologyRenderer(TrackingAnalyst) |
轨迹符号化(应用于TrackingAnaylyst扩展模块) |
15 | EnhancedInfoRenderder(TrackingAnalyst) | 增强信息符号化(应用于TrackingAnaylyst扩展模块) |
栅格符号化(渲染)类型
要素符号化类型 | 描述 | |
1 | RasterRGBRenderer | 真彩色RGB符号化 |
2 | RasterUniqueValueRenderer | 唯一值符号化 |
3 | RasterColormapRenderer | 色彩对照表符号化 |
4 | RasterClassifyColorRampRenderer | 分类值等级符号化 |
5 | RasterStretchColorRampRenderer | 连续值等级符号化 |
6 | RasterDiscreteColorRenderer | 离散色彩符号化 |
部分示例代码:
UniqueValueRender 唯一值渲染
private void UniqueRender(IFeatureLayer featureLayer)
{
IUniqueValueRenderer uniqueValueRenderer = new UniqueValueRenderer();
// 判断唯一的字段数量(1-3个),必须设置。
uniqueValueRenderer.FieldCount = 1;
uniqueValueRenderer.set_Field(0, "FieldName");
// 设置填充样式。
IFillSymbol fillSymbol = new SimpleFillSymbol();
fillSymbol.Color = new RgbColor() { Red = 255, Green = 0, Blue = 0 };
uniqueValueRenderer.AddValue("30", "", (ISymbol)fillSymbol);
fillSymbol = new SimpleFillSymbol();
fillSymbol.Color = new RgbColor() { Red = 0, Green = 255, Blue = 0 };
uniqueValueRenderer.AddValue("40", "", (ISymbol)fillSymbol);
fillSymbol = new SimpleFillSymbol();
fillSymbol.Color = new RgbColor() { Red = 0, Green = 0, Blue = 255 };
uniqueValueRenderer.AddValue("50", "", (ISymbol)fillSymbol);
// 图层设置渲染。
var featureRenderer = (IFeatureRenderer) uniqueValueRenderer;
var geoFeatureLayer = (IGeoFeatureLayer) featureLayer;
geoFeatureLayer.Renderer = featureRenderer;
}
ClassBreaksRenderer 分类等级渲染
private void ClassBreaksRenderer(IFeatureLayer featureLayer)
{
IClassBreaksRenderer classBreaksRenderer = new ClassBreaksRenderer();
classBreaksRenderer.Field = "FieldName";
// 必须设置分类数量。
classBreaksRenderer.BreakCount = 4;
classBreaksRenderer.set_Break(0, 35);
classBreaksRenderer.set_Break(1, 45);
classBreaksRenderer.set_Break(2, 50);
// 设置填充样式。
IFillSymbol fillSymbol = new SimpleFillSymbol();
fillSymbol.Color = new RgbColor() {Red = 255, Green = 0, Blue = 0};
classBreaksRenderer.set_Symbol(0, (ISymbol)fillSymbol);
fillSymbol = new SimpleFillSymbol();
fillSymbol.Color = new RgbColor() {Red = 0, Green = 255, Blue = 0};
classBreaksRenderer.set_Symbol(1, (ISymbol)fillSymbol);
fillSymbol = new SimpleFillSymbol();
fillSymbol.Color = new RgbColor() {Red = 0, Green = 0, Blue = 255};
classBreaksRenderer.set_Symbol(2, (ISymbol)fillSymbol);
// 图层设置渲染。
var featureRenderer = (IFeatureRenderer)classBreaksRenderer;
var geoFeatureLayer = (IGeoFeatureLayer) featureLayer;
geoFeatureLayer.Renderer = featureRenderer;
}
DotDensityRenderer 点密度渲染
private void DotDensityRenderer(IFeatureLayer featureLayer)
{
IDotDensityRenderer dotDensityRenderer = new DotDensityRendererClass();
// 一个点代表多大的值。(例:值为100,则会填充50个点)
dotDensityRenderer.DotValue = 2;
var rendererFields = (IRendererFields)dotDensityRenderer;
rendererFields.AddField("FieldName");
// 设置点样式。
IDotDensityFillSymbol dotDensityFillSymbol = new DotDensityFillSymbol();
IMarkerSymbol markerSymbol = new SimpleMarkerSymbol();
markerSymbol.Color = new RgbColor() { Red = 255, Green = 0, Blue = 0 };
markerSymbol.Size = 2;
var symbolArray = (ISymbolArray) dotDensityFillSymbol;
symbolArray.AddSymbol((ISymbol)markerSymbol);
dotDensityRenderer.DotDensitySymbol = dotDensityFillSymbol;
// 图层设置渲染。
var featureRenderer = (IFeatureRenderer) dotDensityRenderer;
var geoFeatureLayer = (IGeoFeatureLayer)featureLayer;
geoFeatureLayer.Renderer = featureRenderer;
}