资源简介
开发环境VS2008,坐标点数据为TXT或者excel格式,程序读取坐标点,并转换为shp文件输出,保存后的shp文件可以在其他程序中打开,绘制的是多边形

代码片段和文件信息
using System;
using System.Collections;
using System.Collections.objectModel;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Windows.Forms;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Display;
using System.IO;
using System.Data.OleDb;
using SharpMap;
using SharpMap.Data.Providers;
namespace XYtoShp
{
public partial class Form1 : Form
{
IPoint pt = new PointClass();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
IAoInitialize m_aoinitialize = new AoInitializeClass();
m_aoinitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
}
private void button1_Click(object sender EventArgs e)
{
if (textBox1.Text == ““ || textBox2.Text == ““ || textBox3.Text == ““ ||
textBox4.Text == ““ || textBox5.Text == ““ || textBox6.Text == ““)
{
MessageBox.Show(“请完善坐标信息!“);
return;
}
if (textBox7.Text == ““ || textBox8.Text == ““ || textBox9.Text == ““ ||
textBox10.Text == ““ || textBox11.Text == ““ || textBox12.Text == ““)
{
MessageBox.Show(“请完善坐标信息!“);
return;
}
if (textBox13.Text == ““)
{
MessageBox.Show(“请选择生成路径!“);
return;
}
axMapControl1.Clearlayers();
//判断生成的文件是否已存在,如果存在,则删掉已存在的文件;
string inSHPpath = textBox13.Text;
string shpDirName = System.IO.Path.GetDirectoryName(inSHPpath);
string shpName1 = System.IO.Path.GetFileNameWithoutExtension(inSHPpath);
string shpFullName = shpName1 + “.shp“;
string prjName = shpName1 + “.prj“;
string dbfName = shpName1 + “.dbf“;
string shxName = shpName1 + “.shx“;
string sbnName = shpName1 + “.sbn“;
string xmlName = shpName1 + “.shp.xml“;
string sbxName = shpName1 + “.sbx“;
if (System.IO.File.Exists(shpDirName + “\\“ + shpFullName))
System.IO.File.Delete(shpDirName + “\\“ + shpFullName);
if (System.IO.File.Exists(shpDirName + “\\“ + prjName))
System.IO.File.Delete(shpDirName + “\\“ + prjName);
if (System.IO.File.Exists(shpDirName + “\\“ + dbfName))
System.IO.File.Delete(shpDirName + “\\“ + dbfName);
if (System.IO.File.Exists(shpDirName + “\\“ + shxName))
System.IO.File.Delete(shpDirName + shxName
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1472 2008-07-31 09:43 XYtoShp\open.jpg
文件 307200 2012-08-03 15:55 XYtoShp\SharpMap.dll
文件 49152 2007-04-04 01:08 XYtoShp\SharpMap.UI.dll
文件 1100392 2007-10-10 09:48 XYtoShp\XYtoShp\bin\Debug\Microsoft.Office.Interop.Excel.dll
文件 64088 2007-10-10 09:48 XYtoShp\XYtoShp\bin\Debug\Microsoft.Vbe.Interop.dll
文件 223800 2007-10-10 09:48 XYtoShp\XYtoShp\bin\Debug\office.dll
文件 307200 2012-08-03 15:55 XYtoShp\XYtoShp\bin\Debug\SharpMap.dll
文件 49152 2007-04-04 01:08 XYtoShp\XYtoShp\bin\Debug\SharpMap.UI.dll
文件 33280 2012-08-14 14:41 XYtoShp\XYtoShp\bin\Debug\XYtoShp.exe
文件 40448 2012-08-14 14:41 XYtoShp\XYtoShp\bin\Debug\XYtoShp.pdb
文件 14328 2012-08-14 14:56 XYtoShp\XYtoShp\bin\Debug\XYtoShp.vshost.exe
文件 490 2007-07-21 01:33 XYtoShp\XYtoShp\bin\Debug\XYtoShp.vshost.exe.manifest
文件 31077 2012-08-14 14:41 XYtoShp\XYtoShp\Form1.cs
文件 26784 2012-08-07 16:23 XYtoShp\XYtoShp\Form1.Designer.cs
文件 13846 2012-08-07 16:23 XYtoShp\XYtoShp\Form1.resx
文件 122536 2012-08-06 09:19 XYtoShp\XYtoShp\obj\Debug\ResolveAssemblyReference.cache
文件 757 2012-08-14 14:56 XYtoShp\XYtoShp\obj\Debug\XYtoShp.csproj.FileListAbsolute.txt
文件 847 2012-08-07 16:23 XYtoShp\XYtoShp\obj\Debug\XYtoShp.csproj.GenerateResource.Cache
文件 33280 2012-08-14 14:41 XYtoShp\XYtoShp\obj\Debug\XYtoShp.exe
文件 5801 2012-08-07 16:23 XYtoShp\XYtoShp\obj\Debug\XYtoShp.Form1.resources
文件 40448 2012-08-14 14:41 XYtoShp\XYtoShp\obj\Debug\XYtoShp.pdb
文件 180 2012-08-06 09:19 XYtoShp\XYtoShp\obj\Debug\XYtoShp.Properties.Resources.resources
文件 1472 2008-07-31 09:43 XYtoShp\XYtoShp\open.jpg
文件 488 2012-08-02 10:47 XYtoShp\XYtoShp\Program.cs
文件 1346 2012-08-02 10:47 XYtoShp\XYtoShp\Properties\AssemblyInfo.cs
文件 2864 2012-08-02 10:47 XYtoShp\XYtoShp\Properties\Resources.Designer.cs
文件 5612 2012-08-02 10:47 XYtoShp\XYtoShp\Properties\Resources.resx
文件 1092 2012-08-02 10:47 XYtoShp\XYtoShp\Properties\Settings.Designer.cs
文件 249 2012-08-02 10:47 XYtoShp\XYtoShp\Properties\Settings.settings
文件 1100392 2007-10-10 09:48 XYtoShp\XYtoShp\XYtoShp\bin\Debug\Microsoft.Office.Interop.Excel.dll
............此处省略59个文件信息
相关资源
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
评论
共有 条评论