我正在使用OrbitTools库使用类似于http://karhukoti.com的Bing Maps Silverlight控件开发卫星跟踪系统。

我对此领域不了解,并且缺乏很多与卫星跟踪有关的信息,但是由于我的上司选择了这个特定项目作为毕业项目,因此我已经开始自学。

但是,我面临许多困难,其中一个主要难题是如何将两个线元素(TLE)信息转换为经度纬度和高度,以在地图上显示卫星和卫星路径。

我尝试了以下C#代码:

protected void DisplaySatellitePath(List<Eci> Pos)
{
  MapLayer myRouteLayer = new MapLayer();
  myMap.Children.Add(myRouteLayer);

  foreach (Eci e in Pos)
  {
    CoordGeo coordinates = e.toGeo();

    Ellipse point = new Ellipse();
    point.Width = 10;
    point.Height = 10;
    point.Fill = new SolidColorBrush(Colors.Orange);
    point.Opacity = 0.65;

    //Location location = new Location(e.Position.X, e.Position.X);
    Location location = new Location(coordinates.Latitude, coordinates.Longitude);

    MapLayer.SetPosition(point, location);
    MapLayer.SetPositionOrigin(point, PositionOrigin.Center);
    myRouteLayer.Children.Add(point);
  }
}


并尝试了

protected void DisplaySatellitePathSecondGo(List<Eci> Pos)
  {
  MapLayer myRouteLayer = new MapLayer();
  myMap.Children.Add(myRouteLayer);

  foreach (Eci e in Pos)
  {

    Ellipse point = new Ellipse();

    point.Width = 10;
    point.Height = 10;
    point.Fill = new SolidColorBrush(Colors.Yellow);
    point.Opacity = 0.65;

    Site siteEquator = new Site(e.Position.X, e.Position.Y, e.Position.Z);
    Location location = new Location(siteEquator.Latitude, siteEquator.Longitude);
    MapLayer.SetPosition(point, location);
    MapLayer.SetPositionOrigin(point, PositionOrigin.Center);
    myRouteLayer.Children.Add(point);
  }
}


你能告诉我我在做什么错吗?我在网上搜索了有关OrbitTools的示例或文献,但是没有运气。

我真的希望有人使用此库可以对我有所帮助或提出更好的.NET库。

非常感谢你。

最佳答案

您还在努力吗?我注意到当我提取代码时,他们有一个与库一起提供的演示。在其中,它们显示了以下方法,我相信您一定已经看过:

静态void PrintPosVel(Tle tle)
{
轨道轨道=新轨道(tle);
ArrayList Pos = new ArrayList();

     // Calculate position, velocity
     // mpe = "minutes past epoch"
     for (int mpe = 0; mpe <= (360 * 4); mpe += 360)
     {
        // Get the position of the satellite at time "mpe".
        // The coordinates are placed into the variable "eci".
        Eci eci = orbit.getPosition(mpe);

        // Push the coordinates object onto the end of the array
        Pos.Add(eci);
     }

     // Print TLE data
     Console.Write("{0}\n", tle.Name);
     Console.Write("{0}\n", tle.Line1);
     Console.Write("{0}\n", tle.Line2);

     // Header
     Console.Write("\n  TSINCE            X                Y                Z\n\n");

     // Iterate over each of the ECI position objects pushed onto the
     // position vector, above, printing the ECI position information
     // as we go.
     for (int i = 0; i < Pos.Count; i++)
     {
        Eci e = Pos[i] as Eci;

        Console.Write("{0,4}.00 {1,16:f8} {2,16:f8} {3,16:f8}\n",
                      i * 360,
                      e.Position.X,
                      e.Position.Y,
                      e.Position.Z);
     }

     Console.Write("\n                  XDOT             YDOT             ZDOT\n\n");

     // Iterate over each of the ECI position objects in the position
     // vector again, but this time print the velocity information.
     for (int i = 0; i < Pos.Count; i++)
     {
        Eci e = Pos[i] as Eci;

        Console.Write("{0,24:f8} {1,16:f8} {2,16:f8}\n",
                      e.Velocity.X,
                      e.Velocity.Y,
                      e.Velocity.Z);
     }
  }


在这种情况下,他们似乎正在进行所需的转换。关于您实际遇到的问题,我是否有所遗漏?

08-07 20:40