-
大小: 81KB文件類型: .rar金幣: 2下載: 1 次發(fā)布日期: 2021-06-01
- 語言: C#
- 標(biāo)簽: C#??ArcEngine10.??txt點??矢量??
資源簡介
C#+ArcEngine:txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點(VS2010+窗體)。這是ArcEngine10.1版本和VS2010。

代碼片段和文件信息
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.IO;
using?System.Collections;
using?ESRI.ArcGIS.Geometry;
using?ESRI.ArcGIS.Carto;
using?ESRI.ArcGIS.Geodatabase;
using?ESRI.ArcGIS.DataSourcesFile;
namespace?txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010
{
????public?partial?class?MainForn?:?Form
????{
????????public?MainForn()
????????{
????????????InitializeComponent();
????????}
????????//選擇txt點文件:格式為?xyz//可加序號
????????private?void?btnPath_Click(object?sender?EventArgs?e)
????????{
????????????OpenFileDialog?xjTxtOpenFileDialog?=?new?OpenFileDialog();
????????????xjTxtOpenFileDialog.Multiselect?=?false;
????????????xjTxtOpenFileDialog.title?=?“打開txt坐標(biāo)文件“;
????????????xjTxtOpenFileDialog.Filter?=?“txt坐標(biāo)文件(*.txt)|*.txt“;
????????????if?(xjTxtOpenFileDialog.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????this.txtPath.Text?=?xjTxtOpenFileDialog.FileName;
????????????}
????????}
????????//設(shè)置shp點保存路徑
????????private?void?btnShpPath_Click(object?sender?EventArgs?e)
????????{
????????????SaveFileDialog?xjShpSaveFileDialog?=?new?SaveFileDialog();
????????????xjShpSaveFileDialog.Filter?=?“Shape文件(*.shp)|*.shp“;
????????????if?(File.Exists(this.txtPath.Text))
????????????{
????????????????xjShpSaveFileDialog.FileName?=?System.IO.Path.GetFileNameWithoutExtension(this.txtPath.Text);
????????????}
????????????if?(xjShpSaveFileDialog.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????this.txtShpPath.Text?=?xjShpSaveFileDialog.FileName;
????????????}
????????}
????????//檢查數(shù)據(jù)和路徑
????????private?bool?CheckDataAndPath()
????????{
????????????if?(this.txtPath.Text?==?““?||?!File.Exists(this.txtPath.Text))
????????????{
????????????????MessageBox.Show(“數(shù)據(jù)無效!?。 ?“錯誤“?MessageBoxButtons.OK);
????????????????return?false;
????????????}
????????????if?(this.txtShpPath.Text?==?““?||?System.IO.Path.GetExtension(this.txtShpPath.Text).ToLower()?!=?“.shp“)
????????????{
????????????????MessageBox.Show(“Shp矢量點保存路徑無效!??!“?“錯誤“?MessageBoxButtons.OK);
????????????????return?false;
????????????}
????????????return?true;
????????}
????????//轉(zhuǎn)換
????????private?void?btnConvert_Click(object?sender?EventArgs?e)
????????{
????????????if?(CheckDataAndPath())
????????????{
????????????????List?xjPointList?=?GetPoint(this.txtPath.Text);
????????????????if?(xjPointList?==?null)
????????????????{
????????????????????MessageBox.Show(“選擇文件是空的,轉(zhuǎn)毛線啊“);
????????????????}
????????????????else
????????????????{
????????????????????IFeaturelayer?pFeaturelayer?=?CreateShpFromPoints(xjPointList?this.txtShpPath.Text);
????????????????????this.axMapControl1.Map.Addlayer(pFeaturelayer);
????????????????}
????????????}
????????}
????????
????????//結(jié)構(gòu)體
????????struct?Point
????????{
????????????//public?string?Name;//可加序號
????????????public?do
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????20992??2018-07-10?22:27??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\bin\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.exe
?????文件??????40448??2018-07-10?22:27??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\bin\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.pdb
?????文件??????11600??2018-07-10?22:28??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\bin\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.vshost.exe
?????文件????????490??2015-07-10?19:01??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\bin\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.vshost.exe.manifest
?????文件???????7826??2018-07-10?22:28??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\MainForn.cs
?????文件??????11722??2018-03-23?22:09??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\MainForn.Designer.cs
?????文件??????10479??2018-03-23?22:09??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\MainForn.resx
?????文件?????126610??2018-07-10?22:16??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????7573??2018-07-10?22:27??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????3363??2018-07-10?22:28??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.csproj.FileListAbsolute.txt
?????文件????????978??2018-07-10?20:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.csproj.GenerateResource.Cache
?????文件??????70368??2018-07-10?22:19??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.csprojResolveAssemblyReference.cache
?????文件??????20992??2018-07-10?22:27??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.exe
?????文件???????3311??2018-07-10?22:19??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.MainForn.resources
?????文件??????40448??2018-07-10?22:27??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.pdb
?????文件????????180??2018-07-10?22:19??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.Properties.Resources.resources
?????文件????????611??2018-03-23?21:59??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\Program.cs
?????文件???????1404??2018-03-23?21:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\Properties\AssemblyInfo.cs
?????文件???????2924??2018-03-23?21:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\Properties\Resources.Designer.cs
?????文件???????5612??2018-03-23?21:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\Properties\Resources.resx
?????文件???????1123??2018-03-23?21:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\Properties\Settings.Designer.cs
?????文件????????249??2018-03-23?21:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\Properties\Settings.settings
?????文件???????6283??2018-07-10?22:19??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.csproj
?????文件????????950??2018-03-23?21:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.sln
????..A..H.?????31232??2018-07-10?22:28??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010.suo
?????目錄??????????0??2018-03-23?21:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug\TempPE
?????目錄??????????0??2018-07-10?22:27??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86\Debug
?????目錄??????????0??2018-07-10?20:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\bin\Debug
?????目錄??????????0??2018-03-23?21:52??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\bin\Release
?????目錄??????????0??2018-05-10?21:35??TxtToShpPointVS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\txt坐標(biāo)數(shù)據(jù)轉(zhuǎn)Shp矢量點VS2010\obj\x86
............此處省略9個文件信息
評論
共有 條評論