太晚了,直接连接的源代码:

    /// <summary>
/// TIN生成等高线
/// </summary>
/// <param name="pInterval">等高线间距</param>
public void Tin2Contour(string path_,string name_,double pInterval)
{
//获取TIN
ITinLayer pTinlayer = GetLayerByName(pScene , comboBox_TIN.Text) as ITinLayer;
ITin pTin = pTinlayer.Dataset as ITin; //创建Contour shape
IWorkspaceFactory pWSFac = new ShapefileWorkspaceFactoryClass();
IFeatureWorkspace pFeatureWS = pWSFac.OpenFromFile(path_ , 0) as IFeatureWorkspace;
if (System.IO.File.Exists(path_+"\\"+name_+".shp"))
{
System.IO.File.Delete(path_ + "\\" + name_ + ".shp");
System.IO.File.Delete(path_ + "\\" + name_ + ".dbf");
System.IO.File.Delete(path_ + "\\" + name_ + ".shx");
}
IFields pFields = CreateShapeFields(esriGeometryType.esriGeometryPolyline);
pFeatureWS.CreateFeatureClass(name_ , pFields , null , null , esriFeatureType.esriFTSimple , "Shape" , null); IFeatureClass pContourFeatureClass = pFeatureWS.OpenFeatureClass(name_); //生成等高线
ITinSurface pTinSurface = pTin as ITinSurface;
pTinSurface.Contour(0 , pInterval , pContourFeatureClass , "Contour" , 0); //加入等高线图层
IFeatureLayer pFeatureLayer = new FeatureLayerClass();
pFeatureLayer.FeatureClass = pContourFeatureClass; IGeoFeatureLayer pGeoFeatureLayer = pFeatureLayer as IGeoFeatureLayer;
pGeoFeatureLayer.DisplayAnnotation = true;
pGeoFeatureLayer.DisplayField = "Contour";
pGeoFeatureLayer.Name = pContourFeatureClass.AliasName + "_Contour"; //设置线样式
ILineSymbol pLineSymbol = new SimpleLineSymbolClass();
pLineSymbol.Color = GetRGBColor(32 , 47 , 247);
pLineSymbol.Width = 2;
ISimpleRenderer pRender = pGeoFeatureLayer.Renderer as ISimpleRenderer;
pRender.Symbol = pLineSymbol as ISymbol; pScene.AddLayer(pFeatureLayer as ILayer); }
      #region 创建几何字段

        /// <summary>
/// 创建几何字段
/// </summary>
/// <param name="p_esriGeotype"></param>
/// <returns></returns>
public IFields CreateShapeFields(esriGeometryType p_esriGeotype)
{ IFields pFields = new FieldsClass();
IFieldsEdit pFieldsEdit = pFields as IFieldsEdit; IGeometryDef pGeoDef = new GeometryDefClass();
IGeometryDefEdit pGeoDefEdit = pGeoDef as IGeometryDefEdit;
pGeoDefEdit.GeometryType_2 = p_esriGeotype;
pGeoDefEdit.SpatialReference_2 = (ISpatialReference) new UnknownCoordinateSystem(); IField pFld = new FieldClass();
IFieldEdit pFldEdit = pFld as IFieldEdit;
pFldEdit.Name_2 = "shape";
pFldEdit.IsNullable_2 = false;
pFldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;
pFldEdit.GeometryDef_2 = pGeoDef; pFieldsEdit.AddField(pFld); return pFields;
} #endregion #region 依据名称获取图层 //依据名称获取图层
public ILayer GetLayerByName(IScene scene , string strLayerName)
{
ILayer pLayer = null;
for (int i = 0;i < scene.LayerCount;i++)
{
pLayer = scene.get_Layer(i);
if (strLayerName == pLayer.Name)
{
break;
}
}
return pLayer;
}
#endregion

Contour功能说明参考帮助文档。

版权声明:本文博主原创文章,博客,未经同意,不得转载。

ArcEngine下一个TIN生成的轮廓的更多相关文章

  1. SGU 179 Brackets light(生成字典序的下一个序列)

    题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=179 解题报告:输入一个合法的括号串,求出这个括号串的字典序的下一个串.(认为'(' ...

  2. 31. Next Permutation (java 字典序生成下一个排列)

    题目: Implement next permutation, which rearranges numbers into the lexicographically next greater per ...

  3. POJ 1146 ID Codes 用字典序思想生成下一个排列组合

    ID Codes Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7644   Accepted: 4509 Descript ...

  4. Scrapy 小技巧(一):使用 scrapy 自带的函数(follow & follow_all)优雅的生成下一个请求

    前言 如何优雅的获取同一个网站上下一次爬取的链接并放到生成一个 Scrapy Response 呢? 样例 from urllib import parse import scrapy class S ...

  5. poj 1146 ID Codes (字符串处理 生成排列组合 生成当前串的下一个字典序排列 【*模板】 )

    ID Codes Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 6229   Accepted: 3737 Descript ...

  6. js获取上一个月、下一个月格式为yyyy-mm-dd的日期

    /** * 获取上一个月 * * @date 格式为yyyy-mm-dd的日期,如:2014-01-25 */ function getPreMonth(date) { var arr = date. ...

  7. asp.net下调用Matlab生成动态链接库

    对于这次论文项目,最后在写一篇关于工程的博客,那就是在asp.net下调用matlab生成的dll动态链接库.至今关于matlab,c/c++(opencv),c#(asp.net)我总共写了4篇配置 ...

  8. Linux下动态库生成和使用

    Linux下动态库生成和使用 一.动态库的基本概念 1.动态链接库是程序运行时加载的库,当动态链接库正确安装后,所有的程序都可以使用动态库来运行程序.动态链接库是目标文件的集合,目标文件在动态链接库中 ...

  9. Linux下静态库生成和使用

    Linux下静态库生成和使用 一.静态库概念 1.库是预编译的目标文件(object  files)的集合,它们可以被链接进程序.静态库以后缀为”.a”的特殊的存档(archive file)存储. ...

随机推荐

  1. rhel5.8 ISO yum源配置

    [root@lei1 mnt]# mkdir /mnt/iso [root@lei1 mnt]# mkdir /mnt/cdrom [root@lei1 ~]# mv rhel-server-5.8- ...

  2. poj 2182 Lost Cows(段树精英赛的冠军)

    主题链接:http://poj.org/problem? id=2182 Lost Cows Time Limit: 1000MS   Memory Limit: 65536K Total Submi ...

  3. hdu 4920 Matrix multiplication(矩阵乘法)2014多培训学校5现场

    Matrix multiplication                                                                           Time ...

  4. 【LeetCode】【Python解读】Container with most water

    这个问题是芭芭拉在采访中遇到的,不幸的是,的复杂性O(n2)该,太失望了,难怪没有通过面试. Given n non-negative integers a1, a2, ..., an, where ...

  5. Sqlserver2000联系Oracle11G数据库进行实时数据的同步

    Sqlserver2000联系Oracle11G数据库进行实时数据的同步 1,前提条件 我有sqlserver2000环境,已经存在oracle11g环境,准备这两个数据库,建立各自的訪问账号,两者之 ...

  6. Could not drop object &#39;student&#39; because it is referenced by a FOREIGN KEY constraint

    1. Find foreign keys SELECT * FROM sys.foreign_keys WHERE referenced_object_id = object_id('Student' ...

  7. jquery自定义插件——window实现

    该示例实现弹出窗口效应: 1.jquery.show.js /* * 开发人员:lzugis * 开发时间:2014年6月10日 * 实现功能:点击在鼠标位置显示div * 版本号序号:1.0 */ ...

  8. 策略模式Strategy——坐什么车回家?

    1.存在的问题和模型 :2014年6月       学校:廊坊师范        家:石家庄       人物:学生 又快到期末考试了.回家的节奏也奔上日程,无聊之余就想想这次回家的事儿. 对我来说回 ...

  9. 【浅墨著作】《OpenCV3编程入门》内容简单介绍&amp;勘误&amp;配套源码下载

    经过近一年的沉淀和总结,<OpenCV3编程入门>一书最终和大家见面了. 近期有为数不少的小伙伴们发邮件给浅墨建议最好在博客里面贴出这本书的文件夹,方便大家更好的了解这本书的内容.事实上近 ...

  10. 90社交网络的行为报告后:不拒绝陌生人,TFBOYS作为一个喜爱

    依据腾讯QQ与易观合作的<2014中国90后青年调查报告>,盘点了90后使用社交网络的行为习惯. 相比于70.80后.90后更愿意在社交媒体上公布自己照片.状态,且更愿意在即时通讯中加陌生 ...