-
大小: 2.79MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-11-12
- 語言: 其他
- 標(biāo)簽: 點(diǎn)生成TIN??
資源簡(jiǎn)介
通過exel表中的坐標(biāo)創(chuàng)建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數(shù)據(jù)“;
????????????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);
????????????//轉(zhuǎn)為shp?????//?默認(rèn)存儲(chǔ)路徑s_path
????????????string?s_path?=?System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);???????///存儲(chǔ)在debug目錄下
????????????string?shpName=“坐標(biāo)點(diǎn)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文件的存儲(chǔ)路徑
????????//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
????????//創(chuàng)建shape的幾何字段,如點(diǎn),線
????????public?IFeatureClass?
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????22528??2016-11-09?15:35??kurong\kurong\bin\Debug\kurong.exe
?????文件??????52736??2016-11-09?15:35??kurong\kurong\bin\Debug\kurong.pdb
?????文件??????11608??2016-11-09?15:35??kurong\kurong\bin\Debug\kurong.vshost.exe
?????文件?????????38??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\prj.adf
?????文件????????104??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\tdenv9.adf
?????文件????1391568??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\tedg.adf
?????文件???????3680??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\thul.adf
?????文件??????14628??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\tmsk.adf
?????文件????????116??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\tmsx.adf
?????文件????1391568??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\tnod.adf
?????文件?????115970??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\tnodinfo.adf
?????文件?????927760??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\tnxy.adf
?????文件?????231940??2016-11-09?15:28??kurong\kurong\bin\Debug\tin1\tnz.adf
?????文件?????????38??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\prj.adf
?????文件????????104??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\tdenv9.adf
?????文件????1391568??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\tedg.adf
?????文件???????3680??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\thul.adf
?????文件??????14628??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\tmsk.adf
?????文件????????116??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\tmsx.adf
?????文件????1391568??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\tnod.adf
?????文件?????115970??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\tnodinfo.adf
?????文件?????927760??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\tnxy.adf
?????文件?????231940??2016-11-09?15:32??kurong\kurong\bin\Debug\tin2\tnz.adf
?????文件????3710946??2016-11-09?15:32??kurong\kurong\bin\Debug\坐標(biāo)點(diǎn)shp文件.dbf
?????文件????2551264??2016-11-09?15:32??kurong\kurong\bin\Debug\坐標(biāo)點(diǎn)shp文件.shp
?????文件?????463948??2016-11-09?15:32??kurong\kurong\bin\Debug\坐標(biāo)點(diǎn)shp文件.shx
?????文件??????10007??2016-11-09?16:09??kurong\kurong\CreateshpToTIN.cs
?????文件???????9530??2016-11-09?15:33??kurong\kurong\CreateshpToTIN.Designer.cs
?????文件???????8049??2016-11-09?15:33??kurong\kurong\CreateshpToTIN.resx
?????文件???????1156??2016-11-09?16:09??kurong\kurong\Form1.cs
............此處省略35個(gè)文件信息
評(píng)論
共有 條評(píng)論