示例#1
0
        public void Test_EvaluateFromCache(string c, double height)
        {
            using (var geoid = new Geoid("egm84-30",
                                         Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "geoids")))
            {
                geoid.CacheAll();

                var coord = new GeoCoords(c);
                var h     = geoid.Evaluate(coord);

                Assert.AreEqual(height, h, 1e-4);
            }
        }
示例#2
0
 private void OnValidate(object sender, EventArgs e)
 {
     try
     {
         Geoid g = new Geoid(m_fileName, m_path, false, false);
         g.CacheArea(20.0, -30.0, 30.0, -20.0);
         g.CacheAll();
         double h2 = g.Height(32.0, -60.0);
         g.ConvertHeight(32.0, -60.0, 100.0, Geoid.ConvertFlag.ELLIPSOIDTOGEOID);
         MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception xcpt)
     {
         MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#3
0
 private void OnValidate(object sender, EventArgs e)
 {
     try
     {
         Geoid g = new Geoid(m_fileName, m_path, false, false);
         g.CacheArea(20.0, -30.0, 30.0, -20.0);
         g.CacheAll();
         double gradx, grady;
         double h1 = g.Height(32.0, -60.0, out gradx, out grady);
         double h2 = g.Height(32.0, -60.0);
         if (h1 != h2)
             throw new Exception("Error in Geoid.Height");
         g.ConvertHeight(32.0, -60.0, 100.0, Geoid.ConvertFlag.ELLIPSOIDTOGEOID);
         MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception xcpt)
     {
         MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }