資源簡介
使用C#(VS2010)編寫的“GIS拓撲生成”。給定【節(jié)點-弧拓撲表】,生成【弧-面】【面-弧】【弧-節(jié)點】三張拓撲表。壓縮包內(nèi)包含源程序以及使用說明:數(shù)據(jù)格式、源代碼、操作步驟。

代碼片段和文件信息
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
{
????//定義弧段的結(jié)構(gòu)體
????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?導入節(jié)點弧拓撲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?????????????????{
????????????????????string[]?temp?=?MyReader.ReadLine().Split(‘?‘?‘‘);
????????????????????dataGridView1[0?i].Value?=?temp[0];
????????????????????int?arc_num?=?temp.Length?-?1;
????????????????????for?(int?j?=?0;?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?導入弧節(jié)點拓撲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?????????????????{
????????????????????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個文件信息
評論
共有 條評論