资源简介
使用C#(VS2010)编写的“GIS拓扑生成”。给定【节点-弧拓扑表】,生成【弧-面】【面-弧】【弧-节点】三张拓扑表。压缩包内包含源程序以及使用说明:数据格式、源代码、操作步骤。
代码片段和文件信息
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;
namespace GIS_Topology
{
//定义弧段的结构体
struct Arc
{
public string ID; //弧段的ID号
public string startNode; //弧段的起点
public string endNode; //弧段的终点
public string leftPolygon; //弧段的左多边形
public string rightPolygon; //弧段的右多边形
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void 导入节点弧拓扑ToolStripMenuItem_Click(object sender EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.ShowDialog();
string MyFileName = openFileDialog1.FileName;
if (MyFileName.Trim() == ““)
return;
StreamReader MyReader = null;
try
{
MyReader = new StreamReader(MyFileName System.Text.Encoding.Default);
int point_mum = Convert.ToInt32(MyReader.ReadLine());
dataGridView1.RowCount = point_mum;
for (int i = 0; i < point_mum; i++)
{
string[] temp = MyReader.ReadLine().Split(‘ ‘ ‘‘);
dataGridView1[0 i].Value = temp[0];
int arc_num = temp.Length - 1;
for (int j = 0; j < arc_num - 1; j++)
dataGridView1[1 i].Value += temp[j + 1] + ““;
dataGridView1[1 i].Value += temp[arc_num];
}
}
catch
{
MessageBox.Show(“打开失败“ “信息提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
return;
}
finally
{
if (MyReader != null)
{
MyReader.Close();
}
}
}
private void 导入弧节点拓扑ToolStripMenuItem_Click(object sender EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.ShowDialog();
string MyFileName = openFileDialog1.FileName;
if (MyFileName.Trim() == ““)
return;
StreamReader MyReader = null;
try
{
MyReader = new StreamReader(MyFileName System.Text.Encoding.Default);
int arc_num = Convert.ToInt32(MyReader.ReadLine());
dataGridView2.RowCount = arc_num;
dataGridView3.RowCount = arc_num;
for (int i = 0; i < arc_num; i++)
{
string[] temp = MyReader.ReadLine().Split(‘ ‘ ‘‘);
for (int j = 0; j < 3; j++)
dataGridV
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-07-01 16:06 拓扑生成(GIS)\
文件 43 2011-10-28 22:20 拓扑生成(GIS)\Arc_Node.txt
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\
文件 15398 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Form1.Designer.cs
文件 10498 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Form1.cs
文件 8041 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Form1.resx
文件 3683 2011-10-30 18:17 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\GIS_Topology.csproj
文件 143 2011-10-30 17:57 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\GIS_Topology.csproj.user
文件 493 2011-10-30 17:56 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Program.cs
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Properties\
文件 1356 2011-10-30 17:56 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Properties\AssemblyInfo.cs
文件 2872 2011-10-30 17:56 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Properties\Resources.Designer.cs
文件 5612 2011-10-30 17:56 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Properties\Resources.resx
文件 1095 2011-10-30 17:56 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Properties\Settings.Designer.cs
文件 249 2011-10-30 17:56 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\Properties\Settings.settings
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\bin\
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\bin\Debug\
文件 15872 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\bin\Debug\GIS_Topology.exe
文件 30208 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\bin\Debug\GIS_Topology.pdb
文件 11600 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\bin\Debug\GIS_Topology.vshost.exe
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\bin\Release\
文件 15360 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\bin\Release\GIS_Topology.exe
文件 28160 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\bin\Release\GIS_Topology.pdb
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\obj\
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\obj\x86\
目录 0 2012-07-01 16:06 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\obj\x86\Debug\
文件 4440 2011-10-30 18:22 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6301 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 180 2011-10-30 18:26 拓扑生成(GIS)\GIS_Topology\GIS_Topology\GIS_Topology\obj\x86\Debug\GIS_Topology.Form1.resources
............此处省略23个文件信息
相关资源
- c#下拉列表树形菜单,带伸缩节点
-
C#中操作xm
l文件插入节点、修改、删 - treeview实现多列显示及拖动节点
- Treeview在winform中的运用从数据库动态
- c#实现拓扑关系图
- C# 图 拓扑排序
- 三点绘制圆弧测试程序
- C# 多边形拓扑结构生成算法
- C#节点的使用.zip
- C#绘制网络拓扑图
- C#实现GIS多边形拓扑程序
- C# 动态绘制直线、曲线、圆弧和填充
- C#有向图算法(邻接表包附关键路径、
- C# 拓扑排序
- Flow C#通过GDI+实现流程图绘制
- 自定义TreeView,在树节点旁添加按钮。
- TreeView拖动节点上下移动
- C#树节点的直接修改
- C#拓扑图
- C# 雷塞运动控制卡圆弧插补
- p2p在线聊天(对等节点通信)
评论
共有 条评论