当前位置: 首页>>代码示例>>C#>>正文


C# Coordinate.Show方法代码示例

本文整理汇总了C#中Coordinate.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Coordinate.Show方法的具体用法?C# Coordinate.Show怎么用?C# Coordinate.Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Coordinate的用法示例。


在下文中一共展示了Coordinate.Show方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btn_Data_StatisticTables_ItemClick

        //导入坐标·  完善代码 未创建图层
        private void btn_Data_StatisticTables_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Coordinate am = new Coordinate( this.axMapControl1);
            am.Show();
            //am.TopMost = true;
            #region
            /*
            //定义点集环形
            Ring ring1 = new RingClass();
            object missing = Type.Missing;
            //新建一个datatable用于保存读入的数据
            DataTable dt = new DataTable();
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Multiselect = false;    //单选
            ofd.Title = "选择坐标文件";
            ofd.Filter = "txt文件|*.txt";
            ofd.InitialDirectory = Environment.SpecialFolder.Desktop.ToString();
            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //IGeometryCollection pointPolygon = new PolygonClass();
                FileInfo fi = new FileInfo(ofd.FileName);
                try
                {
                    String paths = ofd.FileName;
                    int i = 0;
                    //给datatable添加5个列
                    dt.Columns.Add("编号", typeof(int));
                    dt.Columns.Add("坐标X", typeof(double));
                    dt.Columns.Add("坐标Y", typeof(double));
                    dt.Columns.Add("高程Z", typeof(double));
                    dt.Columns.Add("采集日期", typeof(string));
                    //读入文件
                    StreamReader sr = new StreamReader(paths, Encoding.Default);

                    //循环读取所有行
                    while (!sr.EndOfStream)//(line = sr.ReadLine()) != null)
                    {
                        i++;
                        //将每行数据,用-分割成2段
                        //sr.ReadLine().TrimStart();//消除前面空格
                        //sr.ReadLine().TrimEnd();//消除尾部空格
                        string[] data = sr.ReadLine().Split(',', ' ');
                        //新建一行,并将读出的数据分段,分别存入5个对应的列中
                        DataRow dr = dt.NewRow();
                        dr[0] = i;
                        dr[1] = data[0];
                        dr[2] = data[1];
                        dr[3] = 0;
                        dr[4] = DateTime.Now.ToLongDateString().ToString();
                        //将这行数据加入到datatable中
                        dt.Rows.Add(dr);
                        //点上生成面
                        IPoint ppp = new PointClass();
                        ppp.PutCoords((double)dr[1], (double)dr[2]);
                        ring1.AddPoint(ppp, ref missing, ref missing);
                        //调用画点工具
                        GISHandler.GISTools.CreatPoint(this.axMapControl1, (double)dr[1], (double)dr[2], i);
                    }
                }
                catch
                {
                    MessageBox.Show("坐标文件内容错误!请检查格式是否为:x,y或者x y");
                }
                */
                #region 源码
                /*
                     //画多边形;
                      IGeometryCollection pointPolygon = new PolygonClass();
                      pointPolygon.AddGeometry(ring1 as IGeometry, ref missing, ref missing);
                      IPolygon polyGonGeo = pointPolygon as IPolygon;
                      polyGonGeo.SimplifyPreserveFromTo();

                      //待封装
                      //ISimpleLineSymbol pLineSym = new SimpleLineSymbol();
                      ISimpleFillSymbol pSymbol = new SimpleFillSymbolClass();
                      IRgbColor pColor = new RgbColor();
                      pColor.Red = 255;
                      pColor.Green = 0;
                      pColor.Blue = 0;
                      pSymbol.Color = pColor;
                      //pSymbol.Style = esriSimpleFillStyle.;//esriSFSHorizontal网格斜线

                      object Symbol = pSymbol as object;

                    */
                #endregion

                //添加到图层
                //读取文件内容    进行标准化判断
                //先读取每个点坐标,生成point(IPoint接口)
                //把所有Point加到pointcollection(IPointCollection接口)
                //首尾坐标要一致
                //画多边形;
            /*  IGeometryCollection pointPolygon = new PolygonClass();
              pointPolygon.AddGeometry(ring1 as IGeometry, ref missing, ref missing);
              IPolygon polyGonGeo = pointPolygon as IPolygon;
              polyGonGeo.SimplifyPreserveFromTo();

              Coordinate am = new Coordinate(polyGonGeo,this.axMapControl1);
//.........这里部分代码省略.........
开发者ID:AgentWord,项目名称:SiPing,代码行数:101,代码来源:MainForm.cs


注:本文中的Coordinate.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。