• 大小: 57KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-20
  • 语言: C#
  • 标签: c#  gis  

资源简介

gis原理时做的作业,感觉挺麻烦 四叉树索引 c#

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Collections;

namespace taste.txt
{
    public partial class Form1 : Form
    {
        Font font = new Font(“Arial“ 10 Fontstyle.Regular);
        ArrayList arrText = new ArrayList();
        ArrayList shuxing = new ArrayList();
        ArrayList Peano = new ArrayList();
        ArrayList Len = new ArrayList();
        int i = -1;
        public Form1()
        {
            InitializeComponent();
        }
        #region//导入文件
        public void input()
        {
            StreamReader objReader = new StreamReader(openFileDialog1.FileName);
            StreamReader objReader1 = new StreamReader(openFileDialog1.FileName);
            string sLine = ““;
            string Line = ““;
            int j = 0;

            while (Line != null)
            {
                Line = objReader1.ReadLine();
                i = i + 1;//算出文本的行数
            }
            string[] tokens = new string[i];
            string[][] tokens1 = new string[i][];
            while (sLine != null)
            {
                sLine = objReader.ReadLine();
                if (sLine != null)
                {
                    tokens[j] = sLine;
                    tokens1[j] = new string[sLine.Length];
                    tokens1[j] = sLine.Split(‘ ‘);
                    shuxing.Add(tokens1[j][0]);
                    float[] dian = new float[tokens1[j].Length];
                    for (int k = 1; k < tokens1[j].Length; k++)
                    {
                        dian[k] = Convert.ToSingle(tokens1[j][k]);
                    }
                    arrText.Add(dian);
                    textBox1.Text = textBox1.Text + sLine + “\r\n“;
                    j++;
                }
            }
            objReader.Close();
        }

        #endregion
        #region//计算Peaon键
        private void jisuan()
        {

            for (int m = 0; m < i; m++)
            {
                if (((Single[])(arrText[m])).Length == 3)//判断数据是否为点数据
                {
                    Point1 p1 = new Point1();
                    int M;
                    double x11 x12;
                    x11 = Convert.ToDouble(((Single[])(arrText[m]))[1]);
                    x12 = Convert.ToDouble(((Single[])(arrText[m]))[2]);
                    p1.ij(x11 x12);
                    M = p1.resultPeano(p1.i p1.j);//计算点的Peano键并返回给M
                    Peano.Add(M);
                    Len.Add(p1.d);
                    textBox4.Text = textBox4.Text + shuxing[m] + “\t“ + Convert.ToString(Peano[m]) + “\t“ + Convert.ToString(Len[m]) + “\r\n“;
                }
                else if (((Single[])(arrText[m])).Length == 5)//判断数据是否为线数据
                {
                    Point1 p1 = new Point1();
           

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      28672  2008-12-08 11:09  四叉树索引\taste.txt\bin\Debug\taste.txt.exe

     文件      65024  2008-12-08 11:09  四叉树索引\taste.txt\bin\Debug\taste.txt.pdb

     文件       5632  2005-12-08 14:51  四叉树索引\taste.txt\bin\Debug\taste.txt.vshost.exe

     文件      12587  2008-12-08 11:10  四叉树索引\taste.txt\Form1.cs

     文件       9524  2008-11-27 00:04  四叉树索引\taste.txt\Form1.Designer.cs

     文件       6420  2008-11-27 00:04  四叉树索引\taste.txt\Form1.resx

     文件        433  2008-11-26 22:23  四叉树索引\taste.txt\line.cs

     文件        842  2008-11-27 00:04  四叉树索引\taste.txt\obj\Debug\taste.txt.csproj.GenerateResource.Cache

     文件      28672  2008-12-08 11:09  四叉树索引\taste.txt\obj\Debug\taste.txt.exe

     文件        180  2008-11-27 00:04  四叉树索引\taste.txt\obj\Debug\taste.txt.Form1.resources

     文件      65024  2008-12-08 11:09  四叉树索引\taste.txt\obj\Debug\taste.txt.pdb

     文件        180  2008-11-16 14:19  四叉树索引\taste.txt\obj\Debug\taste.txt.Properties.Resources.resources

     文件        282  2008-12-08 11:10  四叉树索引\taste.txt\obj\taste.txt.csproj.FileList.txt

     文件        950  2008-11-28 23:00  四叉树索引\taste.txt\Point.cs

     文件        634  2008-11-26 22:22  四叉树索引\taste.txt\Polygon.cs

     文件        468  2008-11-16 14:09  四叉树索引\taste.txt\Program.cs

     文件       1172  2008-11-16 14:09  四叉树索引\taste.txt\Properties\AssemblyInfo.cs

     文件        579  2008-11-26 22:37  四叉树索引\taste.txt\Properties\DataSources\Form1.datasource

     文件       2872  2008-11-16 14:09  四叉树索引\taste.txt\Properties\Resources.Designer.cs

     文件       5612  2008-11-16 14:09  四叉树索引\taste.txt\Properties\Resources.resx

     文件       1092  2008-11-16 14:09  四叉树索引\taste.txt\Properties\Settings.Designer.cs

     文件        249  2008-11-16 14:09  四叉树索引\taste.txt\Properties\Settings.settings

     文件       3438  2008-11-26 22:54  四叉树索引\taste.txt\taste.txt.csproj

     文件       2004  2008-11-25 22:21  四叉树索引\taste.txt\TranPoint.cs

     文件        916  2008-11-16 14:09  四叉树索引\taste.txt.sln

    ..A..H.     21504  2008-12-05 22:19  四叉树索引\taste.txt.suo

     目录          0  2008-11-16 15:10  四叉树索引\taste.txt\obj\Debug\Refactor

     目录          0  2008-11-16 14:09  四叉树索引\taste.txt\obj\Debug\TempPE

     目录          0  2008-11-16 14:19  四叉树索引\taste.txt\bin\Debug

     目录          0  2008-12-08 11:09  四叉树索引\taste.txt\obj\Debug

............此处省略9个文件信息

评论

共有 条评论