点文件创建tin


通过exel表中的坐标创建shape文件生成tin
资源截图
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Drawing.Imaging;
using System.Collections;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Carto;
using System.IO;

namespace kurong
{
    public partial class CreateshpToTIN : Form
    {
        public AxSceneControl pScenecontrol;
        public string ExePath=“ “;

    public CreateshpToTIN(AxSceneControl sceneCon)
    {
         this.pScenecontrol = sceneCon;
         InitializeComponent();
           
     }

        private void button_loadpoint_Click(object sender EventArgs e)
        {
            OpenFileDialog mopenfiledig=new OpenFileDialog();
            mopenfiledig.title = “打开exel数据“;
            mopenfiledig.Filter = “Excel表格(*.xls)|*.xls“;
            DialogResult mdilogresult=new  DialogResult();
            mdilogresult = mopenfiledig.ShowDialog();      //     !!!!!
            if (mdilogresult == DialogResult.OK)
            {
                textBox_point.Text = mopenfiledig.FileName;
                ExePath = textBox_point.Text;
                
            }
            else
            {
            }
        }

        private void button_ok_Click(object sender EventArgs e)
        { 
            string sheetName = “sheet1“;
            //读取exel
            DataTable mdatatable = ReadExel(sheetNameExePath);
            //转为shp     // 默认存储路径s_path
            string s_path = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);       ///存储在debug目录下
            string shpName=“坐标点shp文件“;
            IFeatureClass mfeatuClass=ToShape(sheetNames_pathshpName);
            IFeatureClass FillFeatureclass= Fillshape(sheetName mdatatable mfeatuClass);
          
            string tin_path=textBox_outpath.Text;
            CreateTin(tin_path FillFeatureclass);
        }

        #region
        //读取exel表
        //exepath  exel文件的存储路径
        //sheetname   exel表格中sheet1的名称
        public DataTable ReadExel(string sheetnamestring exepath)
        {
            DataTable dtTable=new DataTable();
            DataSet ds=new DataSet();

            OleDbConnection conn = new OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=“ + exepath + “;Extended Properties=Excel 8.0“);
            conn.Open();
            string table = string.Format(“SELECT * FROM [{0}$]“sheetname);
            OleDbDataAdapter olecommand = new OleDbDataAdapter(table conn);
            olecommand.Fill(ds “[“ + sheetname + “]“);
            dtTable = ds.Tables[0];
            return dtTable;
        }
        #endregion

        #region
        //创建shape的几何字段,如点,线
        public IFeatureClass 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      22528  2016-11-09 15:35  kurongkuronginDebugkurong.exe

     文件      52736  2016-11-09 15:35  kurongkuronginDebugkurong.pdb

     文件      11608  2016-11-09 15:35  kurongkuronginDebugkurong.vshost.exe

     文件         38  2016-11-09 15:28  kurongkuronginDebug in1prj.adf

     文件        104  2016-11-09 15:28  kurongkuronginDebug in1 denv9.adf

     文件    1391568  2016-11-09 15:28  kurongkuronginDebug in1 edg.adf

     文件       3680  2016-11-09 15:28  kurongkuronginDebug in1 hul.adf

     文件      14628  2016-11-09 15:28  kurongkuronginDebug in1 msk.adf

     文件        116  2016-11-09 15:28  kurongkuronginDebug in1 msx.adf

     文件    1391568  2016-11-09 15:28  kurongkuronginDebug in1 nod.adf

     文件     115970  2016-11-09 15:28  kurongkuronginDebug in1 nodinfo.adf

     文件     927760  2016-11-09 15:28  kurongkuronginDebug in1 nxy.adf

     文件     231940  2016-11-09 15:28  kurongkuronginDebug in1 nz.adf

     文件         38  2016-11-09 15:32  kurongkuronginDebug in2prj.adf

     文件        104  2016-11-09 15:32  kurongkuronginDebug in2 denv9.adf

     文件    1391568  2016-11-09 15:32  kurongkuronginDebug in2 edg.adf

     文件       3680  2016-11-09 15:32  kurongkuronginDebug in2 hul.adf

     文件      14628  2016-11-09 15:32  kurongkuronginDebug in2 msk.adf

     文件        116  2016-11-09 15:32  kurongkuronginDebug in2 msx.adf

     文件    1391568  2016-11-09 15:32  kurongkuronginDebug in2 nod.adf

     文件     115970  2016-11-09 15:32  kurongkuronginDebug in2 nodinfo.adf

     文件     927760  2016-11-09 15:32  kurongkuronginDebug in2 nxy.adf

     文件     231940  2016-11-09 15:32  kurongkuronginDebug in2 nz.adf

     文件    3710946  2016-11-09 15:32  kurongkuronginDebug坐标点shp文件.dbf

     文件    2551264  2016-11-09 15:32  kurongkuronginDebug坐标点shp文件.shp

     文件     463948  2016-11-09 15:32  kurongkuronginDebug坐标点shp文件.shx

     文件      10007  2016-11-09 16:09  kurongkurongCreateshpToTIN.cs

     文件       9530  2016-11-09 15:33  kurongkurongCreateshpToTIN.Designer.cs

     文件       8049  2016-11-09 15:33  kurongkurongCreateshpToTIN.resx

     文件       1156  2016-11-09 16:09  kurongkurongForm1.cs

............此处省略35个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)