【IT168技术文档】
这是以前初学c#时,拿来练手的东西。功能很简单,就是读取kml格式的路径坐标(在ge上,我自己手工用鼠标拾取,并保存为kml文件),经过那个经纬度的什么变换后,显示出平面图形。
我的目标是自己独立(可以和其他朋友一起)完成一套实用的,可扩展的gis系统。呵呵,目标是不是有点过大了,不过就是定个目标督促自己好好干而已。本着一腔热血,来向各位高人前辈学习。大家请批评指正,能给出建议当然更好了。
图种红蓝两色分别是变换前后的对比(变换前为经纬度坐标)。
Form1.Designer.cs代码:
1namespace WindowsTest 2{ 3 partial class Form1 4 { 5 /**//// <summary> 6 /// Required designer variable. 7 /// </summary> 8 private System.ComponentModel.IContainer components = null; 9 10 /**//// <summary> 11 /// Clean up any resources being used. 12 /// </summary> 13 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> 14 protected override void Dispose(bool disposing) 15 { 16 if (disposing && (components != null)) 17 { 18 components.Dispose(); 19 } 20 base.Dispose(disposing); 21 } 22 23 Windows Form Designer generated code#region Windows Form Designer generated code 24 25 /**//// <summary> 26 /// Required method for Designer support - do not modify 27 /// the contents of this method with the code editor. 28 /// </summary> 29 private void InitializeComponent() 30 { 31 this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); 32 this.button1 = new System.Windows.Forms.Button(); 33 this.button2 = new System.Windows.Forms.Button(); 34 this.label1 = new System.Windows.Forms.Label(); 35 this.CoorX = new System.Windows.Forms.Label(); 36 this.CoorY = new System.Windows.Forms.Label(); 37 this.panel1 = new System.Windows.Forms.Panel(); 38 this.SuspendLayout(); 39 // 40 // openFileDialog1 41 // 42 this.openFileDialog1.FileName = "openFileDialog1"; 43 this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk); 44 // 45 // button1 46 // 47 this.button1.Location = new System.Drawing.Point(21, 12); 48 this.button1.Name = "button1"; 49 this.button1.Size = new System.Drawing.Size(75, 23); 50 this.button1.TabIndex = 0; 51 this.button1.Text = "打开"; 52 this.button1.UseVisualStyleBackColor = true; 53 this.button1.Click += new System.EventHandler(this.button1_Click); 54 // 55 // button2 56 // 57 this.button2.Location = new System.Drawing.Point(21, 52); 58 this.button2.Name = "button2"; 59 this.button2.Size = new System.Drawing.Size(75, 23); 60 this.button2.TabIndex = 1; 61 this.button2.Text = "显示"; 62 this.button2.UseVisualStyleBackColor = true; 63 this.button2.Click += new System.EventHandler(this.button2_Click); 64 // 65 // label1 66 // 67 this.label1.AutoSize = true; 68 this.label1.Location = new System.Drawing.Point(146, 57); 69 this.label1.Name = "label1"; 70 this.label1.Size = new System.Drawing.Size(41, 12); 71 this.label1.TabIndex = 2; 72 this.label1.Text = "label1"; 73 // 74 // CoorX 75 // 76 this.CoorX.AutoSize = true; 77 this.CoorX.Location = new System.Drawing.Point(146, 17); 78 this.CoorX.Name = "CoorX"; 79 this.CoorX.Size = new System.Drawing.Size(41, 12); 80 this.CoorX.TabIndex = 3; 81 this.CoorX.Text = "label2"; 82 // 83 // CoorY 84 // 85 this.CoorY.AutoSize = true; 86 this.CoorY.Location = new System.Drawing.Point(241, 17); 87 this.CoorY.Name = "CoorY"; 88 this.CoorY.Size = new System.Drawing.Size(41, 12); 89 this.CoorY.TabIndex = 4; 90 this.CoorY.Text = "label3"; 91 // 92 // panel1 93 // 94 this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 95 this.panel1.Location = new System.Drawing.Point(243, 57); 96 this.panel1.Name = "panel1"; 97 this.panel1.Size = new System.Drawing.Size(300, 300); 98 this.panel1.TabIndex = 5; 99 this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint); 100 // 101 // Form1 102 // 103 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 104 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 105 this.ClientSize = new System.Drawing.Size(565, 376); 106 this.Controls.Add(this.panel1); 107 this.Controls.Add(this.CoorY); 108 this.Controls.Add(this.CoorX); 109 this.Controls.Add(this.label1); 110 this.Controls.Add(this.button2); 111 this.Controls.Add(this.button1); 112 this.Name = "Form1"; 113 this.Text = "Form1"; 114 this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove); 115 this.ResumeLayout(false); 116 this.PerformLayout(); 117 118 } 119 120 #endregion 121 122 private System.Windows.Forms.OpenFileDialog openFileDialog1; 123 private System.Windows.Forms.Button button1; 124 private System.Windows.Forms.Button button2; 125 private System.Windows.Forms.Label label1; 126 private System.Windows.Forms.Label CoorX; 127 private System.Windows.Forms.Label CoorY; 128 private System.Windows.Forms.Panel panel1; 129 } 130}