private void 河流面转点ToolStripMenuItem_Click(object sender, EventArgs e)
{
ESRI.ArcGIS.Geodatabase.IWorkspaceFactory wsf = new ESRI.ArcGIS.DataSourcesFile.ShapefileWorkspaceFactory();
IWorkspace ws = wsf.OpenFromFile(@"F:\1-水利项目\安徽水利\0826处理", ); IFeatureClass autoStation = (ws as IFeatureWorkspace).OpenFeatureClass("淮河干流面");
IFeatureClass f1 = (ws as IFeatureWorkspace).OpenFeatureClass("河道范围点"); int num = autoStation.FeatureCount(null);
int k = ;
string file = @"F:\1-水利项目\安徽水利\ANSL20120808\ANSL\OutPut\淮河干流\hedaopolygon.txt";
if (File.Exists(file))
{
File.Delete(file);
}
StreamWriter writer = new StreamWriter(file, true);
string strpt = "";
for (int i = ; i < num; i++)
{
IPolygon pg = autoStation.GetFeature(i).Shape as IPolygon; IPointCollection ptc = pg as IPointCollection;
for (int j = ; j < ptc.PointCount; j++)
{
IPoint pt = ptc.get_Point(j);
k++;
IFeature fea = f1.CreateFeature();
fea.Shape = pt;
fea.set_Value(fea.Fields.FindField("Id"), k);
fea.set_Value(fea.Fields.FindField("longi"), pt.X);
fea.set_Value(fea.Fields.FindField("latit"), pt.Y);
fea.Store(); strpt=strpt+pt.X+","+pt.Y+","+"0,";
}
strpt = strpt + ptc.get_Point().X + "," + ptc.get_Point().Y + "," + "0,";
}
writer.Write(strpt);
writer.Close();
}

IPolygon转换为IPoint,且点的坐标值写入txt中。

IPoilygon转IPoint的更多相关文章

  1. List<IPoint> to IPointCollection to IPolygon

    IPointCollection 到 IPolygon的转换 IPoint pPoint = new PointClass();            //IPolygon pPolygon1 = n ...

  2. 找个输入IPoint在某个FeatureClass上距离最近的要素

      /// <summary> /// 得到输入点在输入图层上的最近点 /// </summary> /// <param name="randomPoints ...

  3. IPoint从自定义的投影坐标系转换到自定义的地理坐标系

    IPoint pointStart = new PointClass(); pointStart = xyPolyline.FromPoint; ISpatialReferenceFactory pS ...

  4. 判断IFeatureClass图形是否含有Z值信息,若有为IPoint赋Z值

    判断IFeatureClass图形是否含有Z值信息 IFeatureClass featureClass = this.pLayer.FeatureClass; string shapeFieldNa ...

  5. IPoint Interface接口

    Description A Point is a zero-dimensional object that represents a specific (X, Y) location in a the ...

  6. ArcGIS Engine开发之鹰眼视图

    鹰眼是GIS软件的必备功能之一.它是一个MapControl控件,主要用来表示数据视图中的地理范围在全图中的位置. 鹰眼一般具有的功能: 1)鹰眼视图与数据视图的地理范围保持同步. 2)数据视图的当前 ...

  7. ArcGIS Engine开发之量测功能

    1.距离测量 距离测量时,片段长度通过两点之间距离计算得到,全部长度通过片段长度的和计算得到.主要用到INewLineFeedback和IScreenDisplay两个接口. 1)INewLineFe ...

  8. ArcGIS Engine开发之地图浏览

    地图的浏览功能包括缩放.移动.量测旋转等. 1.放大与缩小 无论是放大还是缩小,都是通过改变MapControl中当前视图的范围Extent属性来实现的,主要用到包络线(Envelope)类. 包络线 ...

  9. ArcGIS Engine开发之地图基本操作(4)

    ArcGIS Engine开发中数据库的加载 1.加载个人地理数据库数据 个人地理数据库(Personal Geodatabase)使用Miscrosoft Access文件(*.mdb)进行空间数据 ...

随机推荐

  1. Codeforces Bubble Cup 8 - Finals [Online Mirror] F. Bulbo DP

    F. Bulbo Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/575/problem/F Des ...

  2. [置顶] SNMP协议详解<二>

    上一篇文章讲解了SNMP的基本架构,本篇文章将重点分析SNMP报文,并对不同版本(SNMPv1.v2c.v3)进行区别! 四.SNMP协议数据单元 在SNMP管理中,管理站(NMS)和代理(Agent ...

  3. Cucumber 入门一

    (转自:http://www.cnblogs.com/jarodzz/archive/2012/07/02/2573014.html) 第一次看到Cucumber和BDD(Behavior Drive ...

  4. UVA 10006 - Carmichael Numbers 数论(快速幂取模 + 筛法求素数)

      Carmichael Numbers  An important topic nowadays in computer science is cryptography. Some people e ...

  5. jQuery获取表单各元素的值

    radio值获取 $("input[type='radio']:checked").val(); 2,设置指定的项为当前选中项 $("input[type='radio' ...

  6. Android网络请求与解析

    1.Volley和Gson结合使用——Volley适用于小型数据,多次的请求,使用Gson解析时,服务器数据的键值不能包含常用的标识符如:class.....等,这些就需要与服务端小伙伴商量 这样也可 ...

  7. 《sift算法详解》阅读笔记

    原博客来自:http://blog.csdn.net/zddblog/article/details/7521424 定义: 尺度不变特征转化是一种计算机视觉算法,用于侦测和描述物体的局部性特征,在空 ...

  8. ubunutu_install_sublime_china

    保存下面的代码到文件sublime_imfix.c(位于~目录) #include <gtk/gtkimcontext.h> void gtk_im_context_set_client_ ...

  9. controller,link,compile不同

    测试案例 .directive('testDirective', function() { return { restrict: 'E', template: '<p>Hello {{nu ...

  10. CF Spreadsheets (数学)

    Spreadsheets time limit per test 10 seconds memory limit per test 64 megabytes input standard input ...