如何将 TLE 信息转换为经度、纬度和海拔高度以显示在 Bing 地图上?

发布于 2024-09-06 16:23:11 字数 1932 浏览 10 评论 0原文

我正在使用 OrbitTools 库来开发卫星跟踪系统,使用类似于 < a href="http://karhukoti.com" rel="nofollow noreferrer">http://karhukoti.com。

我在这个领域并不了解,也缺乏很多与卫星跟踪相关的信息,但我已经开始自学,因为这个特定的项目被我的导师选为毕业项目。

然而,我遇到了很多困难,其中一个主要的困难是如何将两线元素(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 库。

非常感谢。

I am using the OrbitTools library to develop a satellite tracking system using the Bing Maps Silverlight control similar to http://karhukoti.com.

I am not knowledgeable in this domain and lack a lot of the information related to satellite tracking but have started teaching myself as this particular project was chosen by my supervisor as a graduation project.

However, i faced numerous difficulties, a major one is how to convert Two Line Elements (TLE) information to longitude latitude and altitude to display the satellite and satellite path on the map.

I tried the following C# code:

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);
  }
}

and also tried

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);
  }
}

Can you please tell me what i'm doing wrong here? I searched the net for examples or documention about OrbitTools but with no luck.

I really hope that someone using this library could help me or suggest a better .NET library.

Thank you very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日久见人心 2024-09-13 16:23:11

这仍然是你所苦苦挣扎的事情吗?当我拉下代码时,我注意到他们有一个与库一起提供的演示。他们在其中展示了以下方法,我相信您一定已经看过:

static void PrintPosVel(Tle tle)
{
轨道 轨道 = new Orbit(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);
     }
  }

在这方面,他们似乎正在进行您正在寻找的转换。我是否遗漏了您实际遇到的问题是什么?

Is this still something you are struggling with? I noticed when I pulled down the code that they have a demo that they provide along with the library. In it they show the following method which I'm sure you must have looked at:

static void PrintPosVel(Tle tle)
{
Orbit orbit = new Orbit(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);
     }
  }

In this it seems that they are making the conversion that you are looking for. Am I missing something as to what the problem is that you are actually having?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文