资源简介
C#+ArcEngine:txt坐标数据转Shp矢量点
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
namespace TxtToShpPoint
{
public partial class Form1 : Form
{
public Form1()
{
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
InitializeComponent();
}
//选择Txt文件
private void btn_TxtPath_Click(object sender EventArgs e)
{
OpenFileDialog xjTxtOpenFileDialog = new OpenFileDialog();
xjTxtOpenFileDialog.Multiselect = false;
xjTxtOpenFileDialog.title = “打开txt坐标文件“;
xjTxtOpenFileDialog.Filter = “txt坐标文件(*.txt)|*.txt“;
if (xjTxtOpenFileDialog.ShowDialog() == DialogResult.OK)
{
txt_TxtPath.Text = xjTxtOpenFileDialog.FileName;
}
}
//Shp矢量点保存路径
private void btn_ShpPath_Click(object sender EventArgs e)
{
SaveFileDialog xjShpSaveFileDialog = new SaveFileDialog();
xjShpSaveFileDialog.Filter = “Shape文件(*.shp)|*.shp“;
if (File.Exists(txt_TxtPath.Text))
{
xjShpSaveFileDialog.FileName = System.IO.Path.GetFileNameWithoutExtension(txt_TxtPath.Text);
}
if (xjShpSaveFileDialog.ShowDialog() == DialogResult.OK)
{
txt_ShpPath.Text = xjShpSaveFileDialog.FileName;
}
}
//显示保存
//检查数据和路径
private bool Check()
{
if (txt_TxtPath.Text == ““ || !File.Exists(txt_TxtPath.Text))
{
MessageBox.Show(“数据无效哇,重选“ “提示“ MessageBoxButtons.OK);
return false;
}
if (txt_ShpPath.Text == ““ || System.IO.Path.GetExtension(txt_ShpPath.Text).ToLower() != “.shp“)
{
MessageBox.Show(“Shp矢量点保存路径无效哇,重选“ “提示“ MessageBoxButtons.OK);
return false;
}
return true;
}
//结构体
struct Point
{
public string Name;
public double X;
public double Y;
}
List xjColumn = new List();
//获取点数据
private List GetPoint(string surveyDataFullName)
{
try
{
List xjList = new List();
char[] xjchar = new char[] { ‘‘ ‘ ‘ ‘\t‘ }; //常用的分隔符为逗号、空格、制位符
//读取
FileStream xjFileStream = new FileStream(surveyDataFullName FileMode.Open);
StreamReader xjStreamReader = new StreamReader(xjFileStream Encoding.Default);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 187 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\App.config
文件 21504 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\bin\Debug\TxtToShpPoint.exe
文件 187 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\bin\Debug\TxtToShpPoint.exe.config
文件 30208 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\bin\Debug\TxtToShpPoint.pdb
文件 22984 2016-12-02 11:29 TxtToShpPoint\TxtToShpPoint\bin\Debug\TxtToShpPoint.vshost.exe
文件 187 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\bin\Debug\TxtToShpPoint.vshost.exe.config
文件 7474 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\Form1.cs
文件 13025 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\Form1.Designer.cs
文件 10557 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\Form1.resx
文件 128848 2016-12-02 11:10 TxtToShpPoint\TxtToShpPoint\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7920 2016-12-02 11:25 TxtToShpPoint\TxtToShpPoint\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 0 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
文件 816 2016-12-02 11:29 TxtToShpPoint\TxtToShpPoint\obj\Debug\TxtToShpPoint.csproj.FileListAbsolute.txt
文件 975 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\obj\Debug\TxtToShpPoint.csproj.GenerateResource.Cache
文件 65902 2016-12-02 11:26 TxtToShpPoint\TxtToShpPoint\obj\Debug\TxtToShpPoint.csprojResolveAssemblyReference.cache
文件 21504 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\obj\Debug\TxtToShpPoint.exe
文件 3329 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\obj\Debug\TxtToShpPoint.Form1.resources
文件 30208 2016-12-02 11:28 TxtToShpPoint\TxtToShpPoint\obj\Debug\TxtToShpPoint.pdb
文件 180 2016-12-02 11:26 TxtToShpPoint\TxtToShpPoint\obj\Debug\TxtToShpPoint.Properties.Resources.resources
文件 612 2016-12-02 11:18 TxtToShpPoint\TxtToShpPoint\Program.cs
文件 1346 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\Properties\AssemblyInfo.cs
文件 2878 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\Properties\Resources.Designer.cs
文件 5612 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\Properties\Resources.resx
文件 1100 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\Properties\Settings.Designer.cs
文件 249 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint\Properties\Settings.settings
文件 6342 2016-12-02 11:26 TxtToShpPoint\TxtToShpPoint\TxtToShpPoint.csproj
文件 929 2016-12-02 11:08 TxtToShpPoint\TxtToShpPoint.sln
..A..H. 34816 2016-12-02 11:29 TxtToShpPoint\TxtToShpPoint.v11.suo
............此处省略13个文件信息
相关资源
- C# ArcEngine加载打开Las点云数据
- C#+ArcEngine:矢量点转栅格-1VS2010窗体
- C# Json转换DataTable源文件
- 利用C#打开EXCEL并将数据更新保
- C#中读取Excel表格数据
- C#连接oracle数据库增删改查
- 基于GPRS的远程通讯C#程序SOCKET部分带
- Asp.net无刷新添加删除数据库(Jquery
- C#:ARGB与16进制颜色显示与转换
- csv格式的鸢尾花数据集iris
- pokemon游戏cp值数据 来自李宏毅 (Hu
- 乳腺癌威斯康星预后数据集
- watermelon_3a.csv
- C#使用post发送和接收数据的方法
- ASP.NET保存PDF、Word和Excel文件到数据库
- TEXT文本批量转shapefile文件
- Unity5实战使用C#和Unity开发多平台游戏
- 客户订单管理系统源代码+数据库
- 汉口长江每月流量数据
- c#窗体应用程序实现数据库增删改查
- 餐厅点餐系统设计,毕设
- C#做的WIN窗体程序-对表的增删改查,
- C# 远程备份oracle数据库
- 刘铁猛《深入浅出WPF》全套真高清视
- 转台控制程序C#
- 药品管理系统C#版
- C#版图像处理界面,包含二值化、灰度
- C#远程连接SQLserver 数据库
- C# .Net Socket TCP 大数据 大文件 传输 经
- c# 如何删除datagridview中数据并删除数
评论
共有 条评论