• 大小: 504KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: 其他
  • 标签: 水准网  平差  

资源简介

水准网平差功能:可以通过读取txt文件格式,通过软件进行水准网平差,得出结果通过Excel表格输出。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLevel
{
    class Level//水准网平差
    {
        public static void Calculate_H0(int Hn int Kn int Tn int[] SH int[] EH double[] L double[] CH)//近似高程计算
        {
            // Hn为高差总数,Kn为已知点数,Tn为总点数,SH为高差起点号,EH为高差终点号,L为观测值,CH为高程值近似值
            for (int i = Kn; i < Tn; i++)
            {
                CH[i] = -9999.9;//将未知点的高程值赋值为-9999.0
            }
            int jj = 0;//计算出近似高程的点数
            for (int ii = 1; ; ii++)
            {
                for (int i = 0; i < Hn; i++)
                {
                    int k1 = SH[i];
                    int k2 = EH[i];
                    if (CH[k1] > -9999.0 && CH[k2] < -9999.0)
                    {
                        CH[k2] = CH[k1] + L[i];
                        jj++;
                    }
                    else if (CH[k1] < -9999.0 && CH[k2] > -9999.0)
                    {
                        CH[k1] = CH[k2] - L[i];
                        jj++;
                    }
                }

                if (jj == (Tn - Kn))
                {
                    break;
                }
                //if (jj > (m_Tnumber - m_Knumber))
                //{
                //    string file = “未计算出概略高程的点“ + “.txt“;
                //    StreamWriter wfile = new StreamWriter(file);
                //    for (int i = 0; i < m_Tnumber; i++)
                //    {
                //        if (Height[i] < -9999.0)
                //        {
                //            wfile.WriteLine(Pname[i]);
                //        }
                //        Console.WriteLine(“近似高程计算失败!“);
                //        wfile.Close();
                //    }
                //}
            }
        }
        public static void Calculate_ATPA(int Hn int Tn int[] SH int[] EH double[] CH double[] _P double[] _L out double[] _ATPA out  double[] _ATPL)//组成法方程
        {
            //Hn为高差总数,Tn为总点数,SH为高差起点号,EH为高差终点号,CH为高程值近似值,_P为观测值的权,_L为观测值,_ATPA为法方程系数矩阵,_ATPL为自由项
            _ATPA = new double[Tn * (Tn + 1) / 2];
            _ATPL = new double[Tn];
            int t = Tn;
            for (int i = 0; i < t * (t + 1) / 2; i++)
            {
                _ATPA[i] = 0.0;
            }
            for (int i = 0; i < t; i++)
            {
                _ATPL[i] = 0.0;
            }

            for (int k = 0; k < Hn; k++)
            {
                int i = SH[k];
                int j = EH[k];
                double Pk = _P[k];
                double Lk = _L[k] - (CH[j] - CH[i]);

                _ATPL[i] -= Pk * Lk;
                _ATPL[j] += Pk * Lk;
                _ATPA[ij(i i)] += Pk;
                _ATPA[ij(j j)] += Pk;
                _ATPA[ij(i j)] -= Pk;
            }
        }
        public static void Calculate_dX(int Tn double[] _ATPA double[] _ATPL double[] _dX double[] AH)//平差值

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-17 22:37  LevelAdjust\
     目录           0  2017-06-07 16:18  LevelAdjust\LevelAdjust\
     文件      231424  2011-10-12 12:50  LevelAdjust\LevelAdjust.exe
     文件         875  2011-10-09 15:54  LevelAdjust\LevelAdjust.sln
     文件       22016  2011-10-17 19:21  LevelAdjust\LevelAdjust.suo
     目录           0  2017-06-07 16:18  LevelAdjust\LevelAdjust\bin\
     目录           0  2017-06-07 16:18  LevelAdjust\LevelAdjust\bin\Debug\
     文件        1988  2011-10-12 12:50  LevelAdjust\LevelAdjust\bin\Debug\LevelAdjust.application
     文件      231424  2011-10-12 12:50  LevelAdjust\LevelAdjust\bin\Debug\LevelAdjust.exe
     文件        4168  2011-10-12 12:50  LevelAdjust\LevelAdjust\bin\Debug\LevelAdjust.exe.manifest
     文件       42496  2011-10-12 12:50  LevelAdjust\LevelAdjust\bin\Debug\LevelAdjust.pdb
     文件        1988  2011-10-12 12:50  LevelAdjust\LevelAdjust\bin\Debug\LevelAdjust.vshost.application
     文件       22984  2016-12-20 18:52  LevelAdjust\LevelAdjust\bin\Debug\LevelAdjust.vshost.exe
     文件        4168  2011-10-12 12:50  LevelAdjust\LevelAdjust\bin\Debug\LevelAdjust.vshost.exe.manifest
     目录           0  2008-04-15 11:17  LevelAdjust\LevelAdjust\bin\Release\
     文件        6521  2011-10-09 20:20  LevelAdjust\LevelAdjust\Level.cs
     文件        7605  2011-10-10 21:52  LevelAdjust\LevelAdjust\LevelAdjust.csproj
     文件         638  2016-05-25 19:28  LevelAdjust\LevelAdjust\LevelAdjust.csproj.user
     文件       21992  2016-05-22 10:14  LevelAdjust\LevelAdjust\Main.cs
     文件        6129  2011-10-09 20:30  LevelAdjust\LevelAdjust\Main.Designer.cs
     文件      155637  2011-10-09 20:30  LevelAdjust\LevelAdjust\Main.resx
     文件       99678  2011-10-09 20:26  LevelAdjust\LevelAdjust\MiscApps.ico
     目录           0  2017-06-07 16:18  LevelAdjust\LevelAdjust\obj\
     目录           0  2017-06-07 16:18  LevelAdjust\LevelAdjust\obj\x86\
     目录           0  2017-06-07 16:18  LevelAdjust\LevelAdjust\obj\x86\Debug\
     文件           0  2016-05-25 19:25  LevelAdjust\LevelAdjust\obj\x86\Debug\build.force
     文件        5590  2016-12-20 18:52  LevelAdjust\LevelAdjust\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7518  2016-12-20 18:52  LevelAdjust\LevelAdjust\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件        1340  2011-10-10 21:52  LevelAdjust\LevelAdjust\obj\x86\Debug\GenerateResource.read.1.tlog
     文件        1690  2011-10-10 21:52  LevelAdjust\LevelAdjust\obj\x86\Debug\GenerateResource.write.1.tlog
     文件        1988  2011-10-12 12:50  LevelAdjust\LevelAdjust\obj\x86\Debug\LevelAdjust.application
............此处省略31个文件信息

评论

共有 条评论