第一范文网 - 专业文章范例文档资料分享平台

AE开发实例代码总结

来源:用户分享 时间:2025/5/15 22:29:34 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

catch (Exception Err) { return null; } }

private IPolygon MergePolygons(IPolygon firstPolygon, IPolygon SecondPolygon) { try {

//创建一个Polygon对象

IGeometryCollection pGCollection1 = new PolygonClass();

IGeometryCollection pGCollection2 = firstPolygon as IGeometryCollection; IGeometryCollection pGCollection3 = SecondPolygon as IGeometryCollection; //添加firstPolygon

pGCollection1.AddGeometryCollection(pGCollection2); //添加SecondPolygon

pGCollection1.AddGeometryCollection(pGCollection3); //QI至ITopologicalOperator

ITopologicalOperator pTopological = pGCollection1 as ITopologicalOperator; //执行Simplify操作 pTopological.Simplify();

IPolygon pPolygon = pGCollection1 as IPolygon; //返回Polygon对象 return pPolygon; }

catch (Exception Err) { return null; } }

唯一值渲染代码:

public UniqueValueRender(AxMapControl pMapcontrol, IFeatureLayer pFtLayer,int pCount, string pFieldName) {

IGeoFeatureLayer pGeoFeaturelayer = pFtLayer as IGeoFeatureLayer; IUniqueValueRenderer pUnique = new UniqueValueRendererClass(); pUnique.FieldCount = 1;

pUnique.set_Field(0, pFieldName);

ISimpleFillSymbol pSimFill = new SimpleFillSymbolClass(); //给颜色

IFeatureCursor pFtCursor = pFtLayer.FeatureClass.Search(null, false);

IFeature pFt = pFtCursor.NextFeature(); IFillSymbol pFillSymbol1; ////添加第一个符号

//pFillSymbol1 = new SimpleFillSymbolClass();

//pFillSymbol1.Color = GetRGBColor(103, 252, 179) as IColor; ////添加第二个符号

//IFillSymbol pFillSymbol2 = new SimpleFillSymbolClass(); //pFillSymbol2.Color = GetRGBColor(125, 155, 251) as IColor;

//创建并设置随机色谱从上面的的图可以看出我们要给每一个值定义一种颜色,我们可以创建色谱,但是色谱的这些参数

IRandomColorRamp pColorRamp = new RandomColorRampClass(); pColorRamp.StartHue = 0; pColorRamp.MinValue = 20; pColorRamp.MinSaturation = 15; pColorRamp.EndHue = 360; pColorRamp.MaxValue = 100; pColorRamp.MaxSaturation = 30; pColorRamp.Size = pCount ;

//pColorRamp.Size = pUniqueValueRenderer.ValueCount; bool ok = true;

pColorRamp.CreateRamp(out ok);

IEnumColors pEnumRamp = pColorRamp.Colors; //IColor pColor = pEnumRamp.Next(); int pIndex =pFt.Fields.FindField(pFieldName);

//因为我只有24条记录,所以改变这些,这些都不会超过255或者为负数.求余 int i = 0;

while (pFt != null) {

IColor pColor = pEnumRamp.Next(); if(pColor ==null) {

pEnumRamp.Reset(); pColor = pEnumRamp.Next(); }

//以下注释代码为自定义的两种颜色 ,如果不使用随机的颜色,可以采用这样的 //if (i % 2 == 0) //{

// pUnique.AddValue(Convert.ToString(pFt.get_Value(pIndex)), pFieldName, pFillSymbol1 as ISymbol); //} //else //{

// pUnique.AddValue(Convert.ToString(pFt.get_Value(pIndex)), pFieldName, pFillSymbol2 as ISymbol);

//} //i++;

pFillSymbol1 = new SimpleFillSymbolClass(); pFillSymbol1.Color = pColor;

pUnique.AddValue(Convert.ToString(pFt.get_Value(pIndex)), pFieldName, pFillSymbol1 as ISymbol);

pFt = pFtCursor.NextFeature(); // pColor = pEnumRamp.Next(); }

pGeoFeaturelayer.Renderer = pUnique as IFeatureRenderer;

pMapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null); }

private IRgbColor GetRGBColor(int R, int G, int B)//子类赋给父类 {

IRgbColor pRGB;

pRGB = new RgbColorClass(); pRGB.Red = R; pRGB.Green = G; pRGB.Green = B; return pRGB; } }

第二部分 AO GIS应用开发

1、 ArcView、AecEdit和ArcInfo并不是一个软件的名称,

它是桌面版GIS的一种版本代码,这三种版本的软件系统都是由ArcMap、ArcCatalog、ArcScene等单个软件组成的,但是他们包含的GIS功能不一样。其中ArcInfo功能最强。

2、 GIS服务器可以通过网络发布地理信息,它包括ArcGIS Server、

ArcIMS和ArcSDE三种软件。ArcGIS Server,通常用于建构企

业级别的互联网GIS应用;ArcIMS则是一个可定制扩展的,能够在网络上发布地理信息的网络地图发布系统;ArcSDE是一个空间数据引擎,他可以用于管理关系数据库,以实现地理数据的海量存储等高级特性。

搜索更多关于: AE开发实例代码总结 的文档
AE开发实例代码总结.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c6dd2f2yvm0565jb3uu0z_8.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top