资源简介
能够将以文本格式组织的坐标转换为shape格式,支持自定义转换 坐标起始行、分隔符,指定X,Y坐标的列号;可以批量选择多个TXT批量执行转换;开发环境为 :VS2010+ArcGIS10.2 +C#
![](http://www.nz998.com/pic/70116.jpg)
代码片段和文件信息
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 ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
using System.IO;
namespace EasyCartography.Text2Shape
{
public partial class FrmTxt2ShapeConverter : Form
{
#region 全局变量
///
/// 全局变量 存储阅读txt的起始行值
///
private int iStartRow = 0;
///
/// 全局变量 存储X值的所在列
///
private int iX = 1;
///
/// 全局变量 存储Y值所在列
///
private int iY = 2;
///
/// 全局变量 TXT的列分割符号 要求1个字符
///
private char cSplit=‘‘;
///
/// 全局变量 存放文本文件的路径
///
private string[] sFileNames;
///
/// 全局变量 当前要存储的要素类
///
private IFeatureClass pFeatureClass;
#endregion
#region 构造函数
///
/// 构造函数
///
public FrmTxt2ShapeConverter()
{
InitializeComponent();
}
#endregion
///
/// 选择文本
///
///
///
private void button_ChooseTxts_Click(object sender EventArgs e)
{
//打开文件对话框
OpenFileDialog pOpenFileDialog = new OpenFileDialog();
pOpenFileDialog.Filter = “文本文件(*.txt)|*.txt|所有文件(*.*)|*.*“;
pOpenFileDialog.Multiselect = true;
pOpenFileDialog.title = “选择需要构建shape的文本文件“;
if (pOpenFileDialog.ShowDialog() == DialogResult.OK)
{
sFileNames = pOpenFileDialog.FileNames;
textBox_TxtFilePath.Text = System.IO.Path.GetDirectoryName(pOpenFileDialog.FileNames[0]);
}
}
///
/// 设置shapefile路径
///
///
///
private void button_ShapePath_Click(object sender EventArgs e)
{
SaveFileDialog pSaveFileDialog = new SaveFileDialog();
pSaveFileDialog.Filter = “shapefile文件(*.shp)|*.shp|所有文件(*.*)|*.*“;
pSaveFileDialog.title = “保存shapfile“;
if (pSaveFileDialog.ShowDialog() == DialogResult.OK)
{
string sSvFileName = pSaveFileDialog.FileName;
string dir = System.IO.Path.GetDirectoryName(sSvFileName);
string filename = System.IO.Path.GetFileName(sSvFileName);
CreatePolygonFeatureClass(dir filename);
this.textBox_shapePath.Text = sSvFileName;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 490 2010-03-17 22:39 EasyCartography.Text2Shape\bin\Debug\EasyCartography.Text2Shape.vshost.exe.manifest
文件 26112 2018-05-29 08:17 EasyCartography.Text2Shape\bin\Debug\TXT转shapefile工具.exe
文件 28672 2018-06-16 10:38 EasyCartography.Text2Shape\bin\Debug\文本转shape工具V2.0.exe
文件 36352 2018-06-16 10:38 EasyCartography.Text2Shape\bin\Debug\文本转shape工具V2.0.pdb
文件 11608 2018-06-16 10:04 EasyCartography.Text2Shape\bin\Debug\文本转shape工具V2.0.vshost.exe
文件 490 2010-03-17 22:39 EasyCartography.Text2Shape\bin\Debug\文本转shape工具V2.0.vshost.exe.manifest
文件 28672 2018-06-16 10:04 EasyCartography.Text2Shape\bin\Debug\文本转shape工具V3.0.exe
文件 6724 2018-06-15 12:04 EasyCartography.Text2Shape\EasyCartography.Text2Shape.csproj
文件 15578 2018-06-16 10:32 EasyCartography.Text2Shape\FrmTxt2ShapeConverter.cs
文件 14931 2018-06-16 09:15 EasyCartography.Text2Shape\FrmTxt2ShapeConverter.Designer.cs
文件 13093 2018-06-16 09:15 EasyCartography.Text2Shape\FrmTxt2ShapeConverter.resx
文件 124858 2018-06-14 16:16 EasyCartography.Text2Shape\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7545 2018-06-16 10:38 EasyCartography.Text2Shape\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 849 2018-06-16 10:04 EasyCartography.Text2Shape\obj\x86\Debug\EasyCartography.Text2Shape.csproj.FileListAbsolute.txt
文件 863 2018-06-16 10:04 EasyCartography.Text2Shape\obj\x86\Debug\EasyCartography.Text2Shape.csproj.GenerateResource.Cache
文件 5312 2018-06-16 10:04 EasyCartography.Text2Shape\obj\x86\Debug\EasyCartography.Text2Shape.FrmTxt2ShapeConverter.resources
文件 180 2018-06-16 10:04 EasyCartography.Text2Shape\obj\x86\Debug\EasyCartography.Text2Shape.Properties.Resources.resources
文件 28672 2018-06-16 10:38 EasyCartography.Text2Shape\obj\x86\Debug\文本转shape工具V2.0.exe
文件 36352 2018-06-16 10:38 EasyCartography.Text2Shape\obj\x86\Debug\文本转shape工具V2.0.pdb
文件 617 2018-05-24 08:49 EasyCartography.Text2Shape\Program.cs
文件 1384 2018-05-23 17:31 EasyCartography.Text2Shape\Properties\AssemblyInfo.cs
文件 2904 2018-05-23 17:31 EasyCartography.Text2Shape\Properties\Resources.Designer.cs
文件 5612 2018-05-23 17:31 EasyCartography.Text2Shape\Properties\Resources.resx
文件 1113 2018-05-23 17:31 EasyCartography.Text2Shape\Properties\Settings.Designer.cs
文件 249 2018-05-23 17:31 EasyCartography.Text2Shape\Properties\Settings.settings
文件 4286 2018-05-24 11:50 EasyCartography.Text2Shape\text.ico
目录 0 2018-05-23 17:31 EasyCartography.Text2Shape\obj\x86\Debug\TempPE
目录 0 2018-06-16 10:38 EasyCartography.Text2Shape\obj\x86\Debug
目录 0 2018-06-16 10:38 EasyCartography.Text2Shape\bin\Debug
目录 0 2018-05-23 17:43 EasyCartography.Text2Shape\bin\Release
............此处省略8个文件信息
相关资源
- MvCodeReaderSDKNet海康相机SDK二次开发,
- c#实现BarTender二次开发
- POSTEK二次开发接口
- C# Cad2006二次开发之图形扩展属性读写
- bartender二次开发
- C#开发 CAD 编程基础
- wpf 视频播放(基于MediaElement)
- AE生成DEM
- 代码编辑器 FastColoredTextBox 智能提示补
- C# AES加密解密小工具
- C#自定义可限制输入、可验证信息的
- C#新中新DKQ-116D二次开发代码
- 微耕门禁控制板二次开发包
- Winform通用经典快速开发CS框架-outloo
-
MapGIS K9 ob
jects二次开发程序 - 20120102 C#漂亮的MenuStrip和ContextMenuStr
- C#潮流计算和Visio二次开发画电气接线
- C# AE属性编辑
- ArcEngine+C#二次开发教程_3SDN
- AES文件加密.rar
- AO+C# 二次开发版本基本功能源代码使
- 基于C#.NET的Autocad二次开发范例
- 热敏打印机C#二次开发包DLL
- C#基于AE空间分析源码
- ArcGIS Engine 10 二次开发 esri 内部培训资
- ArcGIS-Engine基础开发教程(C#)C#二次开
- WPF 播放器 MediaElement
- 基于c#的AE开发系统 城市查询信息系统
- 基于C#+AE构建GIS 公路灾害信息查询系
- .net生成pdf 读写pdf文件包itextsharp 5.2
评论
共有 条评论